Skip to content

Commit

Permalink
Merge branch 'include_libs_check'
Browse files Browse the repository at this point in the history
  • Loading branch information
MiCurry committed Jun 8, 2020
2 parents be753c2 + 4433c92 commit fcc9775
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 12 deletions.
34 changes: 29 additions & 5 deletions envs/reddwarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smarts/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/mpas_atm_gnu_compile/mpas_atm_gnu_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 13 additions & 5 deletions tests/mpas_gnu_libs_check/mpas_gnu_libs_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand All @@ -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!"
Expand All @@ -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!"
Expand All @@ -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!"
Expand All @@ -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!"
Expand Down

0 comments on commit fcc9775

Please sign in to comment.