Compiling DISCON.F90 on Linux

Greetings,

I am in the process of setting up openFAST on a Linux based cluster, and I am facing some problems in trying to compile the DISCON.F90 file using gfortran for Linux. I am using gcc version 4.9.3.

In the terminal, I navigate to the location of the DISCON.F90 source file, and then I type -

gfortran DISCON.F90 -o DISCON.dll , but I get the following error :

DISCON.F90:18:0: warning: \u2018dllexport\u2019 attribute directive ignored [-Wattributes]
SUBROUTINE DISCON ( avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG ) BIND (C, NAME=‘DISCON’)
^
/lib/…/lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main’
collect2: error: ld returned 1 exit status

Apologies if this has already been asked before, I was not able to find it.

I would be very grateful for help in this matter. Thanks in advance.

Best regards,
Vishal

You need to tell it to build a shared library, otherwise it thinks it is a standalone executable that needs a main() routine. Try

gfortran DISCON.F90 -shared -DIMPLICIT_DLLEXPORT -o DISCON.dll

(Or maybe you want a different file extension for linux?)

Alternatively, the DLLs can be built using cmake. See github.com/openfast/r-test#note … line-cases

Dear Bonnie,

Thank you, that fixed the problem!

Best regards,
Vishal