Installation issue -> gcc : "C compiler cannot create executable"

Dear,


I encountered some issue with the C-compiler (gcc) while installing a program. It says that it cannot create executables and then crash the process.

Here is the full message i get :

-------

(...)

cd spglib-1.5.2;\

./configure FC=gfortran CC=gcc CFLAGS=-fopenmp FCFLAGS=-fopenmp;\

cd /Users/Gagriel/bandup-master2/src/external

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... ./install-sh -c -d

checking for gawk... no

checking for mawk... no

checking for nawk... no

checking for awk... awk

checking whether make sets $(MAKE)... yes

checking for gcc... gcc

checking whether the C compiler works... no

configure: error: in `/Users/Gagriel/bandup-master2/src/external/spglib-1.5.2':

configure: error: C compiler cannot create executables

See `config.log' for more details

cd spglib-1.5.2;\

/Applications/Xcode.app/Contents/Developer/usr/bin/make -j --max-load 2.5;\

cd /Users/Gagriel/bandup-master2/src/external

make[1]: *** No targets specified and no makefile found. Stop.

----------


Here are the versions of the softwares i used :

-MacOs Hight-Sierra (10.13.6)

-Xcode (10.1)

And for the gcc :

------

Gagriel$ gcc --version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 10.0.0 (clang-1000.11.45.5)

Target: x86_64-apple-darwin17.7.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

-------


Here is also the problem pointed in the config.log file :


------

(....)

Apple LLVM version 10.0.0 (clang-1000.11.45.5)

Target: x86_64-apple-darwin17.7.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

configure:3033: $? = 0

configure:3022: gcc -V >&5

clang: error: argument to '-V' is missing (expected 1 value)

clang: error: no input files

configure:3033: $? = 1

(....)

--------


I looked after some solutions on the internet without finding a suitable answer.

As my problem is very similar to the one encountered by another user, i also link you his issue posted on an Homebrew forum... but without satisfying resolution (https://github.com/Homebrew/homebrew-core/issues/32339).


I already tried a variety of methods (such as install/reinstall Xcode ; check the upgrades of every softwares involved; set the command line tool in Xcode; accept the Xcode licence; redo all the operations on a MacOS mojave 10.14.6 with higher versions of everything ...) and i am stuck with the exact same error.


Does someone know anything about this ?


Thanks for your help


Best,

Gabriel Closset

Replies

You are building with both gfortran and OpenMPI. Xcode is not going to work out of the box with those two. Xcode's clang compiler includes a GCC compatibility mode, but that compatiblity mode does not cover Fortran or OpenMP. You will need to do some research. It is possible to build with both of these in recent versions of Xcode, but it is something that is very sensitive to updates to both the operating system and Xcode.