Fortran compiler not found when configuring

2k views Asked by At

I am trying to install some code on my Mac (10.15.7). I follow the instructions and do

./waf configure --install_all_deps

But I get

No suitable fortran compiler found (cause: 'cannot determine ifort version.
(complete log in /Users/joe/Documents/Research/code/plc_3.0/plc-3.01/build/config.log)') 
The configuration failed
(complete log in /Users/joe/Documents/Research/code/plc_3.0/plc-3.01/build/config.log)

which ifort gives

/usr/local/bin/ifort

And ifort -v gives

ifort version 19.1.1.216

The last part of the referenced config.log is

Checking for program 'ifort'
/opt/anaconda3/envs/py38/bin/x86_64-apple-darwin13.4.0-gfortran
find program=['ifort'] paths=['/opt/anaconda3/envs/py38/bin', '/opt/anaconda3/condabin', '/Library/Frameworks/Python.framework/Versions/3.8/bin', '/usr/local/bin', '/opt/local/bin', '/Users/joe/Documents/Research/openmpi-3.0.0/oshmem/mca/scoll/mpi/bin', '/opt/local/bin', '/opt/local/sbin', '/usr/local/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin', '/Library/TeX/texbin', '/Library/Apple/usr/bin'] var='FC' -> ['/opt/anaconda3/envs/py38/bin/x86_64-apple-darwin13.4.0-gfortran']
['/opt/anaconda3/envs/py38/bin/x86_64-apple-darwin13.4.0-gfortran', '-logo']
err: ld: library not found for -logo
collect2: error: ld returned 1 exit status

from /Users/joe/Documents/Research/code/plc_3.0/plc-3.01: cannot determine ifort version.
from /Users/joe/Documents/Research/code/plc_3.0/plc-3.01: The configuration failed

1

There are 1 answers

2
neuro On

the log says different things:

  • waf looked for ifort in your default paths:

    • /opt/anaconda3/envs/py38/bin
    • /opt/anaconda3/condabin
    • /Library/Frameworks/Python.framework/Versions/3.8/bin
    • /usr/local/bin
    • /opt/local/bin
    • [...]
  • waf has found a fortran compiler, actually /opt/anaconda3/envs/py38/bin/x86_64-apple-darwin13.4.0-gfortran, but when executing it, it can't find a library, libogo. It found it at the wrong place, because /usr/local/bin is after /opt/anaconda3/envs/py38/bin in the paths list.

To change the paths list, you can use the parameter path_list of the find_program function in the waf file named wscript.

But a simpler way is probably to change the PATH when calling waf:

PATH="/usr/local/bin:$PATH" ./waf configure --install_all_deps