Skip to content

Commit

Permalink
Fix HOMME builds on NERSC machines
Browse files Browse the repository at this point in the history
Need to set PNETCDF in homme machine cmake files.

Need to refer to MKLROOT correctly in config_compilers.xml.

[BFB]
  • Loading branch information
jgfouca committed Apr 2, 2017
1 parent 7d39622 commit 03ad962
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cime/cime_config/acme/machines/config_compilers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ for mct, etc.
<ADD_CFLAGS DEBUG="FALSE"> -O2 </ADD_CFLAGS>
<CONFIG_ARGS> --host=Linux </CONFIG_ARGS>
<ADD_SLIBS> -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf </ADD_SLIBS>
<ADD_SLIBS> ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm -z muldefs</ADD_SLIBS>
<ADD_SLIBS> $ENV{MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group $ENV{MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm -z muldefs</ADD_SLIBS>
<ADD_GPTL_CPPDEFS> -DHAVE_PAPI </ADD_GPTL_CPPDEFS>
<MPIFC> ftn </MPIFC>
<MPICC> cc </MPICC>
Expand All @@ -572,7 +572,7 @@ for mct, etc.
<ADD_LDFLAGS compile_threaded="true"> -qopenmp </ADD_LDFLAGS>
<CONFIG_ARGS> --host=Linux </CONFIG_ARGS>
<ADD_SLIBS> -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf </ADD_SLIBS>
<ADD_SLIBS> ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm </ADD_SLIBS>
<ADD_SLIBS> $ENV{MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group $ENV{MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm </ADD_SLIBS>
<!--ADD_SLIBS> -mkl -lpthread -lm </ADD_SLIBS-->
<ADD_GPTL_CPPDEFS> -DHAVE_PAPI </ADD_GPTL_CPPDEFS>
<ADD_CPPDEFS> -DHAVE_SLASHPROC </ADD_CPPDEFS>
Expand Down Expand Up @@ -614,7 +614,7 @@ for mct, etc.
<ADD_CFLAGS DEBUG="FALSE"> -O2 </ADD_CFLAGS>
<CONFIG_ARGS> --host=Linux </CONFIG_ARGS>
<ADD_SLIBS> -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf </ADD_SLIBS>
<ADD_SLIBS> ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm </ADD_SLIBS>
<ADD_SLIBS> $ENV{MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group $ENV{MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm </ADD_SLIBS>
<ADD_GPTL_CPPDEFS> -DHAVE_PAPI </ADD_GPTL_CPPDEFS>
<MPIFC> ftn </MPIFC>
<MPICC> cc </MPICC>
Expand Down
5 changes: 5 additions & 0 deletions components/homme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ IF (HDF5_DIR)
ENDIF ()
ADD_SUBDIRECTORY(utils/cime/externals/pio1)

get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "JGF ${_variableName}=${${_variableName}}")
endforeach()

# CPRNC locations
SET (CPRNC_INSTALL_DIR ${CMAKE_BINARY_DIR}/utils/cime/tools/cprnc)
SET (CPRNC_BINARY ${CMAKE_BINARY_DIR}/utils/cime/tools/cprnc/cprnc)
Expand Down
1 change: 1 addition & 0 deletions components/homme/cmake/machineFiles/cori-haswell.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SET (CMAKE_C_COMPILER cc CACHE FILEPATH "")
SET (CMAKE_CXX_COMPILER CC CACHE FILEPATH "")

SET (NETCDF_DIR $ENV{NETCDF_DIR} CACHE FILEPATH "")
SET (PNETCDF_DIR $ENV{PARALLEL_NETCDF_DIR} CACHE FILEPATH "")
SET (HDF5_DIR $ENV{HDF5_DIR} CACHE FILEPATH "")

#ZLIB_DIR=/global/common/cori/software/zlib/1.2.8/hsw/intel
Expand Down
1 change: 1 addition & 0 deletions components/homme/cmake/machineFiles/cori-knl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SET (CMAKE_C_COMPILER cc CACHE FILEPATH "")
SET (CMAKE_CXX_COMPILER CC CACHE FILEPATH "")

SET (NETCDF_DIR $ENV{NETCDF_DIR} CACHE FILEPATH "")
SET (PNETCDF_DIR $ENV{PARALLEL_NETCDF_DIR} CACHE FILEPATH "")
SET (HDF5_DIR $ENV{HDF5_DIR} CACHE FILEPATH "")

#ZLIB_DIR=/global/common/cori/software/zlib/1.2.8/hsw/intel
Expand Down
3 changes: 1 addition & 2 deletions components/homme/cmake/machineFiles/edison.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ SET (CMAKE_C_COMPILER cc CACHE FILEPATH "")
SET (CMAKE_CXX_COMPILER CC CACHE FILEPATH "")
SET (NETCDF_DIR $ENV{NETCDF_DIR} CACHE FILEPATH "")
SET (HDF5_DIR $ENV{HDF5_DIR} CACHE FILEPATH "")
#ndk SET (PNETCDF_DIR $ENV{PARALLEL_NETCDF_DIR} CACHE FILEPATH "")
# this env var is not set with module cray-netcdf-hdf5parallel/4.3.3.1
SET (PNETCDF_DIR $ENV{PARALLEL_NETCDF_DIR} CACHE FILEPATH "")

SET (HDF5_DIR $ENV{HDF5_DIR} CACHE FILEPATH "")

Expand Down

0 comments on commit 03ad962

Please sign in to comment.