1

I'm trying to install Quantum ESPRESSO on my computer and have run into an issue when using the ./configure command in the unpacked directory.

$ ./configure 
checking build system type... x86_64-apple-darwin21.2.0
checking ARCH... mac686
checking setting AR... ... ar
checking setting ARFLAGS... ... ruv
checking for gfortran... gfortran
checking whether the Fortran compiler works... no
configure: error: in `/Users/myname/winter/q-e-qe-6.8':
configure: error: Fortran compiler cannot create executables
See `config.log' for more details

I just updated to macOS Monterey and have GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0 installed.

When trying to debug this, I looked at the config.log file and looked at similar googled questions. They all point me to updating or reinstalling things, like gcc, which I subsequently did.

Does the problem have to do with this:

$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I can see that the version is 4.2.1, but I'm unaware of what Apple clang is. Is it a PATH issue?

I'd appreciate any help.

P.S. Please choose to be kind in responses.

Here is part of the config.log:

Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Homebrew GCC 11.2.0_3)
configure:2542: $? = 0
configure:2531: gfortran -V >&5
gfortran: error: unrecognized command-line option '-V'
gfortran: fatal error: no input files
compilation terminated.
configure:2542: $? = 1
configure:2531: gfortran -qversion >&5
gfortran: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gfortran: fatal error: no input files
compilation terminated.
configure:2542: $? = 1
configure:2557: checking whether the Fortran compiler works
configure:2579: gfortran    conftest.f  >&5
clang: error: invalid version number in '-mmacosx-version-min=12.1'
configure:2583: $? = 1
configure:2621: result: no
configure: failed program was:
|       program main

For reference:

$ gfortran --version
GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.```
  • Welcome, I suggest takingbthe [tour]. If you suspect a path issue, then what isnyour `$PATH`? In wich paths did you install your versions? Your question does not appear to have anything with Fortran. – Vladimir F Героям слава Dec 22 '21 at 06:48
  • But the version of your clang printed above is 11.0. And it was compiled bu Apple with gcc 4.2.1. What is your real problem you need to solve? – Vladimir F Героям слава Dec 22 '21 at 06:49
  • I don't have experience editing or looking up what a $PATH is on my terminal. A forum I read suggested it could be the source to the problem I am asking about. My question is how to deal with the error message "Fortran compiler cannot create executables." I don't know what Apple clang is. Am I interpreting you correctly: Apple compiled a program called "clang" with gcc? To repeat for clarity, I don't know how to configure the files in my unpacked quantum ESPRESSO version, because I get the error message. I tried to show what research I did about the problem by providing the above. – at_the_beginning Dec 22 '21 at 18:57
  • But you did not mention the error message! You have to show the exact full error message and the exact steps you are executing. Are you able to compile anything with gfortran at all? What does `gfortran -v` say? Please be aware that this is a programming site, not a support site for your software. Show us what is in `config.log`. – Vladimir F Героям слава Dec 22 '21 at 19:04
  • I thought you put the question in the title; the error is in the title. I also provided the version of my gfortran in my original statement, but I added a reference for clarity. I only tried the step ./configure and got the error. – at_the_beginning Dec 22 '21 at 23:22

1 Answers1

2

I had the same issue and I solved by doing the following:

  1. Removing the old tools ($ sudo rm -rf /Library/Developer/CommandLineTools).

  2. Installing xcode command line tools again ($ xcode-select --install).

It was retrieved from: How to update Xcode from command line

wohlstad
  • 12,661
  • 10
  • 26
  • 39
Yasu Ito
  • 21
  • 2