Commit a61f3dbb authored by Ron Rahaman's avatar Ron Rahaman
Browse files

Updated CMake scripts for 3rd-party subtrees

parent d82ca4a1
......@@ -36,10 +36,6 @@ set(LIBP_DEFINES "-DUSE_NULL_PROJECTION=1" CACHE STRING
set(OCCA_CXX "${CMAKE_CXX_COMPILER}" CACHE STRING "C++ compiler for OCCA JIT compile")
set(OCCA_CXXFLAGS "-O2 -ftree-vectorize -funroll-loops -march=native -mtune=native"
CACHE STRING "C++ flags for OCCA JIT compile")
set(OCCA_TAG "main" CACHE STRING "Git branch, tag, or hash for cloning OCCA")
set(NEK5000_TAG "master" CACHE STRING "Git branch, tag, or hash for cloning Nek5000")
set(HYPRE_VER "2.18.2" CACHE STRING "Version number of HYPRE to download")
set(USE_OCCA_MEM_BYTE_ALIGN "64" CACHE STRING "Memory allignment for OCCA kernels")
# From OCCA's CMakeLists. All default to ON, but are verified in config tests
......
......@@ -8,26 +8,8 @@ set(HYPRE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "" FORCE)
set(HYPRE_ENABLE_SINGLE OFF CACHE BOOL "" FORCE)
set(HYPRE_ENABLE_MIXEDINT ON CACHE BOOL "" FORCE)
if (EXISTS ${HYPRE_SOURCE_DIR})
message(STATUS "Using HYPRE source in ${HYPRE_SOURCE_DIR}")
add_subdirectory(${HYPRE_SOURCE_DIR}/src)
get_property(HYPRE_BINARY_DIR TARGET HYPRE PROPERTY BINARY_DIR)
else()
FetchContent_Declare(
hypre_content
URL https://github.com/hypre-space/hypre/archive/v${HYPRE_VER}.tar.gz )
FetchContent_GetProperties(hypre_content)
if (NOT hypre_content_POPULATED)
FetchContent_Populate(hypre_content)
endif()
set(HYPRE_SOURCE_DIR ${hypre_content_SOURCE_DIR})
set(HYPRE_BINARY_DIR ${hypre_content_BINARY_DIR})
# * Exclude from all since HYPRE CMakeLists adds a bunch of targets we don't need
# libHYPRE will be build just fine, since we've explicitly declared it as a dependency
add_subdirectory(${HYPRE_SOURCE_DIR}/src ${HYPRE_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
add_subdirectory(${HYPRE_SOURCE_DIR}/src)
get_property(HYPRE_BINARY_DIR TARGET HYPRE PROPERTY BINARY_DIR)
# This conflicts with the stdlib "version" header...
file(REMOVE ${HYPRE_SOURCE_DIR}/src/utilities/version)
......
set(NEK5000_GS_VERSION "1.0.5")
set(NEK5000_GS_HASH "1b5b28de5b997c3b0893a3b4dcf5cee8614b9f27")
set(NEK5000_GS_VERSION "1.0.7")
set(PARRSB_VERSION "0.6")
if (${NEK5000_PPLIST} MATCHES "PARRSB")
......@@ -13,20 +12,10 @@ endif()
# Nek5000
# =======
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/nek5000)
message(STATUS "Using Nek5000 source in ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/nek5000")
# Since Nek5000 is compiled in-source, we copy it to the build
# directory, even if it's available locally
FetchContent_Declare(
nek5000_content
URL ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/nek5000)
else()
FetchContent_Declare(
nek5000_content
GIT_REPOSITORY https://github.com/nek5000/nek5000.git
GIT_TAG ${NEK5000_TAG})
endif()
FetchContent_Declare(
nek5000_content
URL ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/nek5000)
FetchContent_GetProperties(nek5000_content)
if (NOT nek5000_content_POPULATED)
FetchContent_Populate(nek5000_content)
......@@ -48,22 +37,16 @@ set(BLASLAPACK_DIR ${NEK5000_SOURCE_DIR}/3rd_party/blasLapack)
# gslib
# =====
set(NEK5000_GS_SUBTREE ${CMAKE_CURRENT_LIST_DIR}/../3rd_party/nek5000_gslib)
set(NEK5000_GS_DIR ${NEK5000_SOURCE_DIR}/3rd_party/gslib)
set(NEK5000_GS_TAR ${NEK5000_GS_DIR}/v${NEK5000_GS_VERSION}.tar.gz)
if (EXISTS ${NEK5000_GS_TAR})
message(STATUS "Using gslib source from ${NEK5000_GS_TAR}")
else()
FetchContent_Declare(
nek5000_gs_content
URL http://github.com/gslib/gslib/archive/v${NEK5000_GS_VERSION}.tar.gz
URL_HASH SHA1=${NEK5000_GS_HASH}
DOWNLOAD_DIR ${NEK5000_GS_DIR}
DOWNLOAD_NO_EXTRACT on
)
if (NOT nek5000_gs_content_POPULATED)
FetchContent_Populate(nek5000_gs_content)
endif()
FetchContent_Declare(
nek5000_gs_content
URL ${NEK5000_GS_SUBTREE}
DOWNLOAD_DIR ${NEK5000_GS_DIR}
)
if (NOT nek5000_gs_content_POPULATED)
FetchContent_Populate(nek5000_gs_content)
endif()
set(NEK5000_GS_SOURCE_DIR ${NEK5000_GS_DIR}/gslib/src)
......@@ -78,28 +61,21 @@ file(MAKE_DIRECTORY ${NEK5000_GS_INCLUDE_DIR})
# parRSB
# ======
set(PARRSB_SUBTREE ${CMAKE_CURRENT_LIST_DIR}/../3rd_party/nek5000_parRSB/v${PARRSB_VERSION}.tar.gz)
set(PARRSB_DIR ${NEK5000_SOURCE_DIR}/3rd_party/parRSB)
set(PARRSB_TAR ${PARRSB_DIR}/v${PARRSB_VERSION}.tar.gz)
if (USE_PARRSB)
if (EXISTS ${PARRSB_TAR})
message(STATUS "Using parRSB source from ${PARRSB_TAR}")
else()
FetchContent_Declare(
parrsb_content
URL https://github.com/Nek5000/parRSB/archive/v${PARRSB_VERSION}.tar.gz
DOWNLOAD_DIR ${PARRSB_DIR}
DOWNLOAD_NO_EXTRACT on
)
FetchContent_GetProperties(parrsb_content)
if (NOT parrsb_content_POPULATED)
# Moves `install` script so it doesn't get clobbered when
# populating content.
#file(RENAME ${PARRSB_DIR}/install temp_parrsb_install)
FetchContent_Populate(parrsb_content)
#file(RENAME temp_parrsb_install ${PARRSB_DIR}/install)
endif()
endif()
FetchContent_Declare(
parrsb_content
URL ${PARRSB_SUBTREE}
DOWNLOAD_DIR ${PARRSB_DIR}
)
FetchContent_GetProperties(parrsb_content)
if (NOT parrsb_content_POPULATED)
# Moves `install` script so it doesn't get clobbered when
# populating content.
#file(RENAME ${PARRSB_DIR}/install temp_parrsb_install)
FetchContent_Populate(parrsb_content)
#file(RENAME temp_parrsb_install ${PARRSB_DIR}/install)
endif()
# ---------------------------------------------------------
......
set(OCCA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/occa")
# If OCCA is not in source tree, download it in build directory
if (EXISTS ${OCCA_SOURCE_DIR})
message(STATUS "Using OCCA source in ${OCCA_SOURCE_DIR}")
else()
FetchContent_Declare(
occa_content
GIT_REPOSITORY https://github.com/Nek5000/occa.git
GIT_TAG ${OCCA_TAG})
FetchContent_GetProperties(occa_content)
if(NOT occa_content_POPULATED)
FetchContent_Populate(occa_content)
endif()
set(OCCA_SOURCE_DIR ${occa_content_SOURCE_DIR})
endif()
add_subdirectory(${OCCA_SOURCE_DIR} ${occa_content_BINARY_DIR})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment