Commit 3974cd19 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Installation Guide Updates per Chris' Comments

This should make things clearer for the user
parent 0f2c52b8
......@@ -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`
The setup of the python environment can be done using anaconda with
If `BUILD_PARAMS` is ON then build the operators with non-linearly optimized scale and shift parameters, and the relevant optimization files
#### `BUILD_PYTHON`
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,62 @@ 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`.
### Installation Settings for Basic Flags
#### `CMAKE_CXX_COMPILER`
The C++ compiler used to compile the code
#### `CMAKE_C_COMPILER`
The C compiler used to compile external dependencies (GTest and {fmt})
#### `CMAKE_CXX_FLAGS`
Define the flags used by the compiler to build the C++ source files. It is recommended to use `-O2` or `-O3` level of optimizations, but it can be changed to match the compiler.
#### `CMAKE_C_FLAGS`
Define the flags used by the compiler to build the C source files (GTest and {fmt}). It is recommended to use `-O2` or `-O3` level of optimizations, but it can be changed to match the compiler.
### Installation Settings
#### `BUILD_PARAMS`
Default: OFF
If `BUILD_PARAMS` is ON then build the operators with non-linearly optimized scale and shift parameters, and the relevant optimization files. With this flag on `NLopt`, [the parameterized operators](../cpp_api/param_node), and [the non-linear optimization](../cpp_api/nl_opt) classes will be built.
#### `BUILD_PYTHON`
Default: ON
If `BUILD_PYTHON` is ON then build the python bindings
#### `BUILD_TESTS`
Default: OFF
If `BULD_TESTS` is ON then build GTest based tests
#### `EXTERNAL_BOOST`
Default: OFF
If `EXTERNAL_BOOST` is ON then use the pre-built Boost Libraries currently in your path or in `$ENV{BOOST_ROOT}`
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:
```
#set(BOOST_BUILD_N_PROCS 4 CACHE STRING "")
```
This flag will have no effect when linking against external boost, i.e. `EXTERNAL_BOOST ON`.
We recommend to use `-DEXTERNAL_BOOST=OFF` if you are building the python bindings with an anaconda environment or if you are using non-standard C++ or MPI libraries. If the boost libraries have already been built with the same C++ compiler, MPI library, and Python environment, then `EXTERNAL_BOOST=ON` can be used.
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