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

[OpenFOAM.com] Installing OpenFOAM with MPICH

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2019, 05:56
Default Installing OpenFOAM with MPICH
  #1
New Member
 
Join Date: Feb 2016
Posts: 10
Rep Power: 10
venkcy is on a distinguished road
Hello!


I am trying to install with mpich3.2 in CentOS7. I made couple of changes in the root folder.




In etc/bashrc, I have changed the following
Code:
export WM_MPLIB=MPICH
In etc/config.sh/mpi, I have changed the following
Code:
MPICH)
    export FOAM_MPI=mpich-3.2
    export MPI_ARCH_PATH=/home/D/mpich-3.2/install
    export MPI_HOME=$MPI_ARCH_PATH
    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-3.2

    # Could be sourced from ThirdParty with incomplete environment
    if command -v _foamAddLibAuto > /dev/null 2>&1  # Normal sourcing
    then
        _foamAddPath    $MPI_ARCH_PATH/bin
        _foamAddMan     $MPI_ARCH_PATH/share/man
        _foamAddLib $MPI_ARCH_PATH/lib
    fi
    ;;
But while compiling the code I get the following error in both V1812 and V1906
Code:
/home/D/foam/OpenFOAM-v1812/src/OpenFOAM/lnInclude/IOobject.H:497:14: note: because ‘Foam::IOobject’ has user-provided ‘void Foam::IOobject::operator=(const Foam::IOobject&)’
  497 |         void operator=(const IOobject& io);
      |              ^~~~~~~~
In file included from /home/D/foam/OpenFOAM-v1812/src/OpenFOAM/lnInclude/postProcess.H:131,
                 from coldEngineFoam.C:55:
../XiFoam/createFields.H: In function ‘int main(int, char**)’:
../XiFoam/createFields.H:3:9: error: ‘psiuReactionThermo’ was not declared in this scope
    3 | autoPtr<psiuReactionThermo> pThermo
      |         ^~~~~~~~~~~~~~~~~~
../XiFoam/createFields.H:3:27: error: template argument 1 is invalid
    3 | autoPtr<psiuReactionThermo> pThermo
      |                           ^
../XiFoam/createFields.H:5:5: error: ‘psiuReactionThermo’ is not a class, namespace, or enumeration
    5 |     psiuReactionThermo::New(mesh)
      |     ^~~~~~~~~~~~~~~~~~
../XiFoam/createFields.H:7:21: error: ‘thermo’ was not declared in this scope; did you mean ‘pThermo’?
    7 | psiuReactionThermo& thermo = pThermo();
      |                     ^~~~~~
      |                     pThermo
../XiFoam/createFields.H:7:38: error: ‘pThermo’ cannot be used as a function
    7 | psiuReactionThermo& thermo = pThermo();
      |                                      ^
../XiFoam/createFields.H:10:1: error: ‘basicSpecieMixture’ was not declared in this scope
   10 | basicSpecieMixture& composition = thermo.composition();
      | ^~~~~~~~~~~~~~~~~~
../XiFoam/createFields.H:10:21: error: ‘composition’ was not declared in this scope
   10 | basicSpecieMixture& composition = thermo.composition();
      |                     ^~~~~~~~~~~
In file included from /home/D/foam/OpenFOAM-v1812/src/OpenFOAM/lnInclude/postProcess.H:131,
                 from coldEngineFoam.C:55:
../XiFoam/createFields.H:78:9: error: ‘laminarFlameSpeed’ was not declared in this scope
   78 | autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
      |         ^~~~~~~~~~~~~~~~~
../XiFoam/createFields.H:78:26: error: template argument 1 is invalid
   78 | autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
      |                          ^
../XiFoam/createFields.H:80:5: error: ‘laminarFlameSpeed’ is not a class, namespace, or enumeration
   80 |     laminarFlameSpeed::New(thermo)

I would like to know if I need to change anything else apart from these values.



Thanks for your time.
venkcy is offline   Reply With Quote

Old   December 4, 2019, 18:06
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hmmm.. let's issue a ticket in the issue tracker in GitLab.

Any further information you can provide regarding your compilation?
HPE is offline   Reply With Quote

Old   December 13, 2019, 04:14
Default
  #3
New Member
 
Join Date: Feb 2016
Posts: 10
Rep Power: 10
venkcy is on a distinguished road
Thanks for the reply!


Let me know the information will be required and helpful to identify the error?



I have used GCC 9 and MPICH 3.2 for compilation.
venkcy is offline   Reply With Quote

Old   December 20, 2019, 12:56
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
I assume you've downloaded the mp* package into the ThirdParty dir?
HPE is offline   Reply With Quote

Old   December 25, 2019, 20:17
Smile One workaround
  #5
Member
 
LUQILIN
Join Date: May 2016
Location: Harbin, China
Posts: 35
Rep Power: 10
LUQILIN is on a distinguished road
I have run into the same problem but I have figured it out on Ubuntu 18.04. But I bet it will work on Centos 8 as well. Here is what I propose, you may want to install Openmpi alongside with the MPICH compiled from source. And once you got a way to switch back and forth, Problem solved! I suggest using "bash", which is a way to edit your ~/.bashrc or ~/.profile.

Add following lines to .bashrc

## switch between mpich and openmpi
use_mpi () {
shopt -s nocaematch
case "$1" in
mpich) export PATH=/home/to/your/MPICH/bin:$PATH
openmpi) export PATH=/usr/bin:$PATH ;;
*) return 1 ;;
esac
shopt -u nocasematch
}

After adding those lines, type
1. "source ~/.bashrc" to activate the commands;
2. "use_mpi mpich" will allow you to use mpich in the current terminal;
3. "use_mpi openmpi" will allow you to use openmpi.

Then you can handle different versions of MPI on your system (not limited to two, could be three, four, ..., etc) . I feel this is more elegant other than messing with OpenFoam source code before you are an advanced user.

Hope this will help you.
LUQILIN is offline   Reply With Quote

Old   January 18, 2020, 06:13
Default
  #6
New Member
 
Join Date: Feb 2016
Posts: 10
Rep Power: 10
venkcy is on a distinguished road
Quote:
Originally Posted by HPE View Post
I assume you've downloaded the mp* package into the ThirdParty dir?

No! I built the package directly as I needed the newer version.


I was able to install OpenFOAM with IntelMPI.


Thanks for your concern!
venkcy is offline   Reply With Quote

Old   January 18, 2020, 06:20
Default
  #7
New Member
 
Join Date: Feb 2016
Posts: 10
Rep Power: 10
venkcy is on a distinguished road
Quote:
Originally Posted by LUQILIN View Post
I have run into the same problem but I have figured it out on Ubuntu 18.04. But I bet it will work on Centos 8 as well. Here is what I propose, you may want to install Openmpi alongside with the MPICH compiled from source. And once you got a way to switch back and forth, Problem solved! I suggest using "bash", which is a way to edit your ~/.bashrc or ~/.profile.

Add following lines to .bashrc

## switch between mpich and openmpi
use_mpi () {
shopt -s nocaematch
case "$1" in
mpich) export PATH=/home/to/your/MPICH/bin:$PATH
openmpi) export PATH=/usr/bin:$PATH ;;
*) return 1 ;;
esac
shopt -u nocasematch
}

After adding those lines, type
1. "source ~/.bashrc" to activate the commands;
2. "use_mpi mpich" will allow you to use mpich in the current terminal;
3. "use_mpi openmpi" will allow you to use openmpi.

Then you can handle different versions of MPI on your system (not limited to two, could be three, four, ..., etc) . I feel this is more elegant other than messing with OpenFoam source code before you are an advanced user.

Hope this will help you.

I was able to install OpenFOAM with IntelMPI.


Thanks for your help! Will try and get back to you.
venkcy is offline   Reply With Quote

Reply

Tags
mpich


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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
[waves2Foam] A few notes about problems and solutions when installing with OpenFOAM v1712 oceanFoam OpenFOAM Community Contributions 0 June 22, 2018 09:52
[OpenFOAM.org] Installing OpenFoam 3.0.1 on cluster hello177 OpenFOAM Installation 1 April 24, 2016 09:35
question about installing Openfoam 1.6-ext Haotian OpenFOAM Installation 2 November 17, 2013 19:47
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25


All times are GMT -4. The time now is 20:46.