cura-build-environment icon indicating copy to clipboard operation
cura-build-environment copied to clipboard

No CMAKE_Fortran_COMPILER could be found

Open arnav257 opened this issue 5 years ago • 4 comments

Upon entering 'cmake ..', I get the following error message:

-- The Fortran compiler identification is unknown CMake Error at CMakeLists.txt:2 (project): No CMAKE_Fortran_COMPILER could be found.

-- Configuring incomplete, errors occurred! See also "C:/Users/anous/MultiNest/build/CMakeFiles/CMakeOutput.log". See also "C:/Users/anous/MultiNest/build/CMakeFiles/CMakeError.log"

When I open the CMakeError.log file, here's what I find: Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed. Compiler:
Build flags: Id flags:

How do I resolve this? I was trying to use cmake to install MultiNest using these instructions.

Can't seem to get it to work. I'm not sure what other information I can give but please do ask whatever you need to help me resolve this issue.

arnav257 avatar May 17 '20 19:05 arnav257

One of Cura's dependencies needs a Fortran 95 compiler to be built (Scipy).

So the way to solve this would be to install a Fortran compiler, like GNU Fortran. There are binary distributions here. Some operating systems also have this in their package distributions (it's apt install gfortran for me), but for you the easiest way would probably be to install it via the MinGW installer, which you're going to need anyway.

Ghostkeeper avatar May 19 '20 13:05 Ghostkeeper

So the way to solve this would be to install a Fortran compiler, like GNU Fortran.

I'm using Windows and I tried installing the Intel Fortran Compiler, but I still can't seem to make make treat that as a Fortran compiler. I tried the set() function in the CMakeLists.txt file, not sure what else I can do.

arnav257 avatar May 19 '20 13:05 arnav257

Rather than modifying the CMakeLists.txt file, use CMake-GUI to modify those variables. The CMake interface has this little "advanced" toggle. If you click that you'll be able to see a whole lot more variables you can change, among which the Fortran compiler.

Ghostkeeper avatar May 22 '20 10:05 Ghostkeeper

Perhaps it's also better to delete your cache and generate the cache anew. It should automatically find your Fortran compiler.

Ghostkeeper avatar May 22 '20 10:05 Ghostkeeper