Available Wrappers#

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 available 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.

Target

Operating Systems

Notes

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

Javascript

cross-platform

Works in all internet browsers

Labview

Windows only

Maple

linux, OSX, win

CoolProp is included in Maple 2016

Mathcad

Windows only

SMath Studio

linux, OSX, win

Mathematica

FORTRAN

linux, OSX, win

EES

Windows only

Included in the Windows installer

Microsoft Excel

Windows only

Included in the Windows installer

LibreOffice

Windows, linux

Delphi & Lazarus

linux, OSX, win

iOS (iPhone)

Android

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 CoolProp/CoolProp)

  • python (to generate the header files and convert them to binary file)

  • CMake (platform-independent software to generate makefiles)

  • C++ compiler

  • 7-zip

Windows#

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 2.8.12.2

For git, your best bet is the installer from https://git-scm.com/download/win. Check that at the command prompt you can do something like:

C:\Users\XXXX>git --version
git version 2.43.0.windows.1

For 7-zip, download the installer from https://www.7-zip.org/ . Check that at the command prompt you can do something like:

C:\Users\XXXX>7z

7-Zip [64] 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 pip and six packages, which can be achieved by the following at a command prompt: conda install pip six.

For the C++ compiler on Windows you have two mainstream options:

  • MinGW-w64 (a Windows port of GCC), most easily obtained via MSYS2: after installing it, run pacman -S mingw-w64-x86_64-gcc and add the mingw64\bin directory to your PATH. Install to a path without spaces.

  • Visual Studio — install the free Community edition with the “Desktop development with C++” workload.

Most users never need to compile the Python wrapper themselves, since pre-built CoolProp wheels are published on PyPI. If you do build from source, the old advice about matching a specific Visual Studio version to your Python version no longer applies: since Visual Studio 2015 the C runtime (UCRT) is stable, so any recent Visual Studio works.

Linux#

On debian based linux distributions (ubuntu, etc.), you can simply do:

sudo apt-get install cmake git g++ p7zip libpython3-dev

although 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#

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 https://guide.macports.org/#installing.xcode . After installing, you need to accept the license by running the following command in the Terminal:

xcodebuild -license

and explicitly typing “agree” before closing. Then you can use the compiler from the command line.