pyFAST can be installed using pip as follows, note however that you must have all the requirements installed for the package to work.
pip install pyfast
You can find examples on how to use FAST in python here.
The Python wrapper is a separate module which have to be enabled with the FAST_MODULE_Python CMake flag.
To build the Python wrappers you will need to install SWIG on your system. For Ubuntu linux you can install the SWIG package:
sudo apt-get install swig4.0
You also need python libs installed.
sudo apt-get install libpython3-dev # Python 3
CMake will try to automatically find SWIG on your system, and if it's found it will build the Python wrappers automatically. If CMake can't find SWIG after you installed it, set the SWIG_EXECUTABLE variable manually. On Ubuntu the executable is installed at /usr/bin/swig4.0.
The python module is integrated with numpy, thus requiring numpy to be installed:
# For both windows and linux: pip install numpy # For linux only: pip install pylddwrap
Make sure you have built the entire FAST framework first:
cmake --build . --config Release -j8
You may then build the target named _fast, which will build the FAST python bindings.
Building the target named python-wheel will create a python package, also a called a wheel in the folder build_folder/python/dist/
You can upload this package to pypi using twine:
twine upload -r testpypi pyFAST-xxxx.whl # For test pypi twine upload pyFAST-xxxx.whl # For pypi
For windows, you might get the error that numpy/arrayobject.h was not found. To fix this, create a symlink to the numpy include folder in the include folder of your python installation. To do this, open the command prompt with administration rights and type the following (assuming python is installed at C:\Python27):
mklink /D C:\Python27\include\numpy C:\Python27\Lib\site-packages\numpy\core\include\numpy
If you get several link errors like: "error LNK2019: unresolved external symbol __imp_PyType_IsSubtype referenced in function ...". Make sure you have downloaded the 64 bit version of python (see https:/
On windows the Python paths in CMake may have to be set manually: