# CMake initial cache file for Anvil
#
# 2017/11 MT:  Set NETCDF and PNETCDF paths using same approach as CIME
#              Rely on CIME's FindNetCDF and FindPnetCDF for all remaining config
#
SET (CMAKE_Fortran_COMPILER mpif90 CACHE FILEPATH "")
SET (CMAKE_C_COMPILER mpicc CACHE FILEPATH "")
SET (CMAKE_CXX_COMPILER mpicxx CACHE FILEPATH "")

SET (NetCDF_C_PATH $ENV{NETCDF_C_PATH} CACHE FILEPATH "")
SET (NetCDF_Fortran_PATH $ENV{NETCDF_FORTRAN_PATH} CACHE FILEPATH "")
SET (WITH_PNETCDF FALSE CACHE FILEPATH "")

EXECUTE_PROCESS(COMMAND nf-config --flibs
  RESULT_VARIABLE NFCONFIG_RESULT
  OUTPUT_VARIABLE NFCONFIG_OUTPUT
  ERROR_VARIABLE  NFCONFIG_ERROR
  OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET (ADD_LINKER_FLAGS " ${NFCONFIG_OUTPUT} " CACHE STRING "")

EXECUTE_PROCESS(COMMAND nc-config --libs
  RESULT_VARIABLE NCCONFIG_RESULT
  OUTPUT_VARIABLE NCCONFIG_OUTPUT
  ERROR_VARIABLE  NCCONFIG_ERROR
  OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET (ADD_LINKER_FLAGS " ${NCCONFIG_OUTPUT} " CACHE STRING "")

SET (USE_MPIEXEC "srun" CACHE STRING "")
SET (HOMME_USE_MKL "TRUE" CACHE FILEPATH "") # for Intel
SET (USE_QUEUING FALSE CACHE BOOL "")
# for standalone HOMME builds:
SET (CPRNC_DIR /lcrc/group/acme/tools/cprnc CACHE FILEPATH "")

