hello cfdem community,
i'm trying to run the command cfdemCompCFDEM to couple CFDEM with OpenFOAM-2.4.0 and it doesn't seem to work. Besides the RASModel.H and ompi/ error, the compilation gets stopped at /usr/bin/ld: cannot find -llagrangianCFDEM-PUBLIC-2.4.0. I've attached 3 logs file for your inspection. I've changed a few variables in ~/.bashrc as follows:
# extra lines from openfoam.org
source /opt/openfoam240/etc/bashrc
# extra lines from CFDEM
export WM_PROJECT_VERSION=2.4.0
#================================================#
#- source cfdem env vars
export CFDEM_VERSION=PUBLIC
export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src
export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers
export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc
export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities
export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials
export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_bashrc=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc
export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src
# export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic # old
export CFDEM_LIGGGHTS_MAKEFILE_NAME=openmpi # new
export CFDEM_LPP_DIR=$HOME/LIGGGHTS/LPP/src
# export CFDEM_PIZZA_DIR=$HOME/LIGGGHTS/PIZZA/gran_pizza_17Aug10/src # old
export CFDEM_PIZZA_DIR=$HOME/Documents/pizza-2Jul14/src
. $CFDEM_bashrc
#================================================#
*******************************************************************************************************************
Here is the result for cfdemSysTest
*********************************************
* C F D E M (R) c o u p l i n g *
* *
* by DCS Computing GmbH *
* www.dcs-computing.com *
*********************************************
*********************************
CFDEM(R)coupling system settings:
*********************************
CFDEM_VERSION=PUBLIC
couple to OF_VERSION=2.4.0
compile option=Opt
check if paths are set correctly
valid:yes critical:yes - $CFDEM_PROJECT_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0
valid:yes critical:no - $CFDEM_PROJECT_USER_DIR = /home/anhvt89/CFDEM/anhvt89-PUBLIC-2.4.0
valid:yes critical:yes - $CFDEM_SRC_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/src
valid:yes critical:yes - $CFDEM_SOLVER_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/applications/solvers
valid:yes critical:yes - $CFDEM_TUT_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/tutorials
valid:yes critical:yes - $CFDEM_LIGGGHTS_SRC_DIR = /home/anhvt89/LIGGGHTS/LIGGGHTS-PUBLIC/src
valid:yes critical:yes - $CFDEM_LPP_DIR = /home/anhvt89/LIGGGHTS/LPP/src
valid:yes critical:yes - $CFDEM_ADD_LIBS_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/src/lagrangian/cfdemParticle/etc
valid:yes critical:no - $CFDEM_PIZZA_DIR = /home/anhvt89/Documents/pizza-2Jul14/src
valid:yes critical:no - $CFDEM_TEST_HARNESS_PATH = /home/anhvt89/CFDEM/anhvt89-PUBLIC-2.4.0/log/logFilesCFDEM-PUBLIC-2.4.0
valid:NO critical:no - $C3PO_SRC_DIR = /home/anhvt89/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/src/c3po does not exist
library names
$CFDEM_LIGGGHTS_LIB_NAME = lmp_openmpi
$CFDEM_LIB_NAME = lagrangianCFDEM-PUBLIC-2.4.0
$LD_LIBRARY_PATH = /opt/ThirdParty-2.4.0/platforms/linux64Gcc/gperftools-svn/lib:/opt/paraviewopenfoam410/lib/paraview-4.1:/opt/openfoam240/platforms/linux64GccDPOpt/lib/openmpi-system:/opt/ThirdParty-2.4.0/platforms/linux64GccDPOpt/lib/openmpi-system:/usr/lib/openmpi/lib:/home/anhvt89/OpenFOAM/anhvt89-2.4.0/platforms/linux64GccDPOpt/lib:/opt/site/2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam240/platforms/linux64GccDPOpt/lib:/opt/ThirdParty-2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam240/platforms/linux64GccDPOpt/lib/dummy
$WM_NCOMPPROCS =
*******************
g++:
/usr/bin/g++
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc:
/usr/bin/gcc
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mpic++:
/usr/bin/mpic++
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mpirun:
/usr/bin/mpirun
mpirun (Open MPI) 1.6.5
Report bugs to http://www.open-mpi.org/community/help/
**********************
additional packages...
c3po does not exist.
please let me know how to fix the problem. I also have tried to edit options in Make folder to -llagrangian and -llagrangianCFDEM but it doesn't work. I have tried to chase a few .sh files for a while but haven't got a clue yet.
many thanks,
AT
Attachment | Size |
---|---|
![]() | 186.35 KB |
![]() | 312.02 KB |
![]() | 3.06 KB |
JoG | Thu, 08/13/2015 - 11:42
Hey,
Hey,
I have the same problem with OF2.3.0 .
If you look at the cfdemCompCFDEM log file, you can see that the error actually occurs earlier:
/usr/bin/ld: /home/anhvt89/LIGGGHTS/LIGGGHTS-PUBLIC/src/liblmp_openmpi.a(angle.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/anhvt89/LIGGGHTS/LIGGGHTS-PUBLIC/src/liblmp_openmpi.a(angle.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [/home/anhvt89/OpenFOAM/anhvt89-2.4.0/platforms/linux64GccDPOpt/lib/liblagrangianCFDEM-PUBLIC-2.4.0.so] Error 1
I am no C++ expert at all, but I think the problem is that the library liblmp_openmpi was not compiled with the -fPIC flag. This means that it cannot be used as a shared library and this causes the error.
I haven't figured out how to compile with the -fPIC flag. I thnik you have to change something in the LIGGGHTS Makefile, but perhaps an expert on C++ can comment on this. So far I am stuck on this problem and I feel like it is not my fault, rather a bug in the current release of CFDEM.
anhvt2 | Thu, 08/13/2015 - 19:59
thanks for looking at the logs
hi JoG,
thanks for looking at the log. i've tried go to LIGGGHTS/src/ and found in the Makefile.shlib, the SRC and INC are not the same compared to Makefile.lib. there are a lot of files don't exist so it needs updating. also I add $(SHFLAGS) $(SHLIBFLAGS) to the command so it includes the options
$(MAKE) $(MFLAGS) $(SHFLAGS) $(SHLIBFLAGS) "OBJ = $(OBJ)" \
"INC = $(INC)" "EXE = ../$(EXE)" shlib
in src/ do
make -f Makefile.shlib openmpi. I also edit Makefile.lib as well
$(MAKE) $(MFLAGS) $(SHFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" "SHFLAGS =" \
"EXE = ../$(EXE)" lib
It still doesn't work, and I have made sure that -fPIC is included...
/usr/bin/ld: /home/anhvt89/LIGGGHTS/LIGGGHTS-PUBLIC/src/liblmp_openmpi.a(angle.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/anhvt89/LIGGGHTS/LIGGGHTS-PUBLIC/src/liblmp_openmpi.a(angle.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status
just like you said, I have a problem with .a file...
thanks again
e.derakhshani | Mon, 11/02/2015 - 17:56
Hi anhvt2,
Hello anhvt2,
Did you finally compile the solvers of CFDEM with OpenFOAM 2.4.0 ?
I had not any problem in compiling LIGGGHTS and also I received the following command after compiling the CFDEM src:
'/home/user/OpenFOAM/user-2.4.0/platforms/linux64GccDPOpt/lib/liblagrangianCFDEM-PUBLIC-2.4.0.so' is up to date.
But the solvers like cfdemsolverpiso did not compile and I saw the same error as is in your log file. The log file is as follows:
Making dependency list for source file cfdemSolverPiso.C
could not open file cyclicAMILduInterface.H for source file cfdemSolverPiso.C due to No such file or directory
could not open file cyclicAMIPolyPatch.H for source file cfdemSolverPiso.C due to No such file or directory
could not open file RASModel.H for source file cfdemSolverPiso.C due to No such file or directory
SOURCE=cfdemSolverPiso.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/turbulenceModels/incompressible/turbulenceModel -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/transportModels -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude -I/home/user/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/src/lagrangian/cfdemParticle/lnInclude -I/home/user/CFDEM/CFDEMcoupling-PUBLIC-2.4.0/src/lagrangian/cfdemParticle/cfdTools -IlnInclude -I. -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/cfdemSolverPiso.o
In file included from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/ddtScheme.C:30:0,
from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/ddtScheme.H:325,
from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcDdt.C:28,
from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcDdt.H:199,
from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:44,
from /opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:8,
from cfdemSolverPiso.C:37:
/opt/ud/OpenFOAM-2.4.0/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/cyclicAMIFvPatch.H:39:35: fatal error: cyclicAMILduInterface.H: No such file or directory
#include "cyclicAMILduInterface.H"
^
compilation terminated.
make: *** [Make/linux64GccDPOpt/cfdemSolverPiso.o] Error 1
Do you have any idea about this error?
Any suggestion by the others is appreciated.
Regards,
Ebrahim
j-kerbl | Thu, 11/05/2015 - 10:54
HI Ebrahim,
HI Ebrahim,
some remarks:
The latest supported OF Version of CFDEM-PUBLIC is
OFversion="2.3.x-commit-4d6f4a3115ff76ec4154c580eb041bc95ba4ec09";
as stated in src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
You can obtain this version by:
git clone git@github.com:OpenFOAM/OpenFOAM-2.3.x.git
cd OpenFOAM-2.3.x
git checkout 4d6f4a3115ff76ec4154c580eb041bc95ba4ec09
From this commit to 2.4.x some libraries and their positions have changed, so you have to adapt all the solvers make options. To be more specific, you have to add the meshTools library in the options.
Cheers
Josef
e.derakhshani | Thu, 11/05/2015 - 14:03
Hi Josef
Hi Josef,
Thanks for your help.
Through adding the meshTools library into the options, I successfully compiled CFDEM with OF 2.4.
Regards,
Ebrahim
JoG | Thu, 08/13/2015 - 12:03
-
Hey, I just saw that you compile with the openmpi Makefile like me. I just figured out that this Makefile does not contain the -fPIC flag in the CCFLAGS variable like in the default Makefile.fedora_fpic. I will try to compile and report back.
JoG | Thu, 08/13/2015 - 13:33
Solution and new OpenFOAM error
I could solve the problem by adding the -fPIC flag to the CCFLAGS variable in the Makefile.openmpi . The shared library in the OpenFOAM folder is created.
Now compilation is successful, but I get OpenFOAM errors, when I do the cfdemTestTUT:
rm: cannot remove `couplingFiles/*': No such file or directory
--> FOAM FATAL ERROR in Foam::findEtcFiles() : could not find mandatory file
'cellModels'.
Any thoughts on this?
anhvt2 | Thu, 08/13/2015 - 21:07
can't compile lib and shlib
i try to compile LIGGGHTS again by go to LIGGGHTS/src and
make -f Makefile.shlib openmpi
make -f Makefile.lib openmpi
it's supposed to work but it doesn't. i always thought LIGGGHTS is based on LAMMPS...
JoG | Thu, 08/13/2015 - 22:46
I don't know what you did
I don't know what you did there, but I would suggest going to the Makefile.openmpi in the LIGGGHTS/src/MAKE/ folder and add the flag -fPIC to the CCFLAGS:
CCFLAGS = -O2 \
-funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized -fPIC
This resolved the error in my case. I actually did what the compiler told me to do.
I also solved my OpenFOAM errors, they were caused by the queque system of the cluster I am working on. Now CFDEM works and I finished the first tutorial.
j-kerbl | Mon, 08/17/2015 - 14:29
Hi everyone,
Hi everyone,
the liggghts fedora_fpic Makefile works with other OS as well. We usually use it for the coupling on ubuntu, the name is more or less historically fedora.
Is the any specific reason (other than the name) to use the openmpi Makefile?
Cheers
Josef