From f6da60a4dbf4734a3c8fa89b02550ff47b1f112d Mon Sep 17 00:00:00 2001 From: bennibbelink <79653949+bennibbelink@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:40:40 -0500 Subject: [PATCH 1/3] Update FindCyclus.cmake to find the cython generated libraries if they exist --- CMakeLists.txt | 30 ++++++++++++++++-------------- cmake/FindCyclus.cmake | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9e2eb783..0203687203 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,14 +173,16 @@ IF(NOT CYCLUS_DOC_ONLY) MESSAGE("-- HDF5 High Level Libraries: ${HDF5_C_HL_LIBRARIES}") # find coin and link to it - FIND_PACKAGE(COIN) - if(COIN_FOUND) - SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS}) - SET(LIBS ${LIBS} ${COIN_LIBRARIES}) + if(DEFAULT_ALLOW_MILPS) + FIND_PACKAGE(COIN REQUIRED) + if(COIN_FOUND) + SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS}) + SET(LIBS ${LIBS} ${COIN_LIBRARIES}) + endif() + MESSAGE("-- COIN Root: ${COIN_ROOT}") + MESSAGE("-- COIN Include directories: ${COIN_INCLUDE_DIRS}") + MESSAGE("-- COIN Libraries: ${COIN_LIBRARIES}") endif() - MESSAGE("-- COIN Root: ${COIN_ROOT}") - MESSAGE("-- COIN Include directories: ${COIN_INCLUDE_DIRS}") - MESSAGE("-- COIN Libraries: ${COIN_LIBRARIES}") # find SQLite FIND_PACKAGE( SQLite3 REQUIRED ) @@ -249,13 +251,13 @@ IF(NOT CYCLUS_DOC_ONLY) ENDIF(ICUUC_LIBRARIES) # Python - find_package(PythonInterp) - message("-- PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") - find_package(PythonLibs) - MESSAGE("-- Found Python Libraries (optional): ${PYTHON_LIBRARIES}") - IF(PYTHON_LIBRARIES) - set(LIBS ${LIBS} ${PYTHON_LIBRARIES}) - ENDIF(PYTHON_LIBRARIES) + find_package(Python3 COMPONENTS Interpreter Development) + message("-- PYTHON_EXECUTABLE: ${Python3_EXECUTABLE}") + MESSAGE("-- Found Python Libraries (optional): ${Python3_LIBRARIES}") + IF(Python3_FOUND) + set(LIBS ${LIBS} ${Python3_LIBRARIES}) + message("libs set with ${Python3_LIBRARIES}") + ENDIF(Python3_FOUND) # include all the directories we just found INCLUDE_DIRECTORIES(${CYCAMORE_INCLUDE_DIRS}) diff --git a/cmake/FindCyclus.cmake b/cmake/FindCyclus.cmake index 873c317d24..2a2fecea59 100644 --- a/cmake/FindCyclus.cmake +++ b/cmake/FindCyclus.cmake @@ -88,6 +88,30 @@ FIND_LIBRARY(CYCLUS_CORE_LIBRARY NAMES cyclus /opt/local /opt/local/cyclus PATH_SUFFIXES cyclus/lib lib) +# Look for the library +FIND_LIBRARY(CYCLUS_EVENTHOOKS_LIBRARY NAMES eventhooks.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + +# Look for the library +FIND_LIBRARY(CYCLUS_PYINFILE_LIBRARY NAMES pyinfile.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + +# Look for the library +FIND_LIBRARY(CYCLUS_PYMODULE_LIBRARY NAMES pymodule.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + # Look for the library FIND_LIBRARY(CYCLUS_AGENT_TEST_LIBRARY NAMES baseagentunittests HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" @@ -112,6 +136,17 @@ IF(CYCLUS_CORE_INCLUDE_DIR AND CYCLUS_CORE_TEST_INCLUDE_DIR AND CYCLUS_AGENT_TEST_LIBRARY) SET(CYCLUS_CORE_FOUND 1) SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARY}") + # if Cyclus was installed without Cython these three libraries won't be found because they don't exist + # if Cyclus was installed WITH Cython we need to link against them + if(NOT ${CYCLUS_EVENTHOOKS_LIBRARY} STREQUAL "CYCLUS_EVENTHOOKS_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_EVENTHOOKS_LIBRARY}") + endif() + if(NOT ${CYCLUS_PYINFILE_LIBRARY} STREQUAL "CYCLUS_PYINFILE_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_PYINFILE_LIBRARY}") + endif() + if(NOT ${CYCLUS_PYMODULE_LIBRARY} STREQUAL "CYCLUS_PYMODULE_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_PYMODULE_LIBRARY}") + endif() SET(CYCLUS_TEST_LIBRARIES "${CYCLUS_GTEST_LIBRARY}" "${CYCLUS_AGENT_TEST_LIBRARY}") SET(CYCLUS_AGENT_TEST_LIBRARIES "${CYCLUS_AGENT_TEST_LIBRARY}") SET(CYCLUS_CORE_INCLUDE_DIRS "${CYCLUS_CORE_INCLUDE_DIR}") From 69907cfab78c094987e58e400622a0f4cfde1fea Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Wed, 17 Apr 2024 20:05:44 -0500 Subject: [PATCH 2/3] include --allow-milps in docker build --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 970b2c5aa8..1da46f1cb4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,7 @@ ARG make_cores=2 COPY . /cycamore WORKDIR /cycamore -RUN python install.py -j ${make_cores} --build-type=Release +RUN python install.py -j ${make_cores} --build-type=Release --allow-milps FROM cycamore as deb-generation WORKDIR /cycamore/build From 28997d13f5afcd36826c68d9312e37021274f29a Mon Sep 17 00:00:00 2001 From: Ben Nibbelink Date: Wed, 17 Apr 2024 21:58:15 -0500 Subject: [PATCH 3/3] update CHANGELOG --- CHANGELOG.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 551ccd0886..fe1c02c81c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,11 +14,12 @@ cycamore Change Log **Changed:** -* Updated build procedure to use newer versions of packages in 2023 (#549) +* Updated build procedure to use newer versions of packages in 2023 (#549, #596) * Added active/dormant and request size variation from buy policy to Storage (#546, #568, #586, #587) * Update build procedure to force a rebuild when a test file is changed (#584) * Define the version number in `CMakeLists.txt` and rely on CMake to propagate the version throughout the code (#589) * Update version numbers in documentation and fix references to `master` branch (#591) +* Update build procedure to link against Cyclus' cython generated libraries if needed (#596) v1.5.5 ====================