# Compiling FAST/FAST S function on Linux x86\_64

**URL:** <https://forums.nlr.gov/t/compiling-fast-fast-s-function-on-linux-x86-64/462>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [March 6, 2012, 1:14pm UTC](https://forums.nlr.gov/t/compiling-fast-fast-s-function-on-linux-x86-64/462 "2012-03-06T13:14:19Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Jesper.Larsen](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@Jesper.Larsen](https://forums.nlr.gov/u/Jesper.Larsen)\
**Post date:** [March 6, 2012, 1:14pm UTC](https://forums.nlr.gov/t/compiling-fast-fast-s-function-on-linux-x86-64/462/1 "2012-03-06T13:14:19Z")

</div>

Dear all

I managed to get FAST and the Simulink S function compiled for my 64bit Ubuntu distro. I would like to share the work, as it took me a while to get everything working.  
The builds are tested on Ubuntu/Xubuntu 11.10 64bit and with Matlab 2012a and 2011a.

I used the GNU fortran compiler, and it seems like you need at least 4.6.1 (Provided in the 11.10 \*ubuntu distros). The build is done using the sources for FAST, AeroDyn and NWTC Lib that were released on the 16th Feb. 2012.

I have attached a tar ball with Makefiles, patches etc. The Makefiles are setup to compile FAST with a BladedSO interface with a dynamically linked DISCON.so file. This interface is the work of Stefano Cottafavi (see [stefanocottafavi.com/?p=360](http://www.stefanocottafavi.com/?p=360)).

The dynamically linked DISCON.so was tested with the DISCON.f90 file included in the 5MW reference wind turbine.

Steps to compile FAST, FAST S function and DISCON.so

1. Download sources for FAST, AeroDyn and NWTC Subroutine Library.
2. Create a folder for the sources, ex: ~/fast\_build
3. Extract the sources like so  
FAST → ~/fast\_build/fast  
AeroDyn → ~/fast\_build/aero  
NWTC Lib → ~/fast\_build/nwtc
4. Extract the attached tar ball fast\_build.tar in ~/fast\_build/
5. Apply the two patches in the folder

` cd ~/fast_build/
    patch -p1 -d nwtc < nwtc.patch
    patch -p1 -d fast < fast.patch`  
6. If the patches doesn’t apply, you might need to convert the source files from windows line endings to unix line endings. This can be done by the dos2unix tool.

` dos2unix nwtc/Source/*
    dos2unix fast/Source/*
    dos2unix fast/Simulink/Source/*`  
7. If you are compiling the S function you need to change the MATLAB\_DIR in the file ~/fast\_build/Makefile to your Matlab installation. (Default is /opt/matlab)  
8. To compilee FAST, FAST S function and a dummy DISCON.so file run

```auto
    make
```

```
Or to compile them individually

```

[code] make FAST  
make FAST\_SFunc.mexa64  
make DISCON.so[code]

I hope this is to some use.

Sincerly, Jesper  
[fast\_build.tar](https://forums.nlr.gov/uploads/short-url/IYAjv8q8B40FAnvtNYPWymapuU.tar) (140 KB)

---

_[View the full topic](https://forums.nlr.gov/t/compiling-fast-fast-s-function-on-linux-x86-64/462)._
