instructions for compiling OpenFOAM 2.0.x, LIGGGHTS and CFDEM on OpenSUSE 11.3

Submitted by akimbrell on Thu, 07/28/2011 - 16:14

I have updated Chris's instructions for the CFDEM build process to correspond to the newest OpenFOAM version. Also I installed it on OpenSUSE 11.3 which I haven't seen detailed to date on the forums, so hopefully it will be of interest.

The instructions are tailored to a $HOME installation, however I did actually install it on an NFS-mounted drive for our computational cluster. If anyone is trying to do this and runs into problems I would be happy to provide some pointers based on my installation experience.

Please see attached for the instructions. Also I have included my Makefile for LIGGGHTS as this is always hard to get set up - note that I am not sure if it actually needs all of the CCFLAGS included, I just copied what OpenFOAM(R) uses during the compilation to make sure the compiler settings were the same.

Good luck and I hope it helps!

ckloss's picture

ckloss | Fri, 07/29/2011 - 16:52

thanks a lot!

cheers,
christoph

VAJIHEH | Fri, 10/14/2011 - 19:17

Hi - following the opensuse instructions, i get the following error after i issue the following:

Vajiheh@linux:~/LIGGGHTS/liggghts_GIT/src> make -j $WM_NCOMPPROCS opensuse-mpi
make: *** [opensuse-mpi] Error 1

please help,

Thanks,
Vajiheh

VAJIHEH | Wed, 10/19/2011 - 00:23

following the directions for install, the $WM_ variable are not defined. Any idea where this is supposed to happen?

Poormanphysics | Sat, 06/22/2013 - 13:25

I replicated the same effect following the procedures above. I wondered what is resolution of this issue?
An update on this issue will be highly appreciated.

USC Phil-LiDAR Research Center
University of San Carlos

Poormanphysics | Mon, 06/24/2013 - 19:02

Not sure if this works now tried several times already specially on the LIGGGHTS installation part? Makefile may need updating? Keep getting make: *** [opensuse-mpi] Error 2. May I ask some help I'm trying to run LIGGGHTS 2.3.5 on OpenSuse 12.3 and cant reach a compiler success.

USC Phil-LiDAR Research Center
University of San Carlos

Poormanphysics | Sun, 07/21/2013 - 12:30

Figured out that Makefile.opensuse-mpi is the problem and had my FFTW3 not invoked inside there I revised the Makefile.opensuse-mpi so that:

# Makefile for OpenSUSE 12.3, OpenMPI-1.6(mpic++), FFTW3

SHELL = /bin/sh

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = mpic++
CCFLAGS = -m64 -Dlinux64 -DWM_DP -Wall -O3 -DNoRepository -ftemplate-depth-100 -fPIC -funroll-loops -fstrict-aliasing -Wno-uninitialized
DEPFLAGS = -MM
LINK = mpic++
LINKFLAGS = -O3 -fPIC
LIB = -lstdc++
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

# ---------------------------------------------------------------------
# LAMMPS-specific settings
# specify settings for LAMMPS features you will use

# LAMMPS ifdef options, see doc/Section_start.html

LMP_INC = -DLAMMPS_GZIP

# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC =
MPI_PATH =
MPI_LIB =

# FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package
# INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
# modified 21-July-2013 Berns B. to use latest FFTW implementation

FFT_INC = -DFFT_FFTW
FFT_PATH =
FFT_LIB = -lfftw3

# additional system libraries needed by LAMMPS package libraries
# these settings are IGNORED if the corresponding LAMMPS package
# (e.g. gpu, meam) is NOT included in the LAMMPS build
# SYSLIB = names of libraries
# SYSPATH = paths of libraries

gpu_SYSLIB = -lcudart
meam_SYSLIB = -lifcore -lsvml -lompstub -limf
reax_SYSLIB = -lifcore -lsvml -lompstub -limf
user-atc_SYSLIB = -lblas -llapack

gpu_SYSPATH = -L/usr/local/cuda/lib64
meam_SYSPATH = #L/usr/bin
reax_SYSPATH = #L/usr/bin
user-atc_SYSPATH =

# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section

include Makefile.package

EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(PKG_SYSLIB)

# Link target

$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
$(SIZE) $(EXE)

# Library target

lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

# Compilation rules

%.o:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<

%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@

# Individual dependencies

DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)

USC Phil-LiDAR Research Center
University of San Carlos

thwagner | Mon, 08/01/2011 - 16:29

I followed the instructions to compile CFDEM on Debian squeeze AMD64. However I was not successful. For the Liggghts part of the instructions I tried several Makefiles: Makefile.openmpi, Makefile.fedora, Makefile.fedora_fpic and the Makefile.opensuse-mpi without success.

This is the error message I get with Makefile.opensuse-mpi:

SOURCE=subModels/liggghtsCommandModel/readLiggghtsData/readLiggghtsData.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I ./cfdemParticle -I/opt/openfoam200/src/finiteVolume/lnInclude -I/opt/openfoam200/src/transportModels -I/opt/openfoam200/src/turbulenceModels/RAS/incompressible/RASModel -I/opt/openfoam200/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam200/src/meshTools/lnInclude -I/opt/openfoam200/src/lagrangian/basic/lnInclude -I/usr/lib/openmpi/include/ -I/home/twagner/Software/Liggghts/liggghtsdev/src -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/readLiggghtsData.o
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(ctype.o): relocation R_X86_64_32S against `vtable for std::ctype' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

ckloss's picture

ckloss | Mon, 08/01/2011 - 16:40

Hi Thomas,

you should take the Makefile.fedora_fpic or add the -fpic option to the makefile of your choice.
And change the CFDEM_LIGGGHTS_LIB_NAME in etc/bashrc in the cfdem particle direectory

Cheers,
Christoph

Alexandre Costa | Thu, 08/04/2011 - 15:27

Hi all,
Any clue is very welcome.
I just followed Austin instructions.
However when compiling the cfdem solver I get the following :
of2@amscosta-desktop:~/OpenFOAM/of2-2.0.x/applications/solvers/cfdemSolverPiso_shared$ wmake
Making dependency list for source file cfdemSolverPiso.C
could not open file RASModel.H for source file cfdemSolverPiso.C
SOURCE=cfdemSolverPiso.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/turbulenceModels/incompressible/turbulenceModel -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/transportModels -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/transportModels/incompressible/singlePhaseTransportModel -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude -I/home/of2/OpenFOAM/of2-2.0.x/src/lagrangian/cfdemParticle/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/dynamicFvMesh/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/dynamicMesh/lnInclude -I/home/of2/OpenFOAM/ThirdParty-2.0.x/platforms/linuxGcc/openmpi-1.5.3/include -I/home/of2/LIGGGHTS/liggghts_GIT/src -IlnInclude -I. -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/cfdemSolverPiso.o
/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nOuterCorr’
/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude/readPISOControls.H:15: warning: unused variable ‘transonic’
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/turbulenceModels/incompressible/turbulenceModel -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/transportModels -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/transportModels/incompressible/singlePhaseTransportModel -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude -I/home/of2/OpenFOAM/of2-2.0.x/src/lagrangian/cfdemParticle/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/dynamicFvMesh/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/dynamicMesh/lnInclude -I/home/of2/OpenFOAM/ThirdParty-2.0.x/platforms/linuxGcc/openmpi-1.5.3/include -I/home/of2/LIGGGHTS/liggghts_GIT/src -IlnInclude -I. -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/home/of2/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linuxGccDPOpt/cfdemSolverPiso.o -L/home/of2/OpenFOAM/OpenFOAM-2.0.x/platforms/linuxGccDPOpt/lib \
-lincompressibleRASModels -lincompressibleLESModels -lincompressibleTransportModels -lfiniteVolume -ldynamicFvMesh -ldynamicMesh -L/home/of2/OpenFOAM/ThirdParty-2.0.x/platforms/linuxGcc/openmpi-1.5.3/lib -lmpi_cxx -llagrangianCFDEM_shared -lOpenFOAM -ldl -lm -o /home/of2/OpenFOAM/of2-2.0.x/platforms/linuxGccDPOpt/bin/cfdemSolverPiso_shared
/usr/bin/ld: cannot find -llagrangianCFDEM_shared
collect2: ld returned 1 exit status
make: *** [/home/of2/OpenFOAM/of2-2.0.x/platforms/linuxGccDPOpt/bin/cfdemSolverPiso_shared] Error 1
of2@amscosta-desktop:~/OpenFOAM/of2-2.0.x/applications/solvers/cfdemSolverPiso_shared$

cgoniva's picture

cgoniva | Mon, 08/08/2011 - 09:11

Hi!

"cannot find -llagrangianCFDEM_shared"

did you make sure that the cfdem src is compiled as a library named "lagrangianCFDEM_shared" ?

(in the solvers Make/options the same library name must be used as in the src's Make/files - I'll automate that in the next release.)

Cheers,
Chris

rahulsoni | Fri, 12/06/2013 - 10:49

I am struggling with compilation of LIGGGHTS in OpenSUSE. Again and again getting similar problems. Can any one please send me the working makefile for opensuse.

One more query, is it really important to first install OpenFOAM and then LIGGGHTS, Is it a prerequisite?

Thanks in advance.

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

richti83's picture

richti83 | Fri, 12/06/2013 - 18:52

Hi

One more query, is it really important to first install OpenFOAM and then LIGGGHTS, Is it a prerequisite?

depends on your intend, for pure DEM Simulations you don't need OpenFOAM and CFDEM.
For coupled DEM and Fluid Dynamics Simulation (CFD) you will need the tools and solvers from OpenFOAM as a prerequirement.
If you realy want to do CFDEM:
I know the most struggling part is to compile the CFDEM solver bc. it is not compatible to the git version of OpenFOAM, I want to point you to this comment which is my best-practice "tutorial" for building from scratch (I tested it only on ubuntu and Red Hat but as it doesnt need any package from distro it should be portable to any linux out there):
http://cfdem.dcs-computing.com/?q=comment/4615#comment-4615

(read the link to OpenFOAM Source Pack Installation and install the suggested packages if you didn't earlier, but do NOT download the 2.2.2 tar.gz archives linked there !)

After OpenFoam compiled fine start with:
http://cfdem.dcs-computing.com/?q=system/files/githubAccess_public_0.pdf

Let me know where you run in trouble,
best, Christian.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact