Commit 0a99e15f authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Merge branch 'joss' into 'master'

JOSS Submission

See merge request tpurcell/cpp_sisso!33
parents 8267333c 7786a5a3
Pipeline #110396 passed with stages
in 58 minutes and 28 seconds
......@@ -16,8 +16,8 @@ build-intel-base:
- export MKLROOT=/home/runner/intel/oneapi/mkl/latest/
- export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
- export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILE=icc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=OFF -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../intel_base/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=ON -DBUILD_PARAMS=OFF -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../intel_base/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -39,8 +39,8 @@ build-intel-py:
- export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env_intel_py/lib/python3.7/site-packages/
- export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILE=icc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=OFF -DBUILD_PARAMS=OFF -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../intel_py/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=OFF -DBUILD_PARAMS=OFF -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../intel_py/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -60,8 +60,8 @@ build-intel-param:
- export MKLROOT=/home/runner/intel/oneapi/mkl/latest/
- export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
- export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILE=icc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../intel_param/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../intel_param/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -83,8 +83,8 @@ build-intel-param-py:
- export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env_intel_param_py/lib/python3.7/site-packages/
- export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILE=icc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=OFF -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../intel_param_py/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=OFF -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../intel_param_py/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -98,6 +98,7 @@ test-intel-pytest-py:
stage: unit_test
dependencies:
- build-intel-py
needs: ["build-intel-py"]
script:
- source cpp_sisso_env_intel_py/bin/activate
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
......@@ -114,6 +115,7 @@ test-intel-pytest-param-py:
stage: unit_test
dependencies:
- build-intel-param-py
needs: ["build-intel-param-py"]
script:
- source cpp_sisso_env_intel_param_py/bin/activate
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
......@@ -130,6 +132,7 @@ test-intel-base-googletest:
stage: unit_test
dependencies:
- build-intel-base
needs: ["build-intel-base"]
script:
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
- export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/latest/linux/
......@@ -145,6 +148,7 @@ test-intel-param-googletest:
stage: unit_test
dependencies:
- build-intel-param
needs: ["build-intel-param"]
script:
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
- export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/latest/linux/
......@@ -160,6 +164,7 @@ test-intel-bin-param:
stage: bin_test
dependencies:
- build-intel-param-py
needs: ["build-intel-param-py"]
script:
- source cpp_sisso_env_intel_param_py/bin/activate
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
......@@ -177,6 +182,7 @@ test-intel-bin-base:
stage: bin_test
dependencies:
- build-intel-py
needs: ["build-intel-py"]
script:
- source cpp_sisso_env_intel_py/bin/activate
- export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/latest/
......@@ -196,8 +202,8 @@ build-gnu-base:
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
- mkdir build_gnu_base/
- cd build_gnu_base/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=OFF -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../gnu_base/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=ON -DBUILD_PARAMS=OFF -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../gnu_base/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -211,8 +217,8 @@ build-gnu-param:
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
- mkdir build_gnu_param/
- cd build_gnu_param/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../gnu_param/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=../gnu_param/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -229,8 +235,8 @@ build-gnu-py:
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_gnu_py_env/lib/python3.7/site-packages/
- mkdir build_py/
- cd build_py/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=OFF -DBUILD_PARAMS=OFF -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_py/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=OFF -DBUILD_PARAMS=OFF -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_py/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -248,8 +254,8 @@ build-gnu-param-py:
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_gnu_param_py_env/lib/python3.7/site-packages/
- mkdir build_param_py/
- cd build_param_py/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=OFF -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_param_py/ ../
- make
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_FLAGS="-O3" -DEXTERNAL_BUILD_N_PROCS=4 -DBUILD_TESTS=OFF -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_param_py/ ../
- make -j4
- make install
- cd ../
artifacts:
......@@ -262,6 +268,7 @@ test-gnu-pytest-py:
stage: unit_test
dependencies:
- build-gnu-py
needs: ["build-gnu-py"]
script:
- source cpp_sisso_gnu_py_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
......@@ -274,6 +281,7 @@ test-gnu-pytest-param-py:
stage: unit_test
dependencies:
- build-gnu-param-py
needs: ["build-gnu-param-py"]
script:
- source cpp_sisso_gnu_param_py_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
......@@ -286,6 +294,7 @@ test-gnu-base-googletest:
stage: unit_test
dependencies:
- build-gnu-base
needs: ["build-gnu-base"]
script:
- export OMP_NUM_THREADS=2
- export OMP_PLACES=cores
......@@ -296,6 +305,7 @@ test-gnu-param-googletest:
stage: unit_test
dependencies:
- build-gnu-param
needs: ["build-gnu-param"]
script:
- export OMP_NUM_THREADS=2
- export OMP_PLACES=cores
......@@ -306,6 +316,7 @@ test-gnu-bin-param:
stage: bin_test
dependencies:
- build-gnu-param-py
needs: ["build-gnu-param-py"]
script:
- source cpp_sisso_gnu_param_py_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
......@@ -319,6 +330,7 @@ test-gnu-bin-base:
stage: bin_test
dependencies:
- build-gnu-py
needs: ["build-gnu-py"]
script:
- source cpp_sisso_gnu_py_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
......@@ -337,7 +349,7 @@ build-gnu-gcov:
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:`pwd`/cpp_sisso_gnu_gcov_env/lib/python3.7/site-packages/
- mkdir build_gcov/
- cd build_gcov/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_BUILD_TYPE="Coverage" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_gcov/ ../
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE="Coverage" -DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_gcov/ ../
- make install
- make coverage
- cd ../
......@@ -357,7 +369,7 @@ build-gnu-lcov:
- export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:`pwd`/cpp_sisso_gnu_lcov_env/lib/python3.7/site-packages/
- mkdir build_lcov/
- cd build_lcov/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_BUILD_TYPE="Coverage" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_lcov/ ../
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE="Coverage" -DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_lcov/ ../
- make install
- make coverage_html
- cd ../
......@@ -372,6 +384,7 @@ pages:
stage: doc_builds
dependencies:
- build-gnu-lcov
needs: ["build-gnu-lcov"]
script:
- source cpp_sisso_gnu_lcov_env/bin/activate
- export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7/:$LD_LIBRARY_PATH
......
......@@ -30,6 +30,10 @@ option(BUILD_PYTHON "Whether to compile with python binding support" ON)
option(BUILD_PARAMS "If true use non-linear parameterization" OFF)
option(BUILD_TESTS "Whether to compile with python binding support" OFF)
if(NOT ${EXTERNAL_BUILD_N_PROCS})
set(EXTERNAL_BUILD_N_PROCS "1")
endif()
if(BUILD_PARAMS)
message(STATUS "BUILD_PARAMS True")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPARAMETERIZE")
......@@ -59,14 +63,15 @@ if(EXTERNAL_BOOST)
message(STATUS "Using external boost")
set(EXTERNAL_BOOST TRUE)
else(EXTERNAL_BOOST)
if(NOT DEFINED BOOST_BUILD_N_PROCS)
set(BOOST_BUILD_N_PROCS 1 CACHE STRING "Number of processes to use when building Boost")
endif()
message(STATUS "Building boost wth ${BOOST_BUILD_N_PROCS} process(es)")
message(STATUS "Building boost wth ${EXTERNAL_BUILD_N_PROCS} process(es)")
include( ExternalProject )
set(EXTERNAL_BOOST FALSE)
endif()
if(NOT DEFINED EXTERNAL_BUILD_N_PROCS)
set(EXTERNAL_BUILD_N_PROCS 1 CACHE STRING "Number of processes to use when building Boost")
endif()
# Check for FindOpenMP
find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
......@@ -134,6 +139,19 @@ if(BUILD_PYTHON)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${PYTHON_EXECUTABLE}
-c "import numpy; print(numpy.__version__)"
OUTPUT_VARIABLE NUMPY_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(LENGTH "${NUMPY_VERSION}" NPV_LEN)
if(NPV_LEN EQUAL "0")
message(FATAL_ERROR "numpy must be installed")
else()
message(STATUS "numpy version ${NUMPY_VERSION} ${NPV_LEN} found")
endif()
message(STATUS "PYTHON_LIBDIR = ${PYTHON_LIBDIR}")
message(STATUS "PYTHON_INSTDIR = ${PYTHON_INSTDIR}")
......@@ -263,8 +281,8 @@ else(EXTERNAL_BOOST)
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${Boost_CONFIGURE_COMMAND}
BUILD_COMMAND
./b2 -j ${BOOST_BUILD_N_PROCS}
INSTALL_COMMAND ./b2 -j ${BOOST_BUILD_N_PROCS} install
./b2 -j ${EXTERNAL_BUILD_N_PROCS}
INSTALL_COMMAND ./b2 -j ${EXTERNAL_BUILD_N_PROCS} install
INSTALL_DIR ${Boost_INSTALL_DIR}
)
......@@ -272,42 +290,11 @@ else(EXTERNAL_BOOST)
set( Boost_LIBRARY_SUFFIX .so )
set( Boost_LIBRARY_PREFIX lib )
add_library( boost::mpi SHARED IMPORTED )
set_property( TARGET boost::mpi PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_mpi${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::mpi PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::mpi external_boost)
add_library( boost::serialization SHARED IMPORTED )
set_property( TARGET boost::serialization PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_serialization${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::serialization PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::serialization external_boost)
add_library( boost::system SHARED IMPORTED )
set_property( TARGET boost::system PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_system${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::system PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::system external_boost)
add_library( boost::filesystem SHARED IMPORTED )
set_property( TARGET boost::filesystem PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_filesystem${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::filesystem PROPERTY INTERFACE_LINK_LIBRARIES boost::system )
set_property( TARGET boost::filesystem PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::filesystem external_boost)
set(Boost_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_mpi${Boost_LIBRARY_SUFFIX})
list(APPEND Boost_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_serialization${Boost_LIBRARY_SUFFIX})
list(APPEND Boost_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_system${Boost_LIBRARY_SUFFIX})
list(APPEND Boost_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_filesystem${Boost_LIBRARY_SUFFIX})
if(BUILD_PYTHON)
add_library( boost::python${BOOST_PYTHON_VERSION} SHARED IMPORTED )
set_property( TARGET boost::python${BOOST_PYTHON_VERSION} PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_python${BOOST_PYTHON_VERSION}${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::python${BOOST_PYTHON_VERSION} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::python${BOOST_PYTHON_VERSION} external_boost)
add_library( boost::numpy${BOOST_PYTHON_VERSION} SHARED IMPORTED )
set_property( TARGET boost::numpy${BOOST_PYTHON_VERSION} PROPERTY IMPORTED_LOCATION ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_numpy${BOOST_PYTHON_VERSION}${Boost_LIBRARY_SUFFIX} )
set_property( TARGET boost::numpy${BOOST_PYTHON_VERSION} PROPERTY INTERFACE_LINK_LIBRARIES boost::system )
set_property( TARGET boost::numpy${BOOST_PYTHON_VERSION} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
add_dependencies(boost::numpy${BOOST_PYTHON_VERSION} external_boost)
set(Boost_PYTHON_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_python${BOOST_PYTHON_VERSION}${Boost_LIBRARY_SUFFIX})
list(APPEND Boost_PYTHON_LIBRARIES ${Boost_LIBRARY_DIRS}/${Boost_LIBRARY_PREFIX}boost_numpy${BOOST_PYTHON_VERSION}${Boost_LIBRARY_SUFFIX})
endif()
......@@ -390,8 +377,8 @@ message(STATUS "COIN_CLP_BLAS_LAPACK_LIBS = ${COIN_CLP_BLAS_LAPACK_LIBS}")
set(COIN_CLP_CONFIGURE_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/coin-Clp/clp_configure.sh ${COIN_CLP_INSTALL_DIR} ${COIN_CLP_BLAS_LAPACK_LIBS} ${COIN_CLP_CXX} ${COIN_CLP_LIBRARY_DIRS} "${COIN_UTILS_LIBRARY_DIRS}/libCoinUtils.so" ${COIN_UTILS_INCLUDE_DIRS})
set(COIN_UTILS_CONFIGURE_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/CoinUtils/coin_utils_configure.sh ${COIN_UTILS_INSTALL_DIR} ${COIN_CLP_BLAS_LAPACK_LIBS} ${COIN_CLP_CXX} ${COIN_CLP_LIBRARY_DIRS})
set(COIN_UTILS_MAKE_INSTALL_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/CoinUtils/coin_utils_make_install.sh ${COIN_UTILS_LIBRARY_DIRS}/libCoinUtils.so)
set(COIN_CLP_MAKE_INSTALL_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/coin-Clp/clp_make_install.sh ${COIN_CLP_LIBRARY_DIRS}/libClp.so)
set(COIN_UTILS_MAKE_INSTALL_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/CoinUtils/coin_utils_make_install.sh ${COIN_UTILS_LIBRARY_DIRS}/libCoinUtils.so ${COIN_UTILS_INCLUDE_DIRS})
set(COIN_CLP_MAKE_INSTALL_COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/cmake/coin-Clp/clp_make_install.sh ${COIN_CLP_LIBRARY_DIRS}/libClp.so ${COIN_CLP_INCLUDE_DIRS})
ExternalProject_Add(
external_CoinUtils
......@@ -399,7 +386,7 @@ ExternalProject_Add(
GIT_REPOSITORY "https://github.com/coin-or/CoinUtils.git"
GIT_TAG "releases/2.11.4"
CONFIGURE_COMMAND "${COIN_UTILS_CONFIGURE_COMMAND}"
BUILD_COMMAND make -j ${BOOST_BUILD_N_PROCS}
BUILD_COMMAND make -j ${EXTERNAL_BUILD_N_PROCS}
INSTALL_COMMAND "${COIN_UTILS_MAKE_INSTALL_COMMAND}"
BINARY_DIR "${COIN_UTILS_BUILD_DIR}"
INSTALL_DIR "${COIN_UTILS_INSTALL_DIR}"
......@@ -411,12 +398,12 @@ ExternalProject_Add(
GIT_REPOSITORY "https://github.com/coin-or/Clp.git"
GIT_TAG "releases/1.17.6"
CONFIGURE_COMMAND "${COIN_CLP_CONFIGURE_COMMAND}"
BUILD_COMMAND make -j ${BOOST_BUILD_N_PROCS}
BUILD_COMMAND make -j ${EXTERNAL_BUILD_N_PROCS}
INSTALL_COMMAND ${COIN_CLP_MAKE_INSTALL_COMMAND}
BINARY_DIR "${COIN_CLP_BUILD_DIR}"
INSTALL_DIR "${COIN_CLP_INSTALL_DIR}"
)
add_dependencies(external_Clp external_CoinUtils)
ExternalProject_Add_StepDependencies(external_Clp build external_CoinUtils)
set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY_DIRS}/libClp.so;${COIN_CLP_LIBRARY_DIRS}/libCoinUtils.so")
include_directories(${COIN_CLP_INCLUDE_DIRS})
......@@ -524,16 +511,22 @@ if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
EXECUTABLE make test
DEPENDENCIES ${COV_DEPS}
BASE_DIRECTORY "${CMAKE_SOURCE_DIR}/"
EXCLUDE "${CMAKE_BINARY_DIR}/" "src/external/*" "src/mpi_interface/*" "/usr/*" "${PYTHON_INCLUDE_PATH}/*" "${MPI_CXX_INCLUDE_DIRS}/*" "src/utils/mkl_*" "tests/*"
EXCLUDE "${CMAKE_BINARY_DIR}/" "src/external/*" "/usr/*" "${PYTHON_INCLUDE_PATH}/*" "${MPI_CXX_INCLUDE_DIRS}/*" "src/utils/mkl_*" "tests/*"
)
setup_target_for_coverage_gcovr_html(
NAME "coverage-gcov-html"
EXECUTABLE make test
DEPENDENCIES ${COV_DEPS}
BASE_DIRECTORY "${CMAKE_SOURCE_DIR}/"
EXCLUDE "${CMAKE_BINARY_DIR}/" "src/external/*" "src/mpi_interface/*" "/usr/*" "${PYTHON_INCLUDE_PATH}/*" "${MPI_CXX_INCLUDE_DIRS}/*" "src/utils/mkl_*" "tests/*"
EXCLUDE "${CMAKE_BINARY_DIR}/" "src/external/*" "/usr/*" "${PYTHON_INCLUDE_PATH}/*" "${MPI_CXX_INCLUDE_DIRS}/*" "src/utils/mkl_*" "tests/*"
)
else()
message(STATUS "Unable to build coverage target for the current compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
endif() #CMAKE_BUILD_TYPE STREQUAL "Coverage"
if(${CMAKE_VERSION} VERSION_LESS "3.15")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/bin/" "${CMAKE_INSTALL_PREFIX}/lib/" "${CMAKE_INSTALL_PREFIX}/tests/" "${NLOPT_INSTALL_DIR}" "${COIN_UTILS_INSTALL_DIR}" "${COIN_CLP_INSTALL_DIR}" "${GTEST_INSTALL_DIR}" "${FMT_INSTALL_DIR}")
else()
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/bin/" "${CMAKE_INSTALL_PREFIX}/lib/" "${CMAKE_INSTALL_PREFIX}/tests/" "${NLOPT_INSTALL_DIR}" "${COIN_UTILS_INSTALL_DIR}" "${COIN_CLP_INSTALL_DIR}" "${GTEST_INSTALL_DIR}" "${FMT_INSTALL_DIR}")
endif()
#! /usr/bin/bash
if [ ! -f $1 ]; then make install; fi
if [ ! -f $1 ] || [ ! -d $2 ]; then make install; fi
#! /usr/bin/bash
if [ ! -f $1 ]; then make install; fi
if [ ! -f $1 ] || [ ! -d $2 ]; then make install; fi
{
"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
"@type": "Code",
"author": [
{
"@id": "http://orcid.org/0000-0003-4564-7206",
"@type": "Person",
"email": "purcell@fhi-berlin.mpg.de",
"name": "Thomas A. R. Purcell",
"affiliation": "Fritz-Haber-Institute"
},
{
"@id": "http://orcid.org/0000-0001-5099-3029",
"@type": "Person",
"email": "luca@fhi-berlin.mpg.de",
"name": "Luca M. Ghiringhelli",
"affiliation": "Fritz-Haber-Institute"
},
{
"@id": "http://orcid.org/0000-0003-0635-8364",
"@type": "Person",
"email": "christian.carbogno@fhi-berlin.mpg.de",
"name": "Christian Carbogno",
"affiliation": "Fritz-Haber-Institute"
},
{
"@type": "Person",
"email": "scheffler@fhi-berlin.mpg.de",
"name": "Matthias Scheffler",
"affiliation": "Fritz-Haber-Institute"
}
],
"identifier": "",
"codeRepository": "https://gitlab.com/sissopp_developers/sissopp",
"datePublished": "2021-09-02",
"dateModified": "2021-09-02",
"dateCreated": "2021-09-02",
"description": "A C++ implementation of SISSO with python bindings",
"keywords": "SISSO, Symbolic Regression, C++, python",
"license": "Apache 2.0",
"title": "SISSO++",
"version": "v1.0.0"
}
......@@ -13,6 +13,13 @@ Features
node
node_utils
Non-Linearly Optimized Features
-------------------------------
.. toctree::
:maxdepth: 3
param_node
Feature Space
-------------
.. toctree::
......
......@@ -110,89 +110,3 @@ AbsNode
-------
.. doxygenfile:: absolute_value.hpp
:project: SISSO++
AddParamNode
------------
.. doxygenfile:: parameterized_add.hpp
:project: SISSO++
SubParamNode
------------
.. doxygenfile:: parameterized_subtract.hpp
:project: SISSO++
AbsDiffParamNode
----------------
.. doxygenfile:: parameterized_absolute_difference.hpp
:project: SISSO++
MultParamNode
-------------
.. doxygenfile:: parameterized_multiply.hpp
:project: SISSO++
DivParamNode
------------
.. doxygenfile:: parameterized_divide.hpp
:project: SISSO++
InvParamNode
------------
.. doxygenfile:: parameterized_inverse.hpp
:project: SISSO++
SqParamNode
-----------
.. doxygenfile:: parameterized_square.hpp
:project: SISSO++
CbParamNode
-----------
.. doxygenfile:: parameterized_cube.hpp
:project: SISSO++
SixPowParamNode
---------------
.. doxygenfile:: parameterized_sixth_power.hpp
:project: SISSO++
SqrtParamNode
-------------
.. doxygenfile:: parameterized_square_root.hpp
:project: SISSO++
CbrtParamNode
-------------
.. doxygenfile:: parameterized_cube_root.hpp
:project: SISSO++
ExpParamNode
------------
.. doxygenfile:: parameterized_exponential.hpp
:project: SISSO++
NegExpParamNode
---------------
.. doxygenfile:: parameterized_negative_exponential.hpp
:project: SISSO++
LogParamNode
------------
.. doxygenfile:: parameterized_log.hpp
:project: SISSO++
SinParamNode
------------
.. doxygenfile:: parameterized_sin.hpp
:project: SISSO++
CosParamNode
------------
.. doxygenfile:: parameterized_cos.hpp
:project: SISSO++
AbsParamNode
------------
.. doxygenfile:: parameterized_absolute_value.hpp
:project: SISSO++
Installation
---
The package uses a CMake build system, and compatible all versions of the C++ standard library after C++ 14.
You can access the code [here](https://gitlab.mpcdf.mpg.de/tpurcell/cpp_sisso/-/archive/master/cpp_sisso-master.tar.gz)
### Prerequisites
To install the sisso++ the following packages are needed:
To install `SISSO++` the following packages are needed:
- CMake version 3.10 and up
- A C++ complier (compatible with C++ 14 and later)
- A C++ compiler (compatible with C++ 14 and later, e.g. gcc 5.0+ or icpc 17.0+)
- BLAS/LAPACK
- MPI
Additionally the following packages will be installed if not currently and needed by SISSO++
Additionally the following packages needed by SISSO++ will be installed (if they are not installed already/if they cannot be found in $PATH)
- [Boost](https://www.boost) (mpi, serialization, system, filesystem, and python libraries)
- [GTest](https://github.com/google/googletest)
- [Coin-Clp](https://github.com/coin-or/Clp)
- [NLopt](https://github.com/stevengj/nlopt)
- [{fmt}](https://fmt.dev/latest/index.html) (Used for the C++ 20 [std::format](https://en.cppreference.com/w/cpp/utility/format/format) library)
To build the optional python bindings the following are also needed:
To build and use the optional python bindings the following are also needed:
- Python 3.6 or greater
- [Python 3.6 or greater](https://www.python.org/)
- [numpy](https://numpy.org/)
- [pandas](https://pandas.pydata.org/)
- [scipy](https://www.scipy.org/)
- [seaborn](https://seaborn.pydata.org/)
- [sklearn](https://scikit-learn.org/stable/index.html)
- [toml](https://pypi.org/project/toml/)
### Installation Settings
#### `BUILD_PARAMS`
If `BUILD_PARAMS` is ON then build the operators with non-linearly optimized scale and shift parameters, and the relevant optimization files
#### `BUILD_PYTHON`
The setup of the python environment can be done using anaconda with
If `BUILD_PYTHON` is ON then build the python bindings
#### `BUILD_TESTS`
If `BULD_TESTS` is ON then build GTest based tests
#### `EXTERNAL_BOOST`
If `EXTERNAL_BOOST` is ON then use the pre-built Boost Libraries currently in your path or in `$ENV{BOOST_ROOT}`
```bash
conda create -n sissopp_env python=3.9 numpy pandas scipy seaborn scikit-learn toml
```
### Installing `SISSO++`
......@@ -51,6 +47,7 @@ For example, here is `initial_config.cmake` file used to construct `SISSO++` and
set(CMAKE_CXX_COMPILER g++ CACHE STRING "")
set(CMAKE_C_COMPILER gcc CACHE STRING "")
set(CMAKE_CXX_FLAGS "-O3 -march=native" CACHE STRING "")
set(CMAKE_C_FLAGS "-O3 -march=native" CACHE STRING "")
#################
# Feature Flags #
......@@ -59,24 +56,21 @@ set(BUILD_PYTHON ON CACHE BOOL "")
set(BUILD_PARAMS ON CACHE BOOL "")
```
Here the `-O3` flag is for optimizations, it is recommended to stay as `-O3` or `-O2`, but it can be changed to match compiler requirements.
When building Boost from source (`EXTERNAL_BOOST OFF`) the number of processes used when building Boost may be set using the
`BOOST_BUILD_N_PROCS` flag in CMake. For example, to build Boost using 4 processes, the following flag should be included in the
`initial_config.cmake` file:
Because we want to build with the python bindings in this example and assuming there is no preexisting python environment, we need to first create/activate it.
For this example we will use `conda`, but standard python installations or virtual environments are also possible.
```
#set(BOOST_BUILD_N_PROCS 4 CACHE STRING "")
```bash
conda create -n sissopp_env python=3.9 numpy pandas scipy seaborn scikit-learn toml
conda activate sissopp_env
```
This flag will have no effect when linking against external boost, i.e. `EXTERNAL_BOOST ON`.
Now we can install `SISSO++` using `initial_config.cmake` and the following commands (this assumes gnu compiler and MKL are used, if you are using a different compiler/BLAS library change the flags to the relevant directories)
To install `SISSO++` using `initial_config.cmake` run the following commands (this assumes gnu compiler and MKL are used, if you are using a different compiler/BLAS library change the flags to the relevant directories)
```
```bash
export MKLROOT=/path/to/mkl/
export BOOST_ROOT=/path/to/boost
cd ~/SISSO++/main directory
cd ~/cpp_sisso/
mkdir build/;
cd build/;
......@@ -87,6 +81,118 @@ make install
Once all the commands are run `SISSO++` should be in the `~/SISSO++/main directory/bin/` directory.
### Install the Binary Without the Python Bindings
#### Install the Binary Without the Python Bindings
To install only the `SISSO++` executable repeat the same commands as above but set `USE_PYTHON` in `initial_config.cmake` to `OFF`.
#### Testing the Compilation