Error compiling CFDEM

Submitted by rodolpho101 on Wed, 09/21/2016 - 20:02

Please help me. I'm trying to compile CFDEM, I compiled with sucess openFoam 3.0.1 and LIGGGHTS 3.5.1, and the CFDEM compilation give-me this error:

-L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib64 -L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib -lmpich -lrt -L/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib -lfiniteVolume -lturbulenceModels -lcompressibleTurbulenceModels -lfluidThermophysicalModels -lmeshTools -llagrangian -L/home/vibracon/LIGGGHTS/LIGGGHTS-ASTER/src -Wl,--whole-archive -llmp_g++ -Wl,--no-whole-archive -lmpi_cxx -o /home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEMcomp-PUBLIC-3.0.x.so
/usr/bin/ld: não foi possível encontrar -lmpi_cxx
collect2: error: ld returned 1 exit status
/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/wmake/Makefile:162: recipe for target '/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEMcomp-PUBLIC-3.0.x.so' failed
make: *** [/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEMcomp-PUBLIC-3.0.x.so] Error 1

I can't fount this mpi_cxx, someone could help-me?
Thanks!

j-kerbl's picture

j-kerbl | Fri, 09/23/2016 - 11:41

Hi Rodolpho,

since you're linking against mpich and not open-mpi you should change the additionalLibs file in $CFDEM_ADD_LIBS_DIR / $CFDEM_ADD_LIBS_NAME .
In there you'll find -lmpi_cxx and you need to replace it with the mpich equivalent. This should be something as -lmpich_cxx . You should find the libraries name in home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib

Cheers,
Josef

rodolpho101 | Thu, 10/13/2016 - 19:28

Hi, thank you for your reply. I tried your solution, and the error continue:

.o Make/linux64GccDPInt32Opt/subModels/momCoupleModel/momCoupleModel/momCoupleModel.o Make/linux64GccDPInt32Opt/subModels/momCoupleModel/momCoupleModel/newMomCoupleModel.o Make/linux64GccDPInt32Opt/subModels/momCoupleModel/explicitCouple/explicitCouple.o Make/linux64GccDPInt32Opt/subModels/momCoupleModel/implicitCouple/implicitCouple.o Make/linux64GccDPInt32Opt/subModels/momCoupleModel/noCouple/noCouple.o Make/linux64GccDPInt32Opt/subModels/regionModel/regionModel/regionModel.o Make/linux64GccDPInt32Opt/subModels/regionModel/regionModel/newRegionModel.o Make/linux64GccDPInt32Opt/subModels/regionModel/allRegion/allRegion.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/dataExchangeModel/newDataExchangeModel.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/oneWayVTK/oneWayVTK.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/twoWayFiles/twoWayFiles.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/noDataExchange/noDataExchange.o Make/linux64GccDPInt32Opt/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.o Make/linux64GccDPInt32Opt/subModels/averagingModel/averagingModel/averagingModel.o Make/linux64GccDPInt32Opt/subModels/averagingModel/averagingModel/newAveragingModel.o Make/linux64GccDPInt32Opt/subModels/averagingModel/dilute/dilute.o Make/linux64GccDPInt32Opt/subModels/averagingModel/dense/dense.o Make/linux64GccDPInt32Opt/subModels/clockModel/clockModel/clockModel.o Make/linux64GccDPInt32Opt/subModels/clockModel/clockModel/newClockModel.o Make/linux64GccDPInt32Opt/subModels/clockModel/standardClock/standardClock.o Make/linux64GccDPInt32Opt/subModels/clockModel/noClock/noClock.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/liggghtsCommandModel/newLiggghtsCommandModel.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/execute/execute.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/runLiggghts/runLiggghts.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/setDEMGravity/setDEMGravity.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.o Make/linux64GccDPInt32Opt/subModels/liggghtsCommandModel/readLiggghtsData/readLiggghtsData.o Make/linux64GccDPInt32Opt/subModels/smoothingModel/smoothingModel/smoothingModel.o Make/linux64GccDPInt32Opt/subModels/smoothingModel/smoothingModel/newSmoothingModel.o Make/linux64GccDPInt32Opt/subModels/smoothingModel/noSmoothing/noSmoothing.o Make/linux64GccDPInt32Opt/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.o -L/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt32Opt/lib \
-L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib64 -L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib -lmpich -lrt -L/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib -L/usr/include -lfiniteVolume -lturbulenceModels -lincompressibleTurbulenceModels -lfvOptions -lmeshTools -llagrangian -L/home/vibracon/LIGGGHTS/LIGGGHTS-ASTER/src -Wl,--whole-archive -llmp_g++ -Wl,--no-whole-archive -lmpich_cxx -o /home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEM-PUBLIC-3.0.x.so
/usr/bin/ld: não foi possível encontrar -llmp_g++
/usr/bin/ld: não foi possível encontrar -lmpich_cxx
collect2: error: ld returned 1 exit status
/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/wmake/Makefile:162: recipe for target '/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEM-PUBLIC-3.0.x.so' failed
make: *** [/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEM-PUBLIC-3.0.x.so] Error 1
will change path...
rm: não foi possível remover '/home/vibracon/CFDEM/CFDEMcoupling-PUBLIC-3.0.x/src/lagrangian/cfdemParticle/etc/log/log_compileCFDEMcoupling_scalarTransportModelsCFDEM*': Arquivo ou diretório não encontrado
rm: não foi possível remover '/home/vibracon/CFDEM/CFDEMcoupling-PUBLIC-3.0.x/src/lagrangian/cfdemParticle/etc/log/log_compileCFDEMcoupling_scalarTransportModelsCFDEM': Arquivo ou diretório não encontrado

Do you know what are happening?

rodolpho101 | Fri, 10/14/2016 - 12:52

Help me please! I've tried to compile with other makes (fedora, fedora_fpic), and I have this same problem:

-L/home/vibracon/OpenFOAM/ThirdParty-3.0.1/platforms/linux64Gcc/mpich2-1.1.1p1/lib64 -L/home/vibracon/OpenFOAM/ThirdParty-3.0.1/platforms/linux64Gcc/mpich2-1.1.1p1/lib -lmpich -lrt -L/home/vibracon/OpenFOAM/vibracon-3.0.1/platforms/linux64GccDPInt32Opt/lib -lfiniteVolume -lturbulenceModels -lincompressibleTurbulenceModels -lfvOptions -lmeshTools -llagrangian -L/home/vibracon/LIGGGHTS/LIGGGHTS-PUBLIC-/src -Wl,--whole-archive -llmp_fedora -Wl,--no-whole-archive -lmpi_cxx -o /home/vibracon/OpenFOAM/vibracon-3.0.1/platforms/linux64GccDPInt32Opt/lib/liblagrangianCFDEM-PUBLIC-3.0.1.so
/usr/bin/ld: não foi possível encontrar -llmp_fedora
collect2: error: ld returned 1 exit status

What are happening??

ckloss's picture

ckloss | Fri, 10/14/2016 - 14:56

Hi all,

moving this to CFDEMcoupling user forum, this is not a bug report

Christoph

j-kerbl's picture

j-kerbl | Mon, 10/17/2016 - 10:26

Hi Rodolpho,

These libraries weren't found in the previous compilation.

/usr/bin/ld: não foi possível encontrar -llmp_g++
/usr/bin/ld: não foi possível encontrar -lmpich_cxx

To me this looks as your LIGGGHTS compilation failed and the posts are the results of the CFDEM compilation without LIGGGHTS as library.

I suggest the following steps:
Please go to LIGGGHTS-? /src/MAKE and copy Makefile.fedora_fpic to Makefile.fedora_mpich_fpic (the fPic option is crucial for the coupling)
Check the mpi - library settings and replace lmpi with the corresponding mpich library name.
Change the CFDEM_LIGGGHTS_MAKEFILE_NAME variable in your bashrc to fedora_mpich_fpic .
Compile LIGGGHTS with
cfdemCompLIG
If it is successful continue with
cfdemCompCFDEM

Regards,
Josef

rodolpho101 | Wed, 10/19/2016 - 19:08

Thanks for your help, I found these libraries and continue using the makefile_g++, and this error disappeared. But a new error happened, could you give-me more help?

g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -DMPICH_SKIP_MPICXX -DGITVERSION=\"3.5.1-dirty\" -DDEBUGFLAG=\"\" -DCFDEMWMPROJECTVERSION="30" -isystem /home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/include -I ./cfdemParticle -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/finiteVolume/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/transportModels -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/incompressible/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/fvOptions/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/meshTools/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/lagrangian/basic/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/containers/HashTables/labelHashSet -I/home/vibracon/LIGGGHTS/LIGGGHTS-ASTER/src -I/home/vibracon/CFDEM/CFDEMcoupling-PUBLIC-3.0.x/src/cfdTools -I/usr/include LIB_LIBS = -L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib64 -L/home/vibracon/OpenFOAM/ThirdParty-3.0.x/platforms/linux64Gcc/mpich2-1.1.1p1/lib -lmpich -lrt -L/home/vibracon/OpenFOAM/vibracon-3.0.x/platforms/linux64GccDPInt32Opt/lib -lfiniteVolume -lturbulenceModels -lincompressibleTurbulenceModels -lfvOptions -lmeshTools -llagrangian -L/home/vibracon/LIGGGHTS/LIGGGHTS-ASTER/src -Wl,--whole-archive -llmp_g++ -Wl,--no-whole-archive -lmpi_cxx -IlnInclude -I. -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/lnInclude -I/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c cfdemCloud/cfdemCloud.C -o Make/linux64GccDPInt32Opt/cfdemCloud/cfdemCloud.o
g++: error: LIB_LIBS: Arquivo ou diretório não encontrado
g++: error: =: Arquivo ou diretório não encontrado
/home/vibracon/OpenFOAM/OpenFOAM-3.0.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/cfdemCloud/cfdemCloud.o' failed
make: *** [Make/linux64GccDPInt32Opt/cfdemCloud/cfdemCloud.o] Error 1
will change path...
rm: não foi possível remover '/home/vibracon/CFDEM/CFDEMcoupling-PUBLIC-3.0.x/src/lagrangian/cfdemParticle/etc/log/log_compileCFDEMcoupling_scalarTransportModelsCFDEM*': Arquivo ou diretório não encontrado
rm: não foi possível remover '/home/vibracon/CFDEM/CFDEMcoupling-PUBLIC-3.0.x/src/lagrangian/cfdemParticle/etc/log/log_compileCFDEMcoupling_scalarTransportModelsCFDEM': Arquivo ou diretório não encontrado

j-kerbl's picture

j-kerbl | Thu, 10/20/2016 - 16:47

Hi Rodolpho,

have you by any chance touched the options file in CFDEMcoupling-PUBLIC-XXX/src/lagrangian/cfdemParticle/Make/ ?
Your compilation wants to include "LIB_LIBS" , which is a variable for compilation.
Please make sure that there this an empty line above this variable, the \ is in this case a "continue in next line" marker.
Additionally I am not sure why it tries linking at this stage of the compilation, since only the top library liblagrangian should get these linking commands.

Did you use the -fpic flags in your liggghts Makefile?
The following library appears in the linking list: -lmpi_cxx
Have you changed the used additionalLib file? (You should change the libs in $CFDEM_ADD_LIBS_DIR / $CFDEM_ADD_LIBS_NAME )

Cheers,
Josef

rodolpho101 | Fri, 10/21/2016 - 18:47

Thanks to all, the solution to my problem is:
Chance the library lmpi_cxx to lmpichcxx;
include the directory of mpi.h in options file;
Compile cfdem with cfdemCompLIG before cfdemCompCFDEM.
This solved for me, thanks for your help!

j-kerbl's picture

j-kerbl | Tue, 10/25/2016 - 16:39

Hi Rodolpho,

good to hear!

Happy simulating!
Josef