Skip to content

Commit

Permalink
Merge pull request #1735 from bennibbelink/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke committed Apr 20, 2024
2 parents f7a5b52 + 8b0e3d1 commit d22a356
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 77 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Since last release
* Changed README.rst installation instructions, tested on fresh Ubuntu-22.04 system with Python 3.11 (#1617, #1644)
* Resolved various compilation warnings due to use of deprecated APIs (#1671)
* Update version management in CMake build (#1696)
* Changed dependency versions in README.rst, INSTALL.rst, and DEPENDENCIES.rst (#1703)
* Changed dependency versions in README.rst, INSTALL.rst, and DEPENDENCIES.rst (#1703, #1735)
* Updated minor documentation about updating CHANGELOG.rst, fix formatting for rendering
hyperlinks, and change branch name in README instructions on forking for development (#1715)

Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,16 @@ IF(NOT CYCLUS_DOC_ONLY)
# Cython & Python Bindings
#
# Use new Python library finder
find_package (Python3 COMPONENTS Interpreter Development NumPy)
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)

execute_process(COMMAND "${Python3_EXECUTABLE}" -m site --user-site
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE)
message("-- PYTHON_EXECUTABLE: ${Python3_EXECUTABLE}")
message("-- PYTHON_SITE_PACKAGES: ${PYTHON_SITE_PACKAGES}")
IF (NOT APPLE)
set(LIBS ${LIBS} ${Python3_LIBRARIES})
ENDIF (NOT APPLE)

# Include the CMake script UseCython.cmake. This defines add_cython_module().
# Instruction for use can be found at the top of cmake/UseCython.cmake.
Expand All @@ -325,7 +328,7 @@ IF(NOT CYCLUS_DOC_ONLY)
message(FATAL_ERROR "Cython version is too old, must be 0.25+.")
endif()
include(UseCython)

find_package (Python3 REQUIRED COMPONENTS NumPy)
find_package(Jinja2 REQUIRED)
find_package(Pandas REQUIRED)

Expand All @@ -341,9 +344,6 @@ IF(NOT CYCLUS_DOC_ONLY)

# make sure we know about having python
add_definitions(-DCYCLUS_WITH_PYTHON)
IF (NOT APPLE)
set(LIBS ${LIBS} ${Python3_LIBRARIES})
ENDIF (NOT APPLE)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/cyclus")
else(Cython_FOUND)
# If we don't have Python bindings, we may try to find tcmalloc.
Expand All @@ -365,6 +365,7 @@ IF(NOT CYCLUS_DOC_ONLY)
# NOTE: for some reason, adding quotes around
# ${Glibmm_INCLUDE_DIRS} breaks Ubuntu 12.04
set(inc_dirs
"${Python3_INCLUDE_DIRS}"
"${LIBXML2_INCLUDE_DIR}"
"${LIBXMLXX_INCLUDE_DIRS}"
"${Glibmm_INCLUDE_DIRS}"
Expand All @@ -378,7 +379,6 @@ IF(NOT CYCLUS_DOC_ONLY)
ENDIF()
message("-- Include Directories: ${inc_dirs}")


if(Cython_FOUND)
INCLUDE_DIRECTORIES(AFTER "${Python3_INCLUDE_DIRS}" "${_Python3_NumPy_INCLUDE_DIR}")
endif(Cython_FOUND)
Expand Down
93 changes: 43 additions & 50 deletions DEPENDENCIES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,41 @@ In order to facilitate future compatibility with multiple platforms,
Cyclus is built using ``CMake``. A full list of the Cyclus package
dependencies is shown below:

==================== ==================
Package Minimum Version
==================== ==================
``CMake`` 3.16.3
``boost`` 1.71.0
``libxml2`` 2.9.10+
``libxml++`` 2.40.1
``python`` 3.8.10
``sqlite3`` 3.31.1
``HDF5`` 1.10.4+
``Coin-Cbc`` 2.10.3
``Coin-Clp`` 1.17.5
``zlib`` 1.2.11
==================== ==================
==================== ==================
Package Minimum Version
==================== ==================
``CMake`` 3.16.3
``pkg-config`` 0.29.1
``boost`` 1.71.0
``libxml2`` 2.9.10
``libxml++`` 2.40.1
``python`` 3.8.10
``sqlite3`` 3.31.1
``HDF5`` 1.10.4
``LAPACK`` 3.9.0
==================== ==================

.. website_include_end
And a few optional dependencies:

==================== ==================
Package Minimum Version
==================== ==================
doxygen (for docs) 1.7.6.1
tcmalloc (for speed) any
Cython 0.29+
Python (dev version) 3.8+
Jinja2 any
NumPy 1.9+
Pandas any
==================== ==================
==================== ================== ============================================= ==================
Package Minimum Version Purpose Notes
==================== ================== ============================================= ==================
``Coin-Cbc`` 2.10.3 Enables use of Branch-and-Cut solver Cyclus must be built with ``--allow-milps`` flag
``Coin-Clp`` 1.17.5 Enables use of Linear Programming solver Cyclus must be built with ``--allow-milps`` flag
``doxygen`` 1.7.6.1 Building documentation N/A
``TCMmalloc`` any Improves performance Only used if Cython is not present
``Cython`` 0.29 Enables use of Python agents and input files N/A
``Jinja2`` 2.10.1 Enables use of Python agents and input files Only needed if Cython is installed
``NumPy`` 1.9 Enables use of Python agents and input files Only needed if Cython is installed
``pandas`` 0.25.3 Enables use of Python agents and input files Only needed if Cython is installed
``pip`` 20.0.2 Enables use of Python agents and input files Only needed if Cython is installed
==================== ================== ============================================= ==================

*Note that the Debian/Ubuntu package ``libtcmalloc`` is NOT discovered correctly
by our build system. Instead use ``libgoogle-perftools-dev``.*

*Also note that the development version of Python, Jinja2, NumPy, and Pandas are
only needed if Cython is installed.*

***********************
Installing Dependencies
***********************
Expand Down Expand Up @@ -88,31 +84,30 @@ required library package names is:

#. make
#. cmake
#. pkg-config
#. libboost-all-dev (see note below)
#. libxml2-dev
#. libxml++2.6-dev
#. python3-dev
#. libsqlite3-dev
#. libhdf5-serial-dev
#. libbz2-dev
#. coinor-libcbc-dev
#. coinor-libcoinutils-dev
#. coinor-libosi-dev
#. coinor-libclp-dev
#. coinor-libcgl-dev
#. libhdf5-dev
#. liblapack-dev


and (optionally):

#. doxygen
#. g++
#. libblas-dev
#. liblapack-dev
#. libgoogle-perftools-dev
#. python3-dev
#. coinor-libcbc-dev
#. coinor-libcoinutils-dev
#. coinor-libosi-dev
#. coinor-libclp-dev
#. python3-tables
#. python3-pandas
#. python3-numpy
#. python3-nose
#. python3-pytest
#. python3-jinja2
#. python3-pip
#. cython3 (see note below)

For example, in order to install libxml++ (and libxml2) on your system, type:
Expand All @@ -126,19 +121,17 @@ If you'd prefer to copy/paste, the following line will install all **required**

.. code-block:: bash
sudo apt-get install -y cmake make libboost-all-dev libxml2-dev libxml++2.6-dev \
libsqlite3-dev libhdf5-serial-dev libbz2-dev coinor-libcbc-dev coinor-libcoinutils-dev \
coinor-libosi-dev coinor-libclp-dev coinor-libcgl-dev
sudo apt-get install -y cmake make pkg-config libboost-all-dev libxml2-dev libxml++2.6-dev \
python3-dev libsqlite3-dev libhdf5-dev liblapack-dev
And to install all *Cyclus* dependencies (**required and optional**):

.. code-block:: bash
sudo apt-get install -y cmake make libboost-all-dev libxml2-dev libxml++2.6-dev \
libsqlite3-dev libhdf5-serial-dev libbz2-dev coinor-libcbc-dev coinor-libcoinutils-dev \
coinor-libosi-dev coinor-libclp-dev coinor-libcgl-dev libblas-dev liblapack-dev g++ \
libgoogle-perftools-dev python3-dev python3-tables python3-pandas python3-numpy python3-nose \
python3-jinja2 cython3
sudo apt-get install -y cmake make pkg-config libboost-all-dev libxml2-dev libxml++2.6-dev \
python3-dev libsqlite3-dev libhdf5-dev liblapack-dev coinor-libcbc-dev coinor-libcoinutils-dev \
coinor-libosi-dev coinor-libclp-dev coinor-libcgl-dev doxygen libgoogle-perftools-dev python3-tables \
python3-pandas python3-numpy python3-pytest python3-jinja2 cython3
To determine which version of Python is already installed on your computer, run:

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To install Cyclus and its dependencies onto a clean Ubuntu machine (tested on 18

- ``conda activate cyclus``

- ``conda install -y openssh gxx_linux-64 gcc_linux-64 cmake make docker-pycreds git xo python-json-logger glib glibmm zlib libxml2 libxmlpp libxmlpp-4.0 libblas libcblas liblapack pkg-config coincbc boost-cpp hdf5 sqlite pcre gettext bzip2 xz setuptools pytest pytables pandas jinja2 "cython<3" websockets pprintpp``
- ``conda install -y gxx_linux-64 gcc_linux-64 cmake make git glib libxml2 libxmlpp-4.0 liblapack pkg-config coincbc boost-cpp hdf5 sqlite pcre setuptools pytest pytables pandas jinja2 cython websockets pprintpp pip``

- ``conda install -y --force-reinstall libsqlite``

Expand Down
13 changes: 0 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
FROM common-base as apt-deps

RUN apt update -y && apt install -y \
libssh-dev \
g++ \
gcc \
cmake \
make \
libxml2-dev \
libxml++2.6-dev \
libblas-dev \
liblapack-dev \
pkg-config \
coinor-libcbc-dev \
Expand All @@ -27,8 +25,6 @@ RUN apt update -y && apt install -y \
libhdf5-dev \
libsqlite3-dev \
libpcre2-dev \
gettext-base \
xz-utils \
python3-setuptools \
python3-pytest \
python3-tables \
Expand Down Expand Up @@ -68,30 +64,21 @@ RUN conda uninstall -y conda-libmamba-solver
RUN conda config --set solver classic
RUN conda update -y --all && \
mamba install -y \
openssh \
gxx_linux-64 \
gcc_linux-64 \
cmake \
make \
docker-pycreds \
git \
xo \
python-json-logger \
glib \
libxml2 \
libxmlpp-4.0 \
libblas \
libcblas \
liblapack \
pkg-config \
coincbc \
boost-cpp \
hdf5 \
sqlite \
pcre \
gettext \
bzip2 \
xz \
setuptools \
pytest \
pytables \
Expand Down
5 changes: 1 addition & 4 deletions docker/Rocky.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ RUN alternatives --install /usr/bin/python python /bin/python3.11 10 && \

FROM rocky-${rocky_version}-config as dnf-deps
RUN dnf update -y && dnf install -y \
wget \
which \
git \
gcc \
Expand All @@ -29,10 +28,8 @@ RUN dnf update -y && dnf install -y \
hdf5-devel \
libxml2-devel \
boost-devel \
blas-devel \
lapack-devel \
sqlite-devel \
gettext \
xz \
python3.11-devel \
python3.11-setuptools \
Expand All @@ -43,7 +40,7 @@ RUN dnf update -y && dnf install -y \
RUN mkdir -p $(python -m site --user-site) && python -m pip install pandas tables cython jinja2

FROM dnf-deps as libxmlpp
RUN dnf update -y && dnf install -y m4 doxygen perl-open perl-XML-Parser diffutils pcre-cpp pcre-devel && \
RUN dnf update -y && dnf install -y wget m4 doxygen perl-open perl-XML-Parser diffutils pcre-cpp pcre-devel && \
python -m pip install meson ninja packaging && \
wget https://github.com/libxmlplusplus/libxmlplusplus/releases/download/4.0.3/libxml++-4.0.3.tar.xz && \
tar xf libxml++-4.0.3.tar.xz && \
Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ list(REMOVE_ITEM cc_files ${CMAKE_CURRENT_SOURCE_DIR}/coin_helpers.cc)
list(REMOVE_ITEM cc_files ${CMAKE_CURRENT_SOURCE_DIR}/prog_translator.cc)
# The cython modules are built as their own shared libraries
# We don't want them to be included in libcyclus.so
list(REMOVE_ITEM cc_files ${CythonModuleSrc})

if(Cython_FOUND)
list(REMOVE_ITEM cc_files ${CythonModuleSrc})
endif()
SET(CYCLUS_CORE_SRC ${CYCLUS_CORE_SRC} ${cc_files})

# Add Cyclus source files that use COIN, if we have COIN
Expand Down
5 changes: 5 additions & 0 deletions tests/toolkit/infile_converters_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "cyclus.h"


std::string MakeInput() {
return std::string(
"<simulation>"
Expand Down Expand Up @@ -81,6 +82,8 @@ TEST(InfileConverters, JsonXmlRoundTrip) {
EXPECT_STREQ(x1.c_str(), x2.c_str());
}

#ifdef CYCLUS_WITH_PYTHON

TEST(InfileConverters, JsonPyRoundTrip) {
using std::string;
cyclus::PyStart();
Expand Down Expand Up @@ -109,3 +112,5 @@ TEST(InfileConverters, PyXmlRoundTrip) {
EXPECT_STREQ(p1.c_str(), p2.c_str());
EXPECT_STREQ(x1.c_str(), x2.c_str());
}

#endif // CYCLUS_WITH_PYTHON

0 comments on commit d22a356

Please sign in to comment.