- Ubuntu 16 or newer
- C++14 compiler
- CMake 3.4 or newer
- Gcc 4.9 or newer (GCC 7.3.1 has a bug and won’t work)
- Boost 1.58 or newer
- ZeroMQ 4.1.4 or newer (if ZeroMQ support is needed)
- MPI-2 implementation (if MPI support is needed)
Note: Keep in mind that your CMake version should be newer than the boost version. If you have an older CMake, you may want an older boost version. Alternatively, you can choose to upgrade your version of CMake.
To set up your environment:
Install dependencies using apt-get.
sudo apt-get install libboost-dev sudo apt-get install libzmq5-dev
Make sure CMake and git are available in the Command Prompt. If they aren’t, add them to the system PATH variable.
Getting and building from source:
git cloneto to check out a copy of HELICS.
- Create a build folder. Run CMake and give it the path that HELICS was checked out into.
- Run “make”.
Notes for Ubuntu¶
Building with GCC 4.9 and 5.X on Ubuntu requires some additional flags due to the way Ubuntu builds those compilers
-DCMake_CXX_FLAGS="-D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH" to make it work.
If you built the compilers from source this may not be required.
git clone https://github.com/GMLC-TDC/HELICS cd HELICS mkdir build cd build CMake ../ cCMake . # optional, to change install path or other configuration settings make make install
A quick test is to double check the versions of the HELICS player and recorder:
cd /path/to/helics_install/bin $ helics_player --version x.x.x (20XX-XX-XX) $ helics_recorder --version x.x.x (20XX-XX-XX)
Building HELICS with python support¶
Run the following:
$ sudo apt-get install python3-dev $ CMake -DBUILD_PYTHON_INTERFACE=ON -DCMake_INSTALL_PREFIX=~/.local/helics-X.X.X/ .. $ make -j8 $ make install
Add the following to your
export PYTHONPATH=~/.local/helics-X.X.X/python:$PYTHONPATH export PATH=~/.local/bin:$PATH
Testing HELICS with python support¶
If you open a interactive Python session and import HELICS, you should be able to get the version of
helics and an output that is similar to the following.
$ ipython Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In : import helics In : helics.helicsGetVersion() Out: 'x.x.x (20XX-XX-XX)'