|
[Sponsors] |
[OpenFOAM.org] OpenFOAM with MPICH fatal error: mpi.h: No such file or directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2020, 08:23 |
OpenFOAM with MPICH fatal error: mpi.h: No such file or directory
|
#1 |
New Member
Ariful Islam Pranto
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
I am trying to build OpenFOAM from source with MPICH-3.3.2 but got
Code:
g++ -std=c++11 -m64 -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 -O3 -DNoRepository -ftemplate-depth-100 -I -IlnInclude -I. -I/home/pranto/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/pranto/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -c PstreamGlobals.C -o /home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/PstreamGlobals.o UPstream.C:30:17: fatal error: mpi.h: No such file or directory compilation terminated. /home/pranto/OpenFOAM-dev/wmake/rules/General/transform:25: recipe for target '/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o' failed make[4]: *** [/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o] Error 1 make[4]: *** Waiting for unfinished jobs.... In file included from PstreamGlobals.C:26:0: PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory compilation terminated. In file included from UIPread.C:30:0: PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory compilation terminated. Code:
export WM_MPLIB=SYSTEMMPI What are the additional settings I have to consider to build OpenFOAM with MPICH-3.3.2? |
|
October 11, 2020, 08:00 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Your compilation indicates "SYSTEMMPI" but you claim to have mpich-3.3.2 installed. Where is it located?
|
|
October 11, 2020, 08:49 |
|
#3 |
New Member
Ariful Islam Pranto
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
Basically, I want to compile OpenFOAM using my system installed MPI library which is in my case MPICH 3.3.2.
How am I supposed to tell OpenFOAM to use my system MPI library during compile? etc/bashrc Code:
#- MPI implementation: # WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI # | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI if [[ -z "${WM_MPLIB}" ]] then export WM_MPLIB=SYSTEMOPENMPIfi export MPI_ARCH_PATH=$MPI_ROOT Code:
export WM_MPLIB=MPICH Btw, I installed MPICH using the following command. sudo apt install mpich libmpich-dev |
|
October 12, 2020, 08:48 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Configuring for different MPI versions and types is indeed quite a pain. We have some overrides for commonly used setups, but not for mpich. The file you want to examine and modify (yes, very ugly) is the etc/config.sh/mpi. If you look for the various cases, you will see that MPI corresponds to the system mpi, stored under /opt and MPICH is a version of that is assumed to have been bundled into OpenFOAM's own ThirdParty directory. You have something different and will need to adjust accordingly. If you devise a better of defining all of these different configs, I would be happy to adjust them. |
||
October 12, 2020, 09:14 |
|
#5 |
New Member
Ariful Islam Pranto
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
How am I supposed to adjust all these configs? Can you kindly help me?
|
|
October 12, 2020, 12:40 |
|
#6 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
||
April 13, 2021, 15:50 |
|
#7 | |
New Member
Ariful Islam Pranto
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
Quote:
Sorry for the late reply here Now I switched back to openmpi 2.2.1. Code:
cp -r OpenFOAM-dev/etc/config.sh/example/prefs.sh OpenFOAM-dev/etc/ export WM_MPLIB=SYSTEMOPENMPI Code:
In file included from PstreamGlobals.H:41:0, from UIPread.C:30: /usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h:330:37: error: conflicting declaration ‘typedef struct ompi_communicator_t* MPI_Comm’ typedef struct ompi_communicator_t *MPI_Comm; ^~~~~~~~ Is there anything I missed here? |
||
April 20, 2021, 15:01 |
|
#8 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
With all the changes, you might have old symbols linked in. Best to wclean src/Pstream and rebuild it.
|
|
April 21, 2021, 09:01 |
|
#9 |
New Member
Ariful Islam Pranto
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
I fixed the problem by manually installing MPICH. Just one more question, when I try to compile with system install mpich with the following env variable in etc/prefs.sh
Code:
export MPI_ROOT=/usr export MPI_ARCH_LIBS="-L/usr/lib/x86_64-linux-gnu -lmpich" export WM_MPLIB=SYSTEMMPI export MPI_ARCH_FLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" export MPI_ARCH_INC="-I/usr/include -L/usr/lib/x86_64-linux-gnu" Code:
export MPI_ROOT=$HOME/MPICH export MPI_ARCH_FLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" export MPI_ARCH_LIBS="-L$HOME/MPICH/lib -lmpich" export MPI_ARCH_INC="-I$HOME/MPICH/include/ -L$HOME/MPICH/lib" export WM_MPLIB=SYSTEMMPI |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 | towanda | OpenFOAM Community Contributions | 6 | September 5, 2015 22:03 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |