error compiling lib/gpu with opencl

Dear LAMMPS dev

I have the sdk toolkit which is no problems with running its example, however while compiling the library in LAMMPS it came out the error as shown

"mpic++ -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DLAMMPS_SMALLBIG /opt/AMDAPPSDK-3.0/include/CL/opencl.h -D_SINGLE_DOUBLE -DCYPRESS_OCL -DUS E_OPENCL -o lal_atom.o -c lal_atom.cpp -I./
g++: cannot specify -o with -c or -S with multiple file"

How to solve this error?

Regards
Min

Hi Min,

how’s the variable OCL_INC defined in the Makefile.foo you are using?

I suppose it be something like

OCL_INC = -I/opt/AMDAPPSDK-3.0/include

instead of “/opt/AMDAPPSDK-3.0/include/CL/opencl.h”

-Trung

Hi

Thanks for helping me through this. One more question, If I am using ATI gpu with model HD 7970 R280x and HD 7850 model, which OCL_TUNE should i use?

Regards
Min

Hi Min,

how’s the variable OCL_INC defined in the Makefile.foo you are using?

I suppose it be something like

OCL_INC = -I/opt/AMDAPPSDK-3.0/include

instead of “/opt/AMDAPPSDK-3.0/include/CL/opencl.h”

-Trung

Sorry I don’t have experience with those cards and thus have no specific recommendation for the settings for them.

You can always experiment yourself by trying different settings used for OCL_TUNE = -DCYPRESS_OCL, as defined in lal_preprocessor.h. For newer cards with more compute units and more (global and local) memory, I would try to increase BLOCK_PAIR and BLOCK_NBOR_BUILD; the former may have more impact on the performance than the latter. You will need to make a clean build for libgpu.a after making the changes.

Best,
-Trung