OpenFAST / openfast

Main repository for the NREL-supported OpenFAST whole-turbine and FAST.Farm wind farm simulation codes.
http://openfast.readthedocs.io
Apache License 2.0
675 stars 455 forks source link

No CMAKE_Fortran_COMPILER could be found [Windows] #968

Closed alberto-bortoni closed 2 years ago

alberto-bortoni commented 2 years ago

new to openFast here.

Following the Documentation in THIS page, I downloaded the executables form the github page and, as per the highlighted note, downloaded the "Intel Fortran Compiler 19.1 for Windows" THIS site.

After I ran the .msi file to install the Fortran compiler it added the files listed at the bottom. When I open VS I get the following error:

CMake Error at C:\Users\...\openFast-source\CMakeLists.txt:18 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.

My problem is I seem not to know what ...to the full path to the compiler means. I tried adding a windows environment variable FC with the value equal to the path to the "compiler" directory listed below, but that failed. I am not sure if I should set the variable to a specific file in the list below. Or maybe I am heading in the wrong direction all together.

I would appreciate any guidance =). BEST!

I am using:

C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\

compiler
    |_1033
            |_ ifcore_msg.dll
            |_ irc_msg.dll
            |_ libmUI.dll
    |_ 1041
            |_ ifcore_msg.dll
            |_ irc_msg.dll
            |_ libiomp5ui.dll
            |_ libmUI.dll
    |_ cilkrts20.dll
    |_ cilkrts20.pdb
    |_ ifdlg100.dll
    |_ libchkp.dll
    |_ libicaf.dll
    |_ libifcoremd.dll
    |_ libifcoremdd.dll
    |_ libifcorert.dll
    |_ libifcorertd.dll
    |_ libifportmd.dll
    |_ libiomp5md.dll
    |_ libiomp5md.pdb
    |_ libiompstubs5md.dll
    |_ libirngmd.dll
    |_ libmmd.dll
    |_ libmmd.pdb
    |_ libmmdd.dll
    |_ libmmdd.pdb
    |_ svml_dispmd.dll
    |_ svml_dispmd.pdb

mprint
    |_ cpuinfo.exe
    |_ fi_info.exe
    |_ fi_pingpong.exe
    |_ hydra_bstrap_proxy.exe
    |_ hydra_pmi_proxy.exe
    |_ hydra_service.exe
    |_ IMB-MPI1.exe
    |_ IMB-NBC.exe
    |_ IMB-RMA.exe
    |_ impimt.dll
    |_ libfabric.dll
    |_ libmpi_ilp64.dll
    |_ mpiexec.exe
bjonkman commented 2 years ago

If you've downloaded the OpenFAST binaries for Windows and installed the appropriate redistributable libraries from the links you showed, you don't need to build anything. You should be able to run OpenFAST without using cmake or Visual Studio using the files you have. At a command prompt, you can type openfast_x64.exe filename.fst where filename.fst is the name of the primary OpenFAST input file. There are examples of OpenFAST models in the r-test directory.

The link you show to the redistributable library is not the Fortran compiler itself; it is just some of its libraries that help you run the already compiled binary executable files. So if you DO want to build the code yourself, you will have to download and install the entire Fortran compiler. I'd recommend using Intel's Fortran compiler, which is now free (for use in open-source research). But again, you don't have to build anything if you just want to run the executables you downloaded from the GitHub Releases page.

alberto-bortoni commented 2 years ago

Thank you so much! The first solution is what I am after =) I may have interpreted the documentation wrong. I don't think I need to build the code for my application. BEST