CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] Compiling v1806 from source

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By quarkz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 30, 2018, 17:32
Default Compiling v1806 from source
  #1
Sgs
New Member
 
S
Join Date: Jun 2016
Posts: 15
Rep Power: 10
Sgs is on a distinguished road
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.

Last edited by Sgs; August 5, 2018 at 19:44.
Sgs is offline   Reply With Quote

Old   July 31, 2018, 02:21
Default
  #2
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
Hi,

I've got the same problem too. Have you resolved yours?
quarkz is offline   Reply With Quote

Old   August 7, 2018, 10:13
Default successful compile
  #3
Sgs
New Member
 
S
Join Date: Jun 2016
Posts: 15
Rep Power: 10
Sgs is on a distinguished road
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.
Sgs is offline   Reply With Quote

Old   August 15, 2018, 23:59
Default
  #4
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
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 >
quarkz is offline   Reply With Quote

Old   August 17, 2018, 14:58
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick question @quarkz: Which installation instructions are you following and which Linux Distribution are you using?
__________________
wyldckat is offline   Reply With Quote

Old   August 20, 2018, 02:19
Default
  #6
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
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.
quarkz is offline   Reply With Quote

Old   August 20, 2018, 15:25
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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...

Last edited by wyldckat; August 20, 2018 at 15:26. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   August 24, 2018, 04:14
Default
  #8
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
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.
quarkz is offline   Reply With Quote

Old   August 24, 2018, 15:00
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:

Quote:
Originally Posted by quarkz View Post
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 View Post
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...
wyldckat is offline   Reply With Quote

Old   August 28, 2018, 02:35
Default
  #10
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
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 is offline   Reply With Quote

Old   January 20, 2019, 21:46
Default
  #11
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
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.
wyldckat likes this.

Last edited by quarkz; January 22, 2019 at 01:41.
quarkz is offline   Reply With Quote

Reply

Tags
compile error, mpi, openfoam 1806, undefined reference


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 12:32
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18


All times are GMT -4. The time now is 07:18.