CMakeLists.txt bug for CMake build option

Dear users,

I cloned DualSPHysics v4.2 code from the github repository, and found that CMake was complaining about:

"Cannot find source file:

when trying the CMake option for building the target. It seems to be a small bug in the CMakeLists.txt following the path /src/source/CMakeLists.txt, the solution would be change JLinearValue.o into JLinearValue.cpp at line 9

Another thing that might be worth to mention is that, when building the executable (when running "make"), CMake will give an error like:

"/usr/bin/ld: CMakeFiles/DualSPHysics4.2.dir/ relocation R_X86_64_32 against symbol `_ZN5cudiv20KerSortDataParticlesEjjPKjS1_PKtS1_PK7double2PKdPK6float4PjPtSC_PS4_PdPS9_' can not be used when making a PIE object; recompile with -fPIC

which is self-explanatory, adding the -fPIC flag can solve the problem.

These errors might not be a general problem (might be dependent on gcc version, etc.), just in case someone else encounters the same problem :-)

Thanks for your consideration!


  • Thanks a lot for identifying this problem
    We have fixed this and we have update new files

  • Dear Lijing,

    thanks for your feedback! We have updated the repository :smiley:

    Best regards!!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!