Compiling FAST/FAST S function on Linux x86_64

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).

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

    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 (140 KB)

Hi Jesper,

I have been trying to follow your guide to compiling FAST in a Linux 64 bit system and am being met with the follow error when trying to run the patches:

[code]ubuntu@ubuntu:~/Desktop/fast_build$ patch -p1 -d nwtc < nwtc.patch
can’t find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

|diff -ru nwtc.orig//Source/SysGnu.f90 nwtc//Source/SysGnu.f90
|— nwtc.orig//Source/SysGnu.f90 2012-02-28 11:25:03.729047175 +0100

+++ nwtc//Source/SysGnu.f90 2012-03-06 13:04:06.056930157 +0100
File to patch: Skip this patch? [y][/code]

I have ran your other code script to convert the files to Unix format already.
I am extremely new to using Linux, so forgive me if this is a rudimentary question, but I cannot seem to find a solution online. Hope you can help,

Thanks,
Luke Cunningham