ARCHER logo ARCHER banner

The ARCHER Service is now closed and has been superseded by ARCHER2.

  • ARCHER homepage
  • About ARCHER
    • About ARCHER
    • News & Events
    • Calendar
    • Blog Articles
    • Hardware
    • Software
    • Service Policies
    • Service Reports
    • Partners
    • People
    • Media Gallery
  • Get Access
    • Getting Access
    • TA Form and Notes
    • kAU Calculator
    • Cost of Access
  • User Support
    • User Support
    • Helpdesk
    • Frequently Asked Questions
    • ARCHER App
  • Documentation
    • User Guides & Documentation
    • Essential Skills
    • Quick Start Guide
    • ARCHER User Guide
    • ARCHER Best Practice Guide
    • Scientific Software Packages
    • UK Research Data Facility Guide
    • Knights Landing Guide
    • Data Management Guide
    • SAFE User Guide
    • ARCHER Troubleshooting Guide
    • ARCHER White Papers
    • Screencast Videos
  • Service Status
    • Detailed Service Status
    • Maintenance
  • Training
    • Upcoming Courses
    • Online Training
    • Driving Test
    • Course Registration
    • Course Descriptions
    • Virtual Tutorials and Webinars
    • Locations
    • Training personnel
    • Past Course Materials Repository
    • Feedback
  • Community
    • ARCHER Community
    • ARCHER Benchmarks
    • ARCHER KNL Performance Reports
    • Cray CoE for ARCHER
    • Embedded CSE
    • ARCHER Champions
    • ARCHER Scientific Consortia
    • HPC Scientific Advisory Committee
    • ARCHER for Early Career Researchers
  • Industry
    • Information for Industry
  • Outreach
    • Outreach (on EPCC Website)

You are here:

  • ARCHER
  • User Guides & Documentation
  • Essential Skills
  • Quick Start Guide
  • ARCHER User Guide
  • ARCHER Best Practice Guide
  • Scientific Software Packages
  • UK Research Data Facility Guide
  • Knights Landing Guide
  • Data Management Guide
  • SAFE User Guide
  • ARCHER Troubleshooting Guide
  • ARCHER White Papers
  • Screencast Videos

Contact Us

support@archer.ac.uk

Twitter Feed

Tweets by @ARCHER_HPC

ISO 9001 Certified

ISO 27001 Certified

Compiling OpenFOAM 3.0.1 on ARCHER

This page outlines the procedure we used for building OpenFOAM 3.0.1 on ARCHER. We downloaded the OpenFOAM-3.0.1 and ThirdParty-3.0.1 sources from the website and unpacked them on the /work filesystem on ARCHER.

Modifications

To build OpenFOAM we needed to make some small modifications to the configuration files. Firstly, we change the following lines in etc/bashrc:

Set this to the location of your OpenFOAM directory
foamInstall= 
....
Set the WM_MPLIB to CRAY_MPICH
export WM_MPLIB=CRAY_MPICH

Secondly, etc/config/settings.sh was updated as follows:

    x86_64)
        case "$WM_ARCH_OPTION" in
        32)
            export WM_COMPILER_ARCH=64
            export WM_CC='cc'
            export WM_CXX='CC'
            export WM_CFLAGS='-m32 -fPIC'
            export WM_CXXFLAGS='-m32 -fPIC'
            export WM_LDFLAGS='-m32'
            ;;
        64)
            WM_ARCH=linux64
            export WM_COMPILER_LIB_ARCH=64
            export WM_CC='cc'
            export WM_CXX='CC'
            export WM_CFLAGS='-m64 -fPIC'
            export WM_CXXFLAGS='-m64 -fPIC'
            export WM_LDFLAGS='-m64'
            ;;

.....

and add a new MPI library configuration before MPICH) as follows:

CRAY_MPICH)
    export WM_MPLIB=CRAY_MPICH
    export FOAM_MPI=cray_mpich
    export MPI_ARCH_PATH=$MPICH_DIR
    export LD_LIBRARY_PATH=$MPI_ARCH_PATH/lib:$LD_LIBRARY_PATH
    export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
    ;;

We also needed to change this line in etc/config/scotch.sh:

export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION

Next we changed the c and c++ files in wmake/rules/linuxGcc replacing gcc with cc and g++ with CC. We also added two files, called mplibCRAY_MPICH and mplibCRAY_MPICH2 in the same directory with this content:

PFLAGS     = -DMPICH_SKIP_MPICXX
PINC       = -I$(MPI_ARCH_PATH)/include
PLIBS      = -L$(MPI_ARCH_PATH)/lib -lmpich

The same changes were made in the wmake/rules/linux64Gcc directory.

Some changes were also necessary in ThirdParty-3.0.1 directory. We updated ThirdParty-3.0.1/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32 replacing gcc with cc and g++ with CC.

Build OpenFOAM

We used the following modules and environment variables when building:

module load PrgEnv-gnu
module load zlib
module load boost
module load cmake
export CRAYPE_LINK_TYPE=dynamic

To build OpenFOAM you then need to source to etc/bashrc in the OpenFOAM directory:

source etc/bashrc

And then run Allwmake from the OpenFOAM directory:

./Allwmake

Copyright © Design and Content 2013-2019 EPCC. All rights reserved.

EPSRC NERC EPCC