Skip to content

Commit

Permalink
Merge pull request #4536 from billsacks/remove_cpl7_unit_tests
Browse files Browse the repository at this point in the history
Remove cpl7 unit tests

In trying to get the unit tests running on derecho, I ran into problems with the cpl7 unit tests. It seems like these aren't useful anymore: they at least aren't useful to CESM; @rljacob are they useful to E3SM?

Test suite: Just ran ./scripts_regression_tests.py test_sys_unittest.py - on derecho, cheyenne and my mac. I ran in the context of CTSM master. This needed changes in the share code and ccs_config (in separate PRs that I am opening) - but it won't do any harm to bring in this cime change separately from those (the others are just needed for unit tests to pass on derecho).
Test baseline: N/A
Test namelist changes: none
Test status: bit for bit

Fixes none

User interface changes?: N

Update gh-pages html (Y/N)?: N
  • Loading branch information
billsacks authored Dec 7, 2023
2 parents da8b4d7 + 263a8ba commit f7d44bb
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,81 +22,13 @@ include_directories(${NetCDF_C_INCLUDE_DIRS} ${NetCDF_Fortran_INCLUDE_DIRS})
# TODO: Some of the below should be done in the relevant directories, not in
# this top level CMakeLists.

# ------------------------------------------------------------------------
# Build mct
# ------------------------------------------------------------------------
if (EXISTS ${SRC_ROOT}/libraries/mct)
set(MCT_ROOT "${SRC_ROOT}/libraries/mct")
else()
set(MCT_ROOT "${SRC_ROOT}/externals/mct")
endif()

if (USE_MPI_SERIAL)
set(ENABLE_MPI_SERIAL "--enable-mpiserial")
else()
set(ENABLE_MPI_SERIAL "")
endif()

ExternalProject_add(mct_project
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${MCT_ROOT}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/mct
CONFIGURE_COMMAND ${MCT_ROOT}/configure ${ENABLE_MPI_SERIAL} --enable-debugging --prefix=${CMAKE_CURRENT_BINARY_DIR} CC=${CMAKE_C_COMPILER} FC=${CMAKE_Fortran_COMPILER} CFLAGS=${CFLAGS} FCFLAGS=${FFLAGS} SRCDIR=${MCT_ROOT} DEBUG="-g"
BUILD_COMMAND $(MAKE) SRCDIR=${MCT_ROOT}
# Leave things in <BINARY_DIR> rather than "installing", because we have
# no need to move things around inside of the CMake binary directory. Also,
# mpi-serial doesn't install properly in the out-of-source build
INSTALL_COMMAND :
)
# This copy_makefiles step is needed because mct currently doesn't support an
# out-of-source build. I am replicating what is done for the CIME system build.
ExternalProject_add_step(mct_project copy_makefiles
DEPENDEES configure
DEPENDERS build
WORKING_DIRECTORY <BINARY_DIR>
COMMAND cp -p <SOURCE_DIR>/Makefile .
COMMAND mkdir -p mct
COMMAND cp -p <SOURCE_DIR>/mct/Makefile mct/
COMMAND mkdir -p mpeu
COMMAND cp -p <SOURCE_DIR>/mpeu/Makefile mpeu/
)
if (USE_MPI_SERIAL)
ExternalProject_add_step(mct_project copy_mpi_serial_files
DEPENDEES configure
DEPENDERS build
WORKING_DIRECTORY <BINARY_DIR>
COMMAND mkdir -p mpi-serial
COMMAND cp -p <SOURCE_DIR>/mpi-serial/Makefile mpi-serial/
COMMAND cp <SOURCE_DIR>/mpi-serial/mpif.h mpi-serial/
COMMAND cp <SOURCE_DIR>/mpi-serial/mpi.h mpi-serial/
)
endif()

# Tell cmake to look for libraries & mod files here, because this is where we built libraries
include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mct)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mct)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu)
if (USE_MPI_SERIAL)
# We need to list the mpi-serial include directory before system-level
# directories so that we're sure to use mpi-serial's mpif.h instead of
# an mpif.h from a system path.
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
link_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
endif()

# ------------------------------------------------------------------------
# Done MCT build
# ------------------------------------------------------------------------

# Now a bunch of includes for share code.

# csm_share (we don't build it here because it seems to be built differently
# by different tests?)

if (EXISTS ${SRC_ROOT}/share/src)
add_subdirectory(${SRC_ROOT}/share/src share_src)
add_subdirectory(${SRC_ROOT}/components/cpl7/mct_shr mct_src)
add_subdirectory(${SRC_ROOT}/share/unit_test_stubs/util csm_share_stubs)
include_directories(${SRC_ROOT}/share/include)
else()
Expand All @@ -115,9 +47,4 @@ else()
endif()

# Now the actual test directories.
if (EXISTS ${SRC_ROOT}/components/cpl7/driver/unit_test)
add_subdirectory(${SRC_ROOT}/components/cpl7/driver/unit_test unit_test)
else()
add_subdirectory(${SRC_ROOT}/driver-mct/unit_test unit_test)
endif()
add_subdirectory(${SRC_ROOT}/share/test/unit ${CMAKE_BINARY_DIR}/unittests)

0 comments on commit f7d44bb

Please sign in to comment.