You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
When setting CMake flag BUILD_SHARED_LIBS to ON, OpenFAST can't be built with MSVC and Intel Fortran compiler. Tested with MSVC 2015 and 2019 and ifort 18.0 and 19.0. The reason comes from the fact that DLLEXPORT is not defined for functions which need to be exported, so ifort is unable to produce .lib import libraries.
To Reproduce
Steps to reproduce the behavior:
Compile with MSVC and Intel Fortran compiler, no matter the version
See the link error, for example nwtclibs.lib not found even if nwtclibs.dll was compiled correctly.
Expected behavior
It should be possible to compile all libraries as DLLs using MSVC and Intel Fortran.
OpenFAST Version
2.2.0
**************************************************************************************************
OpenFAST
Copyright (C) National Renewable Energy Laboratory
Copyright (C) Envision Energy USA LTD
This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.
**************************************************************************************************
OpenFAST-v2.0.0
Compile Info:
- Architecture: 64 bit
- Precision: double
- Date: Nov 27 2018
- Time: 17:19:38
Execution Info:
- Date: 11/29/2018
- Time: 10:52:28-0700
System Information (please complete the following information):
OS: Windows 10 64
Compiler: MSVC 2019 and Intel Fortran Compiler 19.0
Compiler settings: BUILD_SHARED_LIBS set to ON
The text was updated successfully, but these errors were encountered:
On Windows (regardless of compiler), you need to explicitly state which routines can be called from within a DLL. None of the modules except MAP++ have been set up that way, so either the BUILD_SHARED_LIBS option should be removed or all of the modules need to have their source code modified to work this way. Personally, I would just remove that as a build option on Windows.
On Windows (regardless of compiler), you need to explicitly state which routines can be called from within a DLL.
Not exactly, this is only required with MSVC (and ifort on Windows since it relies on MSVC linker) to generate import librairies. MinGW does not require export definitions and as such works perfectly fine with the BUILD_SHARED_LIBS option.
I agree though that adding DLLEXPORT definitions to all functions which need to be exported would be quite long so it may be better to disable the option for MSVC.
Bug description
When setting CMake flag
BUILD_SHARED_LIBS
toON
, OpenFAST can't be built with MSVC and Intel Fortran compiler. Tested with MSVC 2015 and 2019 and ifort 18.0 and 19.0. The reason comes from the fact thatDLLEXPORT
is not defined for functions which need to be exported, so ifort is unable to produce .lib import libraries.To Reproduce
Steps to reproduce the behavior:
nwtclibs.lib not found
even if nwtclibs.dll was compiled correctly.Expected behavior
It should be possible to compile all libraries as DLLs using MSVC and Intel Fortran.
OpenFAST Version
2.2.0
System Information (please complete the following information):
BUILD_SHARED_LIBS
set toON
The text was updated successfully, but these errors were encountered: