The latest version of this document is always available at https://thelfer.github.io/tfel/web/packages.html.

This document describes how to generate packages for TFEL. It relies on the instructions given here to build TFEL from the sources using the cmake build system.

Building portable binaries

The section is only meaningful if you wish to share the generated packages between various computers: it can be skipped if you only want to generate a package for you personal use.

The meaning of portable

By portable, we mean binaries that can be executed on machines:

However, using portable binaries does not affect the fact that MFront will try to generate the most effective code for you particular machine once installed. We rely on the fact that most compilers have an option to detect the current machine processor: for gcc and clang this option is -march=native. This option is still enabled when compiling libraries generated by MFront when using the --obuild option. This is why it is preferable to use portable binaries with the same compiler version that the one use to produce those binaries.

Special configuration option

We introduced an additional option to cmake named enable-portable-build to allow building a portable version of TFEL. This option must be added to the cmake command line:

$ cmake [options] -Denable-portable-build=ON

The various other options that can be passed to cmake are described here.

Generating packages

Basic steps

$ cmake [options] -Denable-portable-build=ON
$ make
$ cpack -G [GENERATOR_NAME]

The list of available generators are given by the cpack --help command:

$ cpack --help

On Debian wheezy, the following generators are avaiable:

List of components

Depending on the options provided to the cmake command and the generator used, various packages can be build:

Building debian packages

$ cmake ../trunk -DCMAKE_BUILD_TYPE=Release -Dlocal-castem-header=ON -Denable-fortran=ON -Denable-python=ON -Denable-python-bindings=ON -Denable-aster=ON -Denable-zmat=OFF -Denable-cyrano=ON -Denable-portable-build=ON
$ cpack -G DEB

Building RPM packages for Mageia (\(64\) bits)

$ cmake ../trunk -DCMAKE_BUILD_TYPE=Release -Dlocal-castem-header=ON -Denable-fortran=ON -Denable-python=ON -Denable-python-bindings=ON -Denable-aster=ON -Denable-zmat=OFF -Denable-cyrano=ON -Denable-portable-build=ON -DLIB_SUFFIX=64
$ cpack -G RPM

The LIB_SUFFIX is used to specify that the libraries must be place in the lib64 directory.

Building NSIS for Windows on LiNuX

If you have a cross-compiler (in the case of your example, mingw64) and the nsis package installed, one can build a Windows package like this:

$ cmake ../trunk -DCMAKE_BUILD_TYPE=Release -Dlocal-castem-header=ON -Denable-fortran=ON -Denable-python=OFF -Denable-python-bindings=OFF -Denable-aster=ON -Denable-zmat=OFF -Denable-cyrano=ON -DCMAKE_TOOLCHAIN_FILE=../trunk/cmake/ToolChain-i686-w64-mingw32.cmake -DCMAKE_INSTALL_PREFIX=/home/th202608/codes/tfel/tfel-2.0.x/install -Denable-portable-build=ON -Denable-static=ON
$ cpack -G NSIS

The enable-static portion is mandatory since the shared libraries associated with the cross compiler won’t be present on Windows.

One may use another cross-compiler by providing an appropriate tool-chain file.