diff --git a/.gitignore b/.gitignore index 85c2e2aaa8..591e37d7be 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,10 @@ src/atomic_data.h src/*.tar.gz *.s +# Ignore environment +.env +.venv + # Ignore temp files *.pyc *.save diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 97175f07cb..9cbbc744b9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,7 @@ Next Version * do not try to download missing (super heavy) data from KAERI * update material_library writing interface * reference python_executable rather than assuming `python` exists () + * Update FindMOAB to use MOAB config file (#1526) v0.7.8 ====== diff --git a/CMakeLists.txt b/CMakeLists.txt index 976cde3744..6e9db2edcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,7 @@ MESSAGE("-- HDF5 library version: ${HDF5_VERSION}") # Thus, we give these flags to allow usage of the old interface in newer # versions of HDF5. if(NOT (${HDF5_VERSION} VERSION_LESS 1.12.0)) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5Oget_info_by_idx_vers=1 -DH5O_info_t_vers=1 -DH5Oget_info_by_name_vers=1") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5Oget_info_by_idx_vers=1 -DH5O_info_t_vers=1 -DH5Oget_info_by_name_vers=1") endif() # Look for MOAB if requested @@ -102,37 +102,32 @@ if(WITH_MOAB) if(NOT MOAB_ROOT) set(MOAB_ROOT "${DEPS_ROOT_DIR}") endif() - MESSAGE("-- MOAB Root: ${MOAB_ROOT}") - find_package(MOAB) - message("-- MOAB Found: ${MOAB_FOUND}") - if(${MOAB_FOUND}) - include_directories(${MOAB_INCLUDE_DIRS}) - get_filename_component(MOAB_LIBRARY_DIRS ${MOAB_LIBRARY} PATH) - if(APPLE) - link_directories(${MOAB_LIBRARY_DIRS}) - else(APPLE) - link_directories(${MOAB_LIBRARY_DIRS}) - endif(APPLE) - endif(${MOAB_FOUND}) + find_package(MOAB REQUIRED) + message(STATUS "MOAB Library Version: ${MOAB_VERSION}") + message(STATUS "MOAB Include Directory: ${MOAB_INCLUDE_DIRS}") + message(STATUS "MOAB Library Directories: ${MOAB_LIBRARY_DIRS}") + message(STATUS "MOAB Libraries: ${MOAB_LIBRARIES}") + include_directories(${MOAB_INCLUDE_DIRS}) + link_directories(${MOAB_LIBRARY_DIRS}) endif() # Look for DAGMC if requested if(WITH_DAGMC) - if(${MOAB_FOUND}) + if(MOAB_FOUND) # Always look for DAGMC library if(NOT DAGMC_ROOT) set(DAGMC_ROOT "${DEPS_ROOT_DIR}") endif() - MESSAGE("-- DAGMC Root: ${DAGMC_ROOT}") - find_package(DAGMC) - message("-- DAGMC Found: ${DAGMC_FOUND}") - if(${DAGMC_FOUND}) - include_directories(${DAGMC_INCLUDE_DIRS}) - link_directories(${DAGMC_LIBRARY_DIRS}) - endif(${DAGMC_FOUND}) - else(${MOAB_FOUND}) - message("-- DAGMC: Not searching because MOAB was not found.") - endif(${MOAB_FOUND}) + find_package(DAGMC REQUIRED) + message(STATUS "DAGMC Library Version: ${DAGMC_VERSION}") + message(STATUS "DAGMC Include Directory: ${DAGMC_INCLUDE_DIRS}") + message(STATUS "DAGMC Library Directories: ${DAGMC_LIBRARY_DIRS}") + message(STATUS "DAGMC Libraries: ${DAGMC_LIBRARIES}") + include_directories(${DAGMC_INCLUDE_DIRS}) + link_directories(${DAGMC_LIBRARY_DIRS}) + else() + message(WARNING "DAGMC: Not searching because MOAB was not found.") + endif() endif() # Find Python diff --git a/cmake/FindDAGMC.cmake b/cmake/FindDAGMC.cmake deleted file mode 100644 index d614a370b5..0000000000 --- a/cmake/FindDAGMC.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# - Try to find DAGMC -# Once done this will define -# -# DAGMC_FOUND - system has DAGMC -# DAGMC_INCLUDE_DIRS - the DAGMC include directory -# DAGMC_LIBRARIES - Link these to use DAGMC -# DAGMC_DEFINITIONS - Compiler switches required for using DAGMC -# -# Copyright (c) 2010 Roman Putanowicz -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - - -message(STATUS ${DAGMC_ROOT}) - -find_path(DAGMC_CMAKE_CONFIG NAMES DAGMCConfig.cmake - HINTS ${DAGMC_ROOT} - PATH_SUFFIXES lib Lib cmake dagmc lib/cmake/dagmc - NO_DEFAULT_PATH) - -message(STATUS "Found DAGMC in ${DAGMC_CMAKE_CONFIG}") - -if( "DAGMC_CMAKE_CONFIG-NOTFOUND" STREQUAL "${DAGMC_CMAKE_CONFIG}") - set(DAGMC_FOUND FALSE) -else() - include(${DAGMC_CMAKE_CONFIG}/DAGMCConfig.cmake) - set(DAGMC_FOUND TRUE) -endif() diff --git a/cmake/FindMOAB.cmake b/cmake/FindMOAB.cmake deleted file mode 100644 index d642555cb2..0000000000 --- a/cmake/FindMOAB.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# - Try to find MOAB -# Once done this will define -# -# MOAB_FOUND - system has MOAB -# MOAB_INCLUDE_DIRS - the MOAB include directory -# MOAB_LIBRARIES - Link these to use MOAB -# MOAB_DEFINITIONS - Compiler switches required for using MOAB -# -# Copyright (c) 2010 Roman Putanowicz -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -if (MOAB_LIBRARIES AND MOAB_INCLUDE_DIRS) - # in cache already - set(MOAB_FOUND TRUE) -else (MOAB_LIBRARIES AND MOAB_INCLUDE_DIRS) - find_path(MOAB_INCLUDE_DIR NAMES MBiMesh.hpp - HINTS ${MOAB_ROOT}/include ${DEPS_INCLUDE_HINTS} - PATHS $ENV{HOME}/.local/include - PATH_SUFFIXES include Include - PATHS "${BASE_DIR}/include" "${BASE_DIR}/../install/include" - ENV MOAB_ROOT - NO_DEFAULT_PATH - ) - find_path(MOAB_INCLUDE_DIR NAMES MBiMesh.hpp - HINTS ${MOAB_ROOT}/include ${DEPS_INCLUDE_HINTS}) - - find_library(MOAB_LIBRARY NAMES MOAB - HINTS ${MOAB_ROOT}/lib ${DEPS_LIB_HINTS} - PATHS $ENV{HOME}/.local/lib - PATH_SUFFIXES lib Lib - PATHS "${BASE_DIR_LIB}" "${BASE_DIR_LIB}/../../install/lib" - ENV MOAB_ROOT - NO_DEFAULT_PATH - ) - find_library(MOAB_LIBRARY NAMES MOAB - HINTS ${MOAB_ROOT}/lib ${DEPS_LIB_HINTS}) - - set(MOAB_INCLUDE_DIRS - ${MOAB_INCLUDE_DIR} CACHE PATH "Path to MOAB headers") - - set(MOAB_LIBRARIES - ${MOAB_LIBRARY} CACHE STRING "Directories to be linked to use MOAB") - - include(FindPackageHandleStandardArgs) - # handle the QUIETLY and REQUIRED arguments and set MOAB_FOUND to TRUE - # if all listed variables are TRUE - find_package_handle_standard_args(MOAB DEFAULT_MSG - MOAB_LIBRARY MOAB_INCLUDE_DIRS) - if (MOAB_FOUND) - message(STATUS "MOAB header files: ${MOAB_INCLUDE_DIRS}") - message(STATUS "MOAB library: ${MOAB_LIBRARY}") - endif (MOAB_FOUND) - mark_as_advanced(MOAB_INCLUDE_DIRS MOAB_LIBRARIES) -endif (MOAB_LIBRARIES AND MOAB_INCLUDE_DIRS) -