This reposotory contains CMake files for building thermopack. The scripts are based on the fortran template by Seth Morton's cmake_fortran_template.
It is currently tested only with Intel FORTRAN 2020 and GNU FORTRAN on Ubuntu 20.04 and Windows 10 with Visual Studio 2019 and Intel FORTRAN 2020. When the scripts are properly tested, they will be integrated with the thermopack reposotory.
A FORTRAN compiler is required to run the CMake script and to compile the binaries. The script also requires that lapack/blas libraries are available, and a working python 3 interpreter.
thermopack_static
: Static thermopack libraythermopack
: Dynamic thermopack library used by pythonrun_thermopack
: Executable, running the program defined inthermopack/src/thermopack.f90
pycThermopack
: Set up the python packageqthermopack/addon/pycThermopack/pyctp
distclean
: Delete CMake files.
make all
will build the thermopack_static
, thermopack
, run_thermopack
and pycThermopack
targets.
It is preferred that you do an out-of-source build. To do this, create a build/
directory at the top level of your project and build there.
git clone https://github.com/morteham/thermopack_cmake.git
cd thermopack_cmake
cp -r cmake CMakeLists.txt distclean.cmake "path to thermopack"
cd "path to thermopack"
mkdir build
cd build
cmake ..
make all
To specific the compiler you can do as follows:
cmake .. -DCMAKE_Fortran_COMPILER=ifort
Lapack is not as easily accessable on Windows as on Linux, and must in many cases be downloaded and compiled. Assuming you are using Intel FORTRAN, you can generate makefiles for Lapack by running:
cmake .. -DCMAKE_Fortran_FLAGS="/real-size:64 /names:lowercase /iface:cref /assume:underscore"
Having compiled lapack, you can specify were thermopack can find the lapack and blas libraries:
cmake .. -DLAPACK_DIR="path to folder containing lapack.lib and blas.lib" -DBLA_STATIC=ON