CoolProp at its core is a C++ library, but it can be of interest to use this code base from other programming environments. For that reason, wrappers have been constructed for most of the programming languages of technical interest to allow users to seamlessly interface CoolProp and existing codebases.
There are also installer packages availbale on the page on installation packages.
Downloads and instructions for each wrapper are included in the page for the wrapper given in the table below.
|Static library||linux, OSX, win|
|Shared library (DLL)||linux, OSX, win||Included in the Windows installer|
|Python||linux, OSX, win||Wrapper is Cython based|
|Octave||linux, OSX, win||Wrapper is SWIG based|
|C#||linux, OSX, win||Wrapper is SWIG based|
|VB.net||windows only||Wrapper is SWIG based|
|MATLAB||linux, OSX, win||Wrapper is SWIG based|
|Java||linux, OSX, win||Wrapper is SWIG based|
|R||linux, OSX, win||Wrapper is SWIG based|
|Scilab||linux, OSX, win||Wrapper is SWIG based (experimental)|
|Julia||linux, OSX, win|
|Modelica||linux, OSX, win|
|PHP||linux, OSX, win||Mostly used on linux|
|Maple||linux, OSX, win||CoolProp is included in Maple 2016|
|SMath Studio||linux, OSX, win|
|FORTRAN||linux, OSX, win|
|EES||windows only||Included in the Windows installer|
|Microsoft Excel||windows only||Included in the Windows installer|
|Delphi & Lazarus||linux, OSX, win|
Common Wrapper Prerequisites¶
On all platforms for which CoolProp is supported, the compilation of one of the wrappers requires a few common prerequisites, described here. They are:
- git (to interface with the CoolProp repository at https://github.com/CoolProp/CoolProp)
- python (to generate the header files and convert them to binary file)
- CMake (platform-independent software to generate makefiles)
- C++ compiler
On Windows, download the newest binary installer for CMake from CMake downloads. Run the installer. Check that at the command prompt you can do something like:
C:\Users\XXXX>cmake -version cmake version 126.96.36.199
For git, your best best is the installer from http://msysgit.github.io/. Check that at the command prompt you can do something like:
C:\Users\XXXX>git --version git version 1.9.4.msysgit.0
For 7-zip, download the installer from http://www.7-zip.org/ . Check that at the command prompt you can do something like:
C:\Users\XXXX>7z 7-Zip  9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...] [<@listfiles...>]
For python, you should be using Anaconda/Miniconda for your python installation. Or, you can just install Miniconda, which is sufficient. You will also need to install the
six packages, which can be achieved by the following at a command prompt:
conda install pip six.
For the C++ compiler, the options are a bit more complicated. There are multiple (binary incompatible) versions of Visual Studio, as well as G++ ports for windows (MinGW). Unless you are compiling the python wrappers, you can compile with MinGW, so you should obtain the MinGW installer and run it. You should install all the packages available, and you MUST(!!) install to a path without spaces.
C:\MinGW is recommended as an installation path. Be sure to add the folder
C:\MinGw to your PATH variable.
If you want to build 64-bit extensions, you MUST install professional versions of visual studio, which can be obtained for free if you have a student ID card from Microsoft Dreamspark. You will require Visual Studio 2008 Professional for python 2.x, and Visual Studio 2010 Professional for python 3.x. Otherwise you can select Visual Studio version freely.
All three compilers should co-exist happily on the path, so you should be fine installing all three, but they are rather sizeable installs.
On debian based linux distributions (ubuntu, etc.), you can simply do:
sudo apt-get install cmake git g++ p7zip libpython-dev
git is probably already packaged with your operating system;
g++ probably isn’t. Python is (probably) included in your distribution, but the headers aren’t. For python, you need the
six package, a
pip install six should do it.
OSX should come with a c++ compiler (clang), for git and cmake your best bet is Homebrew. With Homebrew installed, you can just do:
brew install cmake git p7zip
OSX includes a python version, but you should be using Anaconda/Miniconda for your python installation. Or, you can just install Miniconda, which is sufficient. For python, you need the
six package, a
pip install six should do it.
If you have never done any command-line compilation before on OSX, chances are that you do not have the utilities needed. Thus you need to first install Xcode: see the description on the page http://guide.macports.org/#installing.xcode . After installing, you need to accept the license by running the following command in the Terminal:
and explicitly typing “agree” before closing. Then you can use the compiler from the command line.