This repository contains a CMake-based build system for the NIST REFPROP shared library (e.g., DLL) and a C/C++ wrapper for calling it. Wrappers are available in other languages at https://github.com/usnistgov/REFPROP-wrappers/.
NOTE: for Linux and macOS, you must compile REFPROP yourself, see: REFPROP-cmake
- Follow the conventional installation instructions for REFPROP.
- For Linux, compile REFPROP via REFPROP-cmake and copy the resulting
librefprop.solibrary file to the REFPROP installation directory. - Ensure that the system environment variable
RPprefixis set to the location of the REFPROP installation (e.g.,C:\Program Files (x86)\REFPROP). - Install CMake, version 3.22 or newer.
- Windows: https://cmake.org/download/
- Linux:
sudo apt install cmake
- Install Git, version 2.0 or newer.
- Windows: https://git-scm.com/downloads
- Linux:
sudo apt install git
- Install compilers and build tools.
- Windows: Install the Microsoft Visual C++ compiler (MSVC).
- Note: This compiler is included with the Visual Studio IDE and this step can be skipped if that is already installed.)
- Go to the Visual Studio download page (https://visualstudio.microsoft.com/downloads/).
- Under "Tools for Visual Studio", download "Build Tools for Visual Studio 20XX".
- Launch the installer and select the "C++ build tools" workload, ensuring that the MSVC compiler, Windows SDK and C++ Standard Library are included.
- Complete the installation.
- Linux:
sudo apt install build-essential
- Windows: Install the Microsoft Visual C++ compiler (MSVC).
- Either clone this repository, download as a ZIP file and extract the contents or download just the files in the
\exampledirectory.- The files in the
\exampledirectory can be used as a starting point for your project; however, they are not required to use the REFPROP wrapper. - As part of the build process, if only the example directory is downloaded, its
CMakeLists.txtfile contains a routine to download this repository's contents to a subfolder/external/refprop/.
- The files in the
- If not using the example files and the associated
CMakeLists.txtfile, add a call toadd_subdirectory(refprop)in your ownCMakeLists.txtfile, whererefpropis the path to the REFPROP wrapper directory. - Run CMake from this directory to generate the build files.
- For Visual Studio on Windows, this can be accomplished by either utilizing the
CMakePresets.jsonfile or creating and running the following batch file (e.g.,build.bat).rmdir /Q/S build_windows mkdir build_windows cd build_windows cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" .. pause - For Linux, the following shell script can be used (e.g.,
build.sh).#!/bin/bash rm -rf build_linux mkdir build_linux cd build_linux cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release .. make
- For Visual Studio on Windows, this can be accomplished by either utilizing the
- The
main.cppfile in the/srcdirectory in the example code shows how to call various REFPROP functions.
REFPROP can also be called using the header defining the library at: REFPROP-headers. This header includes functions for runtime loading of the DLL (shared library). Present there are also examples of how to use it and a CMake-based build system. This is an older approach that is not recommended for new projects.
Please file an issue at https://github.com/usnistgov/REFPROP-issues and we will get back to you as quickly as possible. Please don't email NIST staff directly, the only exception being if you have proprietary code that cannot be shared publicly.