I am trying to install OpenFoam-19.06 in a CentOS 6.6
I have a MPI version in /global/mpi/mympich
.
In the file etc/bashrc
I’ve created the variable:
export WM_MPLIB=MYMPICH
>
and in the file etc/config.sh/mpi
I’ve created a new case:
MYMPICH)
export FOAM_MPI=mympich
export MPI_ARCH_PATH=/global/mpi/mympich
export MPICH_PATH=$MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib
;;
Then I set the environment variables with:
source etc/bashrc
and compile the third party software with (in the appropriate directory):
./makeCGAL
Finally, I compile OpenFoam with (in the appropriate directory):
./Allwmake
It seems to start well:
========================================
2019-11-15 13:24:03 +0100
Starting compile OpenFOAM-v1906 Allwmake
Gcc system compiler
linux64GccDPInt32Opt, with MYMPICH mympich
========================================
built wmake-bin (linux64Gcc)
========================================
Start ThirdParty Allwmake
========================================
using: gcc -m64 -DOPENFOAM=1906 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -O3 -fPIC
using: g++ -std=c++11 -m64 -DOPENFOAM=1906 -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 -fPIC
========================================
Build MPI libraries if required
/global/mpi/mympich
But it ends With the following result:
module.h:236:37: warning: ‘foldval’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define SCOTCH_NAME_PREFIX_INTERN _SCOTCH
^
vdgraph_separate_ml.c:90:23: note: ‘foldval’ was declared here
int foldval;
^
cp: cannot stat `../bin/[agm]*': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../bin/d[agm]*': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../include/*esmumps*.h': No such file or directory
make: [install] Error 1 (ignored)
cp: cannot stat `../lib/*esmumps*.so': No such file or directory
make: [install] Error 1 (ignored)
ln: OpenFOAM/lnInclude
ln: OSspecific/POSIX/lnInclude
ln: ./lnInclude
In file included from PstreamGlobals.C:28:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [/home/OpenFOAM-v1906/build/linux64GccDPInt32OptMYMPICH/src/Pstream/mpi/PstreamGlobals.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from UPstream.C:32:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [/home/OpenFOAM-v1906/build/linux64GccDPInt32OptMYMPICH/src/Pstream/mpi/UPstream.o] Error 1
In file included from UOPwrite.C:34:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
In file included from UIPread.C:34:0:
PstreamGlobals.H:42:17: fatal error: mpi.h: No such file or directory
compilation terminated.
So far, I haven’t found a good guide to do what I’m targeting.
2
Answers
In OpenFOAM-1712 and later, there is provision for just what you want. It’s called
USERMPI
. If you specify this, it will look for a corresponding mplib rule, which you also are in charge of creating.Probably best to raise as a documentation issue/query on their gitlab tracker.
If you want to see a really detailed example, take a look at the spack openfoam/package.py – there it is populated by values from spack
no, I think you have installed mpich? or something else. We don’t have a mpi named "mympi".