diff --git a/envs/reddwarf.yaml b/envs/reddwarf.yaml index 00a4c4e..f59a2d3 100644 --- a/envs/reddwarf.yaml +++ b/envs/reddwarf.yaml @@ -6,7 +6,7 @@ Description: Name: Reddwarf - Max Cores: 10 + Max Cores: 4 Modules: True LMOD_CMD: /usr/local/lmod/lmod/libexec/lmod HPC: False @@ -54,12 +54,36 @@ Modsets: - USE_PIO2: Name: USE_PIO2 Value: "true" - - MPAS_EXTERNAL_LIBS: - Name: MPAS_EXTERNAL_LIBS - Value: "-L${PIO}/lib -L${LIBBASE}/lib/lib -lpio -lpnetcdf -lnetcdf -lhdf5_hl -lhdf5 -ldl -lz" + - PNETCDF_INCLUDES: + Name: PNETCDF_INCLUDES + Value: "-I$PNETCDF/include" + - PNETCDF_LIBS: + Name: PNETCDF_LIBS + Value: "-L$PNETCDF/lib -lpnetcdf" + - NETCDF_INCLUDES: + Name: NETCDF_INCLUDES + Value: "-I$NETCDF/include" + - NETCDF_LIBS: + Name: NETCDF_LIBS + Value: "-L$NETCDF/lib -lnetcdf -lpnetcdf + -lhdf5_hl -lhdf5 -ldl -lz -lm" + - PIO_INCLUDES: + Name: PIO_INCLUDES + Value: "-I$PNETCDF/include -I$PIO/include" + - PIO_LIBS: + Name: PIO_LIBS + Value: "-L$NETCDF/lib + -L$PIO/lib -lpiof -lpio + -lnetcdf -lpnetcdf -lhdf5_hl -lz -lm" - MPAS_EXTERNAL_INCLUDES: Name: MPAS_EXTERNAL_INCLUDES - Value: "-I${LIBBASE}/lib/include -I${PIO}/lib/include" + Value: "-I/users/mcurry/build-gnu-9.1.0/lib/include + -I/users/mcurry/build-gnu-9.1.0/pio/2.4.3/include" + - MPAS_EXTERNAL_LIBS: + Name: MPAS_EXTERNAL_LIBS + Value: "-L/users/mcurry/build-gnu-9.1.0/lib/lib + -L/users/mcurry/build-gnu-9.1.0/pio/2.4.3/include -lpiof -lpio + -lpnetcdf -lnetcdf -lhdf5_hl -lhdf5 -ldl -lz -lm" ############ # GNU-8.3.0 diff --git a/smarts/env.py b/smarts/env.py index 5114b19..757b16b 100644 --- a/smarts/env.py +++ b/smarts/env.py @@ -398,7 +398,7 @@ def _load_library(self, library, *args, **kwargs): env_name = library['Name'] value = library['Value'] - os.environ[env_name] = value + os.environ[env_name] = os.path.expandvars(value) else: print("ERROR: For the library", library['Name'], "does not have a maching value name") return False diff --git a/tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py b/tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py index 579ae43..470f145 100644 --- a/tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py +++ b/tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py @@ -43,7 +43,7 @@ def run(self, env, result, src_dir, test_dir, hpc=None, *args, **kwargs): result.msg = "Could not clean MPAS atmosphere core" return - print("MPAS_INTEL_COMPILE: Compiling MPAS Atmosphere CORE ....") + print("MPAS_GNU_COMPILE: Compiling MPAS Atmosphere CORE ....") ierr = os.system('make -j4 gfortran CORE=atmosphere &> ../atmosphere-compile.log') if ierr != 0: result.result = "FAILED" diff --git a/tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py b/tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py index ac4120f..4b0a309 100644 --- a/tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py +++ b/tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py @@ -65,8 +65,13 @@ def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs): # PNetCDF - C and Fortran + from subprocess import Popen + ## C - if os.system('mpicc -o c_pnetcdf pnetcdf.c -I$PNETCDF/include -L$PNETCDF/lib -lpnetcdf'): + + + os.system('echo c_pnetcdf $PNETCDF_INCLUDES pnetcdf.c $PNETCDF_LIBS > out') + if os.system('mpicc -o c_pnetcdf $PNETCDF_INCLUDES pnetcdf.c $PNETCDF_LIBS'): print("Failed to compile pnetcdf.c with mpicc") result.result = "FAILED" result.msg = "Failed to compile a C PNetCDF (pnetcdf.c) with mpicc!" @@ -75,7 +80,7 @@ def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs): print("MPAS_GNU_LIBS_CHECK: Can compile a C PNetCDF Program!") ## Fortran - if os.system('mpif90 -c pnetcdf.f90 -I$PNETCDF/include -L$PNETCDF/lib -lpnetcdf'): + if os.system('mpif90 -c pnetcdf.f90 $PNETCDF_INCLUDES $PNETCDF_LIBS'): print("Failed to compile mpi.f90 with mpif90") result.result = "FAILED" result.msg = "Failed to copmile a Fortran PNetCDF (pnetcdf.f90) with mpif90!" @@ -86,7 +91,8 @@ def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs): # NetCDF - C and Fortran ## C - if os.system('mpicc -o c_netcdf netcdf.c -I$NETCDF/include -I$PNETCDF/include -L$NETCDF/lib -L$PNETCDF/lib -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -ldl -lz'): + if os.system('mpicc -o c_netcdf netcdf.c $NETCDF_INCLUDES $PNETCDF_INCLUDES' + ' $NETCDF_LIBS $PNETCDF_LIBS'): print("Failed to compile netcdf.c with mpicc") result.result = "FAILED" result.msg = "Failed to compile a C NetCDF program (netcdf.c) with mpicc!" @@ -95,7 +101,8 @@ def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs): print("MPAS_GNU_LIBS_CHECK: Can compile a C NetCDF Program!") ## Fortran - if os.system('mpif90 -c netcdf.f90 -I$NETCDF/include -I$PNETCDF/include -L$NETCDF/lib -L$PNETCDF/lib -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -ldl -lz -lm'): + if os.system('mpif90 -c netcdf.f90 $NETCDF_INCLUDES $PNETCDF_INCLUDES' + ' $NETCDF_LIBS $PNETCDF_LIBS'): print("Failed to compile netcdf.f90 with mpif90") result.result = "FAILED" result.msg = "Failed to compile a Fortran NetCDF program (netcdf.f90) with mpif90!" @@ -117,7 +124,8 @@ def run(self, env, result, srcDir, testDir, hpc=None, *args, **kwargs): ## Fortran print("PIO: ", os.environ['PIO']) - if os.system('mpif90 -o piof piof.f90 -I$PIO/include -I$NETCDF/include -I$PNETCDF/include -L$PIO/lib -L$NETCDF/lib -L$PNETCDF/lib -lpiof -lpioc -lgptl -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -ldl -lz -lm'): + if os.system('mpif90 -o piof piof.f90 $PIO_INCLUDES $NETCDF_INCLUDES $PNETCDF_INCLUDE' + ' $PIO_LIBS $NETCDF_LIBS $PNETCDF_LIBS'): print("Failed to compile piof.f90 with mpif90") result.result = "FAILED" result.msg = "Failed to compile a Fortran PIO program (pio.f90) with mpif90!"