CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.com] Compiling v1806 from source (https://www.cfd-online.com/Forums/openfoam-installation/204726-compiling-v1806-source.html)

Sgs July 30, 2018 16:32

Compiling v1806 from source
 
I'm having an issue installing OpenFOAM from source on a remote cluster according to the instructions here
https://www.openfoam.com/download/install-source.php

I followed all the instructions up to

Code:

./Allwmake
After which I get the following errors

Code:


...
wmake solvers
wmake basic
make[1]: Entering directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic'
wmake laplacianFoam
make[2]: Entering directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic/laplacianFoam'
wmake overLaplacianDyMFoam
make[3]: Entering directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam'
g++ -std=c++11 -m64 -DOPENFOAM=1806 -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 -Wno-attributes -Wno-unknown-pragmas -O3  -DNoRepository -ftemplate-depth-100 -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/finiteVolume/lnInclude -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/dynamicFvMesh/lnInclude -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/overset/lnInclude -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/meshTools/lnInclude -IlnInclude -I. -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/OpenFOAM/lnInclude -I/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed /home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/build/linux64GccDPInt32Opt/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/overLaplacianDyMFoam.o -L/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib \
    -loverset -lOpenFOAM -ldl  \
    -lm -o /home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin/overLaplacianDyMFoam
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_rank'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Abort'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Alltoallv'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Scatterv'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_group'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Allreduce'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Bsend'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_detach'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Recv'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Wait'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Test'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Alltoall'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_size'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Waitall'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Get_count'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_create'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Group_incl'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Initialized'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Probe'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Finalized'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Send'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Irecv'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_free'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Gatherv'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Init_thread'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Isend'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Finalize'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_attach'
/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Group_free'
collect2: error: ld returned 1 exit status
make[3]: *** [/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin/overLaplacianDyMFoam] Error 1
make[3]: Leaving directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam'
make[2]: *** [overLaplacianDyMFoam] Error 2
make[2]: Leaving directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic/laplacianFoam'
make[1]: *** [laplacianFoam] Error 2
make[1]: Leaving directory `/home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/applications/solvers/basic'
make: *** [basic] Error 2


And the output of foamInstallationTest is

Code:


Executing /home/sgs/pkg/OpenFOAM/OpenFOAM-v1806/bin/foamInstallationTest:


Basic setup :
-------------------------------------------------------------------------------
OpenFOAM:            OpenFOAM-v1806
ThirdParty:          ThirdParty-v1806
Shell:              bash
Host:                fe.cm.cluster
OS:                  Linux version 3.10.0-229.el7.x86_64
-------------------------------------------------------------------------------


Main OpenFOAM env variables :
-------------------------------------------------------------------------------
EnvironmentVariable  FileOrDirectory                          Valid      Crit
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR  /home/sgs/pkg/OpenFOAM                yes      yes
$WM_PROJECT_USER_DIR  /home/sgs/OpenFOAM/sgs-v1806        no        no
$WM_THIRD_PARTY_DIR  .../sgs/pkg/OpenFOAM/ThirdParty-v1806  yes      yes
-------------------------------------------------------------------------------


OpenFOAM env variables in PATH :
-------------------------------------------------------------------------------
EnvironmentVariable  FileOrDirectory                          Valid Path Crit
-------------------------------------------------------------------------------
$WM_PROJECT_DIR      /home/sgs/pkg/OpenFOAM/OpenFOAM-v1806  yes  yes  yes

$FOAM_APPBIN          ...06/platforms/linux64GccDPInt32Opt/bin  yes  yes  yes
$FOAM_SITE_APPBIN    ...06/platforms/linux64GccDPInt32Opt/bin  no        no
$FOAM_USER_APPBIN    ...06/platforms/linux64GccDPInt32Opt/bin  no        no
$WM_DIR              ...oka/pkg/OpenFOAM/OpenFOAM-v1806/wmake  yes  yes  yes
-------------------------------------------------------------------------------


OpenFOAM env variables in LD_LIBRARY_PATH :
-------------------------------------------------------------------------------
EnvironmentVariable  FileOrDirectory                          Valid Path Crit
-------------------------------------------------------------------------------
$FOAM_LIBBIN          ...06/platforms/linux64GccDPInt32Opt/lib  yes  yes  yes
$FOAM_SITE_LIBBIN    ...06/platforms/linux64GccDPInt32Opt/lib  no        no
$FOAM_USER_LIBBIN    ...06/platforms/linux64GccDPInt32Opt/lib  no        no
$MPI_ARCH_PATH        /cm/shared/myCluster/openmpi/2.0.3        yes  yes  yes
-------------------------------------------------------------------------------


Third-party software
-------------------------------------------------------------------------------
Software  Version    Location 
-------------------------------------------------------------------------------
flex      2.5.37    /bin/flex                                               
gcc      4.8.4      /cm/shared/apps/gcc/4.8.4/bin/gcc                       
g++      4.8.4      /cm/shared/apps/gcc/4.8.4/bin/g++                       
gzip      1.5        /bin/gzip                                               
tar      1.26      /bin/tar                                                 
icoFoam  *** not installed ***
          CRITICAL ERROR

-------------------------------------------------------------------------------


Summary
-------------------------------------------------------------------------------
Base configuration ok.
The foam installation contains 1 critical error(s).

Review the output for warning messages and consult
the installation guide for troubleshooting.

Done

Any advice about what might be going wrong would be much appreciated.

quarkz July 31, 2018 01:21

Hi,

I've got the same problem too. Have you resolved yours?

Sgs August 7, 2018 09:13

successful compile
 
TL;DR
I used the Third Party MPI library rather than my system MPI library - I'm not sure why my system MPI didn't work.

Slightly longer version

I created a prefs.sh file by copying the example one (etc/config.sh/example) into etc, although the only re-definition I have in it is

Code:

export WM_MPLIB=OPENMPI
I then re-started my compile-process entirely and began again starting with
Code:

source OpenFOAM-v1806/etc/bashrc
cgal_version=CGAL-4.9.1
boost_version=boost_1_64_0
cd OpenFOAM-v1806
./Allwmake

hope this helps.

quarkz August 15, 2018 22:59

Hmm, tried it but got the error:
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking whether UID '20822' is supported by ustar format... yes
checking whether GID '1002' is supported by ustar format... yes
checking how to create a ustar tar archive...
ATTENTION! pax archive volume change required.
Ready for archive volume: 1
Input archive name or "." to quit pax.
Archive name >

wyldckat August 17, 2018 13:58

Quick question @quarkz: Which installation instructions are you following and which Linux Distribution are you using?

quarkz August 20, 2018 01:19

Hi wyldckat,

I using instructions from:

https://www.openfoam.com/code/build-guide.php

My linux version is:

Linux version 2.6.32-696.30.1.el6.x86_64 (mockbuild@x86-033.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Fri May 18 11:50:44 EDT 2018

Thanks.

wyldckat August 20, 2018 14:25

Quick answer: gcc version 4.4.7 is not supported for building the recent OpenFOAM versions, from both the OpenFOAM Foundation and ESI-OpenCFD.

It seems you are using RHEL 6.x, by looking at the kernel and GCC versions. There should be a way to have GCC 6 or GCC 7 available for your system.

If you are using a machine that is managed by an administrator, I strongly advise you to talk to said admin, in order to know which MPI toolbox(es) to use and how to use a more modern GCC.

If you installed this machine yourself, then you will have to either build from source code (see for example https://openfoamwiki.net/index.php/I...HEL#CentOS_6.9 for ideas) - or see https://openfoamwiki.net/index.php/I...6.10_.28SCL.29 for ideas on how to build by using the Software Collections Library that provides GCC 7.




edit: I forgot to mention that the error message that you've gotten is likely from trying to build Open-MPI, which sometimes gives that error message and I don't know yet why that happens...

quarkz August 24, 2018 03:14

Hi wyldckat,

Thanks for the help. Actually the sys comes with gcc 4.4.7 but thru module loading, I use 4.9.3. Currently, that's the version with MPI. I'm not sure if the admin will agree to install gcc 6 or 7. However, I managed to install OpenFOAM 6 on the cluster. So I'm not sure if it is due to gcc version.

wyldckat August 24, 2018 14:00

Quick answers:

Quote:

Originally Posted by quarkz (Post 703760)
Actually the sys comes with gcc 4.4.7 but thru module loading, I use 4.9.3. Currently, that's the version with MPI.

GCC 4.9.3 should work without problems.

As for MPI, then you don't need to use:
Code:

export WM_MPLIB=OPENMPI
you should instead configure it to use the MPI version that is loaded with that GCC module...
What I mean is that the error message that you had gotten usually occurs when trying to build Open-MPI.



Quote:

Originally Posted by quarkz (Post 703760)
However, I managed to install OpenFOAM 6 on the cluster. So I'm not sure if it is due to gcc version.

Then... wait, how did you configure the MPI to work with OpenFOAM 6? Because it should work the same way with v1806...

quarkz August 28, 2018 01:35

Hi wyldckat,

I just followed the standard instruction to install OpenFOAM 6. Ya, I think the problem lies with OpenMPI. I will see what can be done. Thanks!

quarkz January 20, 2019 20:46

Hi,

I realise that I had the same problem with v1706. Recently, I tried to recompile but using:

export WM_COMPILER=Gcc49

since my cluster is using only gcc 4.9.3.

I managed to successfully compile now. I also tried v1812 and it works.


All times are GMT -4. The time now is 23:49.