Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building openfast in Windows visual studio #492

Closed
tchatte3 opened this issue Jul 14, 2020 · 3 comments
Closed

Building openfast in Windows visual studio #492

tchatte3 opened this issue Jul 14, 2020 · 3 comments
Assignees

Comments

@tchatte3
Copy link

Hi openfast team,

In context of #480, I forked openfast repository #373 and I am trying to build it on Windows using Visual studio. I am new to Visual studio and still learning the basics of it. When building using cmake I get the following errors

1> Command line: c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\commonextensions\microsoft\cmake\CMake\bin\cmake.exe  -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\212800784\CMakeBuilds\21597852-26ce-9337-8c85-7c433ed3ae54\install\x64-Debug (default)"  -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe" "C:\Users\212800784\Documents\GitHub\openfast"
1> Working directory: C:\Users\212800784\CMakeBuilds\21597852-26ce-9337-8c85-7c433ed3ae54\build\x64-Debug (default)
1> -- Configuring incomplete, errors occurred!
1> See also "C:/Users/212800784/CMakeBuilds/21597852-26ce-9337-8c85-7c433ed3ae54/build/x64-Debug (default)/CMakeFiles/CMakeOutput.log".
1> CMake Error at C:\Users\212800784\Documents\GitHub\openfast\CMakeLists.txt:18 (project):
1>   The Ninja generator does not support Fortran using Ninja version
1> 
1>     1.8.2
1> 
1>   due to lack of required features.  Kitware has implemented the required
1>   features but as of this version of CMake they have not been integrated to
1>   upstream ninja.  Pending integration, Kitware maintains a branch at:
1> 
1>     https://github.com/Kitware/ninja/tree/features-for-fortran#readme
1> 
1>   with the required features.  One may build ninja from that branch to get
1>   support for Fortran.
1> 
1> 
1> CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage
1> c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\commonextensions\microsoft\cmake\CMake\bin\cmake.exe  -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\212800784\CMakeBuilds\21597852-26ce-9337-8c85-7c433ed3ae54\install\x64-Debug (default)"  -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe" "C:\Users\212800784\Documents\GitHub\openfast" returned with exit code: 1
CMake Error at CMakeLists.txt:18 (project):
  The Ninja generator does not support Fortran using Ninja version
    1.8.2
  due to lack of required features.  Kitware has implemented the required
  features but as of this version of CMake they have not been integrated to
  upstream ninja.  Pending integration, Kitware maintains a branch at:
    https://github.com/Kitware/ninja/tree/features-for-fortran#readme
  with the required features.  One may build ninja from that branch to get
  support for Fortran.
CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage

It seems the problem is related to fortran compiler, but I am not sure, if there is a better fix or I need to clone the kitware branch and build ninja.

Any help or guidance regarding this matter.

I looked at a similar issue #152, but seems like my errors are compiler configuration related.

Best Regards,

@andrew-platt
Copy link
Collaborator

andrew-platt commented Jul 14, 2020

#373 has now been merged into /dev.

I'm not entirely sure about building with Ninja. Perhaps @rafmudaf has some insights here.

@rafmudaf
Copy link
Collaborator

Ninja works on linux and mac, but I haven't tried for Windows. Your best bet is to use the Visual Studio generators.
You may want to do some background reading on using CMake with Visual Studio so that you understand which components and software you need to install. Here's a link to get you started: https://cognitivewaves.wordpress.com/cmake-and-visual-studio/

Also, I have a small project that automates compiling this stuff on Windows: https://github.com/rafmudaf/automate_openfast.
BEWARE: this is a tool I built to help myself, so it may be buggy and probably won't work out of the box you. If you use it, be sure to read all the code to ensure its properly configured for your use.

@tchatte3
Copy link
Author

@rafmudaf I see your point. Thanks for the detailed guidance. This helps.

@rafmudaf rafmudaf self-assigned this Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants