error while compiling solver

Submitted by Carlos on Sun, 07/24/2011 - 00:27

Hello

We're trying to compile the solver for the installation of CFDEM but we get the following error:

g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/turbulenceModels/incompressible/turbulenceModel -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/transportModels -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/transportModels/incompressible/singlePhaseTransportModel -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude -I/home/carlos/OpenFOAM/carlos-1.7.x/run/../src/lagrangian/cfdemParticle//lnInclude -IlnInclude -I. -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/carlos/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/cfdemSolverPiso.o -L/home/carlos/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \
-L/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt -lincompressibleRASModels -lincompressibleLESModels -lincompressibleTransportModels -lfiniteVolume -llagrangianCFDEM_shared -lOpenFOAM -ldl -lm -o /home/carlos/OpenFOAM/carlos-1.7.x/applications/bin/linux64GccDPOpt/cfdemSolverPiso_shared
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `data_of_to_liggghts'
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `LAMMPS_NS::LAMMPS::LAMMPS(int, char**, ompi_communicator_t*)'
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `liggghts_get_maxtag'
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `allocate_external_double'
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `data_liggghts_to_of'
/home/carlos/OpenFOAM/carlos-1.7.x/lib/linux64GccDPOpt/liblagrangianCFDEM_shared.so: undefined reference to `LAMMPS_NS::Input::one(char const*)'
collect2: ld returned 1 exit status
make: *** [/home/carlos/OpenFOAM/carlos-1.7.x/applications/bin/linux64GccDPOpt/cfdemSolverPiso_shared] Error 1

We'd be very thankful if you told us how to fix this problem

Best regards

Carlos

cgoniva's picture

cgoniva | Sun, 07/24/2011 - 18:20

Hi !

When compiling CFDEM mainly four things cause troubles:

+ using a precompiled version of O.F. does not work

+ the -fPIC flag (it might be necessary to use a makefile for the compilation of liggghts which has the fPIC flags enabled)

+ the paths in the /etc/bashrc must be set correctly (check them with echo $CFDEM_xyz )

+ both liggghts and CFDEM must be compiled with the same compiler (make sure that O.F. is sourced when compiling liggghts)

hope that helps?

Cheers,
Chris