SOWFA FAST compilation error

I am having difficulty compiling FAST as part of the SOWFA archive for use with the windPlantPisoSolverFAST on both ubuntu and OpenSUSE 11 linux environments. The errors for ubuntu and OpenSUSE, respectively:


gfortran -c …/FAST/Source/fastgetbldpos.f90 -o fastgetbldpos.o
gfortran -c …/FAST/Source/fastgetbldforce.f90 -o fastgetbldforce.o
gfortran Precision.o Sys.o NWTC_IO.o NWTC_Num.o NWTC_Aero.o NWTC_Library.o Blade.o Blades.o SharedInflowDefs.o HHWind.o FFWind.o FDWind.o CTWind.o UserWind.o InflowWindMod.o SharedTypes.o AeroMods.o GenSubs.o AeroSubs.o AeroDyn.o fftpack.o FFTMod.o HydroCalc.o FAST_Mods.o Noise.o FAST_IO.o FAST.o FAST_Lin.o FAST2ADAMS.o PitchCntrl_ACH.o UserSubs.o UserVSCont_KP.o AeroCalc.o SetVersion.o FAST_Prog.o fastinit.o fastrun.o fastend.o fastread.o fastgetbldpos.o fastgetbldforce.o -o FAST

/usr/lib/gcc/x86_64-linux-gnu/4.6.1/…/…/…/x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference to main’
collect2: ld returned 1 exit status
make: *** [FAST] Error 1

and

/usr/lib/…/lib64/crt1.o: In function _start': /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to main’
collect2: ld returned 1 exit status
make: *** [FAST] Error 1

I would greatly appreciate any guidance on this issue.

Thanks,
Jordan Wilson

Earlier, I sent an email regarding this issue. The messages are harmless and should compile SOWFA to the end.

However, I cleaned up the code and the make files to eliminate the messages in the newer version (SOWFA v1.0.1-alpha)

wind.nrel.gov/designcodes/simulators/sowfa/

-Sang

Hi,

==1==
I am having difficulty in compiling SOWFA.

The operating system is Ubuntu 12.04.1 LTS - 64-bit.
The version of OpenFOAM is 2.1.1.

==2==
The steps taken to compile SOWFA are:

  • Put “sowfa.tgz” under the user directory ( $WM_PROJECT_USER_DIR).
  • “tar -xvzf sowfa.tgz”
  • Rename the “sowfa” to the “kb8e10-2.1.1”
  • Run ./Allwclean
  • Run ./Allwmake

==3==
Nevertheless, I obtain a group of errors. The entire log file is as follows:
http://txtup.net/J9vxF

In short, I obtain FAST and windPlantPisoSolver errors.

==4==
In detail,
FAST

[code]…/FAST/Source/HydroCalc.f90:812.29:

  CALL RANDOM_SEED ( PUT=WaveSeed(1:2) )
                         1

Error: Size of ‘put’ argument of ‘random_seed’ intrinsic at (1) too small (2/12)
…/FAST/Source/HydroCalc.f90:2701.40:

USE Waves
1
Fatal Error: Can’t open module file ‘waves.mod’ for reading at (1): No such file or directory
…/FAST/Source/FAST_IO.f90:7256.60:

USE Waves, ONLY:WavePkShpDefault
1
Fatal Error: Can’t open module file ‘waves.mod’ for reading at (1): No such file or directory
…/FAST/Source/FAST.f90:1056.85:

                  FloatingPlatform, ONLY:AnchorTension, FairleadTension
                                                                       1          

Fatal Error: Can’t open module file ‘floatingplatform.mod’ for reading at (1): No such file or directory
…/FAST/Source/FAST_Lin.f90:46.49:

USE FASTsubs !Solver
1
Fatal Error: Can’t open module file ‘fastsubs.mod’ for reading at (1): No such file or directory
…/FAST/Source/FAST2ADAMS.f90:510.55:

USE FASTSubs !SetCoordSy
1
Fatal Error: Can’t open module file ‘fastsubs.mod’ for reading at (1): No such file or directory
…/FAST/Source/fastinit.f90:12.93:

          FAST_IO_Subs       ! Begin(), Input(), PrintSum(), RunTimes()
                                                                       1                  

Fatal Error: Can’t open module file ‘fast_io_subs.mod’ for reading at (1): No such file or directory
…/FAST/Source/fastrun.f90:8.89:

              FAST_IO_Subs       ! WrOutHdr(),  SimStatus(), WrOutput()
                                                                       1              

Fatal Error: Can’t open module file ‘fast_io_subs.mod’ for reading at (1): No such file or directory
…/FAST/Source/fastend.f90:12.93:

          FAST_IO_Subs       ! Begin(), Input(), PrintSum(), RunTimes()
                                                                       1                  

Fatal Error: Can’t open module file ‘fast_io_subs.mod’ for reading at (1): No such file or directory
ar: HydroCalc.o: No such file or directory
cp: cannot stat libfast.a': No such file or directory cp: cannot stat libfast.a’: No such file or directory[/code]

windPlantPisoSolver

windPlantPisoSolver.C:48:43: fatal error: horizontalAxisWindTurbinesALM.H: No such file or directory

==5==
Found the solution for the first FAST error, that is CALL RANDOM_SEED, ([url]http://forums.nrel.gov/t/compiling-fast-under-linux-with-gfortran/421/4]) although I’ve put it as it was just for completeness.

==6==
Many thanks for any help in advance.
//kuti

Hi,

==1==
I have made some attempts to solve the so-called compiling errors. Eventually, I made the “fastDuct” tutorial run.

==2==
For the FORTRAN warnings, I have replaced HydroCalc.f90 file with that from FAST v7.02.00d-bjj (27-February-2013) considering random_seed issue is solved.

==3==
With this, I start receiving 2 new errors even though the random_seed error disappeared.

[code]…/FAST/Source/HydroCalc.f90:3729.110:

displacement’, X0(4), X0(5), X0(6), TransMat0, ‘HydroDyn initialization’ )
1
Error: More actual than formal arguments in procedure call at (1)
…/FAST/Source/HydroCalc.f90:2648.84:

L SmllRotTrans ( ‘platform displacement’, X(4), X(5), X(6), TransMat, TRIM(Num2
1
Error: Function ‘num2lstr’ at (1) has no IMPLICIT type[/code]

==4==
Then, considering, in the previous files there were no ‘HydroDyn initialization’ or ‘TRIM(Num2’, I have deleted them and recompiled everything. With this, all FORTRAN-FAST errors have disappeared. (Might it resulted in more serious errors that did start not showing up.).

However, the compiling entire case still led to the problem:

make: *** No rule to make target `pisoFoam.dep', needed by `Make/linux64GccDPOpt/dependencies'. Stop.

==5==
So, I decided to do the compiling one by one by following the sequence in the “Allwmake” file.

==6==
i) src/finiteVolume
ii) src/turbineModels
iii) applications/utilities/setFieldsABL
iv) applications/solvers/windEnergy/ABLPisoSolver
v) applications/solvers/windEnergy/windPlantPisoSolver
vi) src/fastturb

are compiled without any error apart from a few warnings appeared from the last two cases.

==7==
i) src/openfast/bin

gave the first error.

cp: cannot create regular files for fastPisoSolver/fast/bin cp: cannot create regular files for windPlantPisoSolverFAST/fast/bin

Then, I have realized that there is no such sub-directories under both fastPisoSolver and windPlantPisoSolverFAST directories; that’s why, the “libfast.a” couldn’t be copied. Therefore, I have generated those directories and then “openfast” was compiled without any explicit errors.

==8==
Later, I have tried to compile “applications/solvers/windEnergy/fastPisoSolver”; but, it gave error.

Checking the directory, nor createFields.H neither pisoFoam.C was therein. Hence, I have modified pisoFoam original by looking at SOWFA_webinar_05-03-2012.pdf - Implementation - fastPisoSolver section.

The following http://txtup.co/lHjiX & http://txtup.co/RdIjP are the modified (!) pisoFoam.C and createFields.H, respectively.

In addition, I have copied “horizontalAxisWindTurbinesFAST.H” into the “fastPisoSolver” directory.

Finally, with these tweaks, fastPisoSolver was compiled.

==9==

i) applications/solvers/windEnergy/windPlantPisoSolverFAST was successfully compiled.

==10==
Lastly, I have run “fastDuct” tutorial for just 0.4 secs. It didn’t blow up.

==11==

Now, I assume that everything is fine; but, I am also pretty sure that this is not the right way of compiling the solvers.

Therefore, I kindly ask for some help to verify these procedures or some ideas why I couldn’t compile the solvers at the first time.

Many thanks in advance for any level of help.
//kuti

Hi Kuti,

I am following the same steps you used and suggested through this thread. Each of the solver runs fine (few warnings, as you mention), except for “applications/solvers/windEnergy/fastPisoSolver”. However, your fix yield some errors with pisoFoam.C

rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver$ wmake options:5:58: warning: backslash-newline at end of file [enabled by default] Making dependency list for source file pisoFoam.C SOURCE=pisoFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/turbulenceModels/incompressible/turbulenceModel -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/transportModels -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/transportModels/incompressible/ -IlnInclude -I. -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/pisoFoam.o In file included from pisoFoam.C:61:0: initContinuityErrs.H:33:29: warning: missing whitespace after the macro name [enabled by default] pisoFoam.C:85:3: error: invalid preprocessing directive #turbines In file included from pisoFoam.C:61:0: initContinuityErrs.H: In function ‘int main(int, char**)’: initContinuityErrs.H:37:1: error: expected ‘;’ before ‘scalar’ initContinuityErrs.H:37:29: warning: statement has no effect [-Wunused-value] pisoFoam.C:67:33: error: ‘turbfast’ was not declared in this scope In file included from pisoFoam.C:169:0: continuityErrs.H:40:5: error: ‘cumulativeContErr’ was not declared in this scope pisoFoam.C:184:5: error: ‘turbines’ was not declared in this scope readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] make: *** [Make/linuxGccDPOpt/pisoFoam.o] Error 1 rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver$ rmdepall removing all .dep files ... rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver$ wclean rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver$ cd fast/bin rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver/fast/bin$ rm * rm: cannot remove `*': No such file or directory rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver/fast/bin$ cd ../.. rp@rp-VirtualBox:/work/rp/OpenFOAM/rp-2.0.x/applications/solvers/windEnergy/fastPisoSolver$ wmake options:5:58: warning: backslash-newline at end of file [enabled by default] Making dependency list for source file pisoFoam.C SOURCE=pisoFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/turbulenceModels/incompressible/turbulenceModel -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/transportModels -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/transportModels/incompressible/ -IlnInclude -I. -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/work/rp/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/pisoFoam.o In file included from pisoFoam.C:61:0: initContinuityErrs.H:33:29: warning: missing whitespace after the macro name [enabled by default] initContinuityErrs.H: In function ‘int main(int, char**)’: initContinuityErrs.H:37:1: error: expected ‘;’ before ‘scalar’ initContinuityErrs.H:37:29: warning: statement has no effect [-Wunused-value] pisoFoam.C:67:33: error: ‘turbfast’ was not declared in this scope In file included from pisoFoam.C:169:0: continuityErrs.H:40:5: error: ‘cumulativeContErr’ was not declared in this scope pisoFoam.C:184:5: error: ‘turbines’ was not declared in this scope readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] make: *** [Make/linuxGccDPOpt/pisoFoam.o] Error 1

All the others can run now without problems, except this one.

In my bashrc file WM_PROJECT_USER_DIR is defined as:

However, when installing OpenFoam, I set it here:

Could that be a reason of why I’m having such an error?

Thanks in advance!
Ruben