diff --git a/lib/toolchain.py b/lib/toolchain.py index 8b60625..701ace1 100644 --- a/lib/toolchain.py +++ b/lib/toolchain.py @@ -6,11 +6,17 @@ from lib.shell import get_from_command def get_compiler_version(compiler): if compiler == "gnu": cc = "gcc" + compstr = get_from_command([cc, "-dumpversion"]).strip() elif compiler == "intel": cc = "icc" + compstr = get_from_command([cc, "-dumpversion"]).strip() elif compiler == "aocc": cc = "clang" - compstr = get_from_command([cc, "-dumpversion"]).strip() + compstr = get_from_command([cc, "-dumpversion"]).strip() + elif compiler == "nec": + cc = "ncc" + rawstr = get_from_command([cc, "--version"]) + compstr = rawstr.split()[2] return compstr @@ -30,6 +36,9 @@ def get_mpi_version(mpi): elif mpi == "mpich": rawstr = get_from_command(["mpirun", "--version"]) mpistr = rawstr.split()[4] + elif mpi == "necmpi": + rawstr = get_from_command(["mpirun", "--version"]) + mpistr = rawstr.split()[4] return mpistr @@ -97,7 +106,7 @@ def set_toolchain(compiler, mpi): cc = "mpincc" cxx = "mpinc++" fc = "mpinfort" - + # set environment variables os.environ["CC"] = cc os.environ["CXX"] = cxx