diff --git a/lib/toolchain.py b/lib/toolchain.py index ec118c8..ae0015b 100644 --- a/lib/toolchain.py +++ b/lib/toolchain.py @@ -1,4 +1,5 @@ import os +import sys from lib.shell import get_from_command @@ -42,6 +43,13 @@ def set_toolchain(compiler, mpi): cc = "mpicc" cxx = "mpicxx" fc = "mpif90" + elif mpi == "necmpi": + cc = "mpicc -vh" + cxx = "mpic++ -vh" + fc = "mpinfort -vh" + os.environ["NMPI_CC_H"] = "gcc" + os.environ["NMPI_CXX_H"] = "g++" + os.environ["NMPI_FC_H"] = "gfortran" elif compiler == "aocc": if mpi == "hpcx" or mpi == "openmpi": cc = "mpicc" @@ -56,6 +64,13 @@ def set_toolchain(compiler, mpi): cc = "\"mpicc -cc=clang\"" cxx = "\"mpicxx -cxx=clang++\"" fc = "\"mpif90 -fc=flang\"" + elif mpi == "necmpi": + cc = "mpicc -vh" + cxx = "mpic++ -vh" + fc = "mpinfort -vh" + os.environ["NMPI_CC_H"] = "clang" + os.environ["NMPI_CXX_H"] = "clang++" + os.environ["NMPI_FC_H"] = "flang" elif compiler == "intel": if mpi == "hpcx" or mpi == "openmpi": cc = "mpicc" @@ -70,7 +85,19 @@ def set_toolchain(compiler, mpi): cc = "mpiicc" cxx = "mpiicpc" fc = "mpiifort" - + elif mpi == "necmpi": + cc = "mpicc -vh" + cxx = "mpic++ -vh" + fc = "mpinfort -vh" + os.environ["NMPI_CC_H"] = "icc" + os.environ["NMPI_CXX_H"] = "icpc" + os.environ["NMPI_FC_H"] = "ifort" + elif compiler == "nec": + # only NEC MPI + cc = "mpincc" + cxx = "mpinc++" + fc = "mpinfort" + # set environment variables os.environ["CC"] = cc os.environ["CXX"] = cxx