v4.3.004 (19-10-2018): not-found compilation error with Project Chrono library
Situation
I need to recompile version 4.3 to fit the settings of my system (CUDA directory and version, GCC compiler, GPU architectures). One can recognize this need from the runtime error*** Exception: Failed getting devices info. (CUDA error at FunctionsCuda.cpp:132 code=35(CUDA driver version is insufficient for CUDA runtime version))"
Action
To this end, I edited the Makefile in /src/source as done other times with 4.2.Makefile available upon requestIssue
The make sequence trips when handling the compilation of the Project Chrono modules.Evidence
The following lines are the stdout and stderr. The problem becomes visible with the not-found warning in line 81. This cascades in a lot of undefined references and in the eventual failure of the compilation recipe. Note that the shared libraries libdsphchrono and libChronoEngine are at /lib/linux_gcc/, which appears to be referenced in the -L option of line 80.[79] /usr/bin/x86_64-linux-gnu-g++-5 -c -O3 -fopenmp -D_WITHGPU -ffast-math -D_GLIBCXX_USE_CXX11_ABI=0 -I./ -I/opt64/cuda_8.0.44/include JSphGpuSingle_InOut.cppand
[80] /usr/bin/x86_64-linux-gnu-g++-5 JXml.o tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o JMotion.o JMotionList.o JMotionMov.o JMotionObj.o JMotionPos.o JSphMotion.o Functions.o FunctionsMath.o JAppInfo.o JBinaryData.o JException.o JLinearValue.o JLog2.o JMeanValues.o JObject.o JRadixSort.o JRangeFilter.o JReadDatafile.o JSaveCsv2.o JTimeControl.o randomc.o JDsphConfig.o JPartDataBi4.o JPartDataHead.o JPartFloatBi4.o JPartOutBi4Save.o JSpaceCtes.o JSpaceEParms.o JSpaceParts.o JSpaceProperties.o JSpaceVtkOut.o JArraysCpu.o JCellDivCpu.o JCfgRun.o JDamping.o JGaugeItem.o JGaugeSystem.o JPartsOut.o JSaveDt.o JSph.o JSphAccInput.o JSphCpu.o JSphInitialize.o JSphMk.o JSphPartsInit.o JSphDtFixed.o JSphVisco.o JTimeOut.o JWaveSpectrumGpu.o main.o JCellDivCpuSingle.o JPartsLoad4.o JSphCpuSingle.o FunctionsCuda.o JObjectGpu.o JArraysGpu.o JBlockSizeAuto.o JCellDivGpu.o JSphGpu.o JCellDivGpuSingle.o JSphGpuSingle.o JCellDivGpu_ker.o JCellDivGpuSingle_ker.o JGauge_ker.o JReduSum_ker.o JSphGpu_ker.o JWaveOrder2_ker.o JMLPistonsGpu.o JRelaxZonesGpu.o JRelaxZone_ker.o JChronoObjects.o JSphCpu_InOut.o JSphCpuSingle_InOut.o JSphBoundCorr.o JSphInOut.o JSphInOutGridData.o JSphInOutPoints.o JSimpleNeigs.o JSphGpuSingle_InOut.o -fopenmp -lgomp -D_GLIBCXX_USE_CXX11_ABI=0 -L/opt64/cuda_8.0.44/lib64 -lcudart -o ../../bin/linux/DualSPHysics4.3_linux64 -L./ -L../lib/linux_gcc -ljformatfiles2_64 -ljwavegen_64 -ljwave_mlp_rz_64 -ldsphchrono
[81] /usr/bin/ld: warning: libChronoEngine.so, needed by ../lib/linux_gcc/libdsphchrono.so, not found (try using -rpath or -rpath-link)
[82] ../lib/linux_gcc/libdsphchrono.so: undefined reference to `chrono::ChSystem::DoFrameDynamics(double)'
[83] ../lib/linux_gcc/libdsphchrono.so: undefined reference to `chrono::ChAssembly::IterBeginLinks()'
...
[225] collect2: error: ld returned 1 exit status
[226] Makefile:150: recipe for target '../../bin/linux/DualSPHysics4.3_linux64' failed
[227] make: *** [../../bin/linux/DualSPHysics4.3_linux64] Error 1
% ls ../lib/linux_gcc/ -1
_LibChrono_v4.3.004.txt
_Libs_v4.3.002.txt
libChronoEngine.so
libdsphchrono.so
libjformatfiles2_64.a
libjwave_mlp_rz_64.a
libjwavegen_64.a
Kindly, Giordano
------------------------------------------------
Our research on Smoothed Particle Hydrodynamics
• twitter https://twitter.com/sph_delft
• youtube http://bit.ly/sph_tube
------------------------------------------------
Comments
There's a missing flag in the Makefile. You should add the -lChronoEngine flag to the end of line 108:
JLIBS=${LIBS_DIRECTORIES} -ljformatfiles2_64 -ljwavegen_64 -ljwave_mlp_rz_64 -ldsphchrono -lChronoEngine
Best regards,
Orlando.