Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fortran sources but no Fortran compiler found

I'm trying to install pyOpt in Python and I got this error :

error: library algencan has Fortran sources but no Fortran compiler found

I'm using Anaconda on windows 7, I tried to install "Microsoft Visual C++ Compiler for Python 2.7", but I got the same error.

like image 349
mounir ben salem Avatar asked Mar 27 '16 17:03

mounir ben salem


People also ask

How do I install a Fortran compiler?

The gfortran compiler is part of the standard “gcc” compiler package, and may be pre-installed on recent unix systems. Check the version using “gfortran –version”. To install from the standard repository use: “sudo apt-get update; sudo apt-get install gfortran”

How do I add Gfortran to my path?

To add it go to Start>; right click Computer and select Properties; go to Advanced System Settings; select the Advanced tab; select Environment Variables (the bottom one); scroll down in the bottom menu until you find the Path variable and then add the MinGW\bin directory at the end (be careful not to delete your ...


1 Answers

You should install a Fortran compiler, e.g. gfortran (via MinGW/Cygwin on Windows). See here for details. A C++ compiler won't help here.

MinGW includes gfortran as part of the distribution, with Cygwin, you need to install the package gcc-fortran.

After the installation, add the path to its binary to the system PATH.

Alternatively, you can purchase a commercial Fortran Compiler, e.g. from Intel.

like image 157
Alexander Vogt Avatar answered Sep 20 '22 14:09

Alexander Vogt