Build NextFOAM-cfd on Rocky Linux 8 with Intel oneAPI

Install Intel OneAPI on Rocky Linux

Create the YUM or DNF repo file using dnf command

tee > /tmp/oneAPI.repo << EOF
[oneAPI]
name=Intel® oneAPI repository
baseurl=https://yum.repos.intel.com/oneAPI
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
EOF

Move the newly created oneAPI.repo file to the YUM/DNF configuration directory /etc/yum.repos.d:

mv /tmp/oneAPI.repo /etc/yum.repos.d

Install the BASE toolkit with the following command:

dnf install intel-basekit hpckit

Setup the Intel Compiler and IntelMPI.

To use an Intel OneAPI compiler and IntelMPI, environment variables are added in the /etc/bashrcfor all users. Append following lines at the end of /etc/bash.bashrc

source /opt/intel/oneapi/setvars.sh >& /dev/null

Build NextFOAM-cfd using Intel OneAPI

Install build environment

dnf install -y zlib-devel gmp-devel mpfr-devel

Clone NextFOAM-cfd and move sources to the top directory.

The top directory for NextFOAM-cfd installation is /opt/OpenFOAM. 2405 is the latest NextFOAM-cfd version. Modify the version number according to the distribution.

mkdir -p /opt/OpenFOAM
git clone https://github.com/nextfoam/nextfoam-cfd.git
mv nextfoam-cfd/NextFOAM-2405 /opt/OpenFOAM
mv nextfoam-cfd/ThirdParty-2405 /opt/OpenFOAM

Setup build parametersEdit /opt/OpenFOAM/NextFOAM-2405/etc/config.sh/settings for Intel OneAPI

vi /opt/OpenFOAM/NextFOAM-2405/etc/config.sh/settings

Linux)
WM_ARCH=linux

case "$(uname -m)" in
x86_64)
    if [ "$archOption" = 32 ]
    then
        export WM_ARCH_OPTION=32        # Propagate?
        export WM_COMPILER_ARCH=64      # 64-bit compiler, 32-bit target
    else
        WM_ARCH=linux64                 # 64-bit compiler/target
        export WM_COMPILER_LIB_ARCH=64  # Use lib64
        export WM_CC='icx' 
        export WM_CXX='icpx' 
        export WM_CFLAGS='-xCORE-AVX512 -O2 -m64 -fPIC'
        export WM_CXXFLAGS='-xCORE-AVX512 -O2 -m64 -fPIC'
    fi
    ;;

Edit /opt/OpenFOAM/NextFOAM-2405/etc/bashrc

vi /opt/OpenFOAM/NextFOAM-2405/etc/bashrc

export WM_PROJECT_VERSION=2405
export WM_COMPILER=Icx
export WM_MPLIB=INTELMPI
export WM_LABEL_SIZE=32
proectDIR="/opt/OpenFOAM/NextFOAM-$WM_PROJECT_VERSION"

Edit scotch compile parameters in the /opt/OpenFOAM/ThirdParty-2405/etc/makeFiles/scotch/Makefile.inc.Linux.shlib

vi /opt/OpenFOAM/ThirdParty-2405/etc/makeFiles/scotch/Makefile.inc.Linux.shlib

AR          = icx
ARFLAGS     = $(WM_CFLAGS) -shared -o
CCS         = icx
CCP         = mpicc
CCD         = $(CCP)
CFLAGS      = $(WM_CFLAGS) -fPIC -O3 \
    -UCOMMON_FILE_COMPRESS \
    -DCOMMON_RANDOM_FIXED_SEED \
    -DSCOTCH_DETERMINISTIC \
    -DSCOTCH_RENAME \
    -DIDXSIZE64 \
    -Drestrict=__restrict \
    -I$(MPI_ROOT)/include -L$(MPI_ROOT)/lib

Enable environment variables and dd fftw library path and compile

source /opt/OpenFOAM/NextFOAM-2405/etc/bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WM_THIRD_PARTY_DIR/platforms/linux64Icx/fftw-3.3.10/lib
cd /opt/OpenFOAM/NextFOAM-2405/
./Allwmake -j 

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다