Home > Software design >  SPheno-4.0.5 make command not running (MacOS)
SPheno-4.0.5 make command not running (MacOS)

Time:10-10

In my work I am using a Fortran based program called SPheno. Having SPheno-4.0.4 installed, I tried to install the new version SPheno-4.0.5, however, when selecting F90 = gfortran in the Makefile, just as I did on my working SPheno-4.0.4 version, it returns me the following error:

cd src ; /Library/Developer/CommandLineTools/usr/bin/make F90=gfortran version=400.00
gfortran -c -O -J../include -I../include  -DGENERATIONMIXING  -DONLYDOUBLE Control.F90
ar  ../lib/libSPheno.a Control.o
/Library/Developer/CommandLineTools/usr/bin/ar: illegal option -- .
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
make[1]: *** [../lib/libSPheno.a(Control.o)] Error 1
make: *** [bin/SPheno] Error 2

What does this error even mean, and what do I have to change? I even tried to copy/paste the Makefile from SPheno-4.0.4, just to check.

In case it matters, when running the command gfortran -v it returns me:

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/11.2.0/libexec/gcc/x86_64-apple-darwin19/11.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --prefix=/usr/local/Cellar/gcc/11.2.0 --libdir=/usr/local/Cellar/gcc/11.2.0/lib/gcc/11 --disable-nls --enable-checking=release --enable-languages=c,c  ,objc,obj-c  ,fortran,d --program-suffix=-11 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd --with-pkgversion='Homebrew GCC 11.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-libphobos --build=x86_64-apple-darwin19 --with-system-zlib --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Homebrew GCC 11.2.0)

The Makefile at play is the following:

# please put here your preferred F95/F2003 compiler
# the options in src/Makefile have been put for the
# cases NAG's nagfor, gfortran, g95, Lahey's lf95 and Intels ifort
# Please uncomment the corresponding line
# F90 = nagfor
 F90 = gfortran
# F90 = g95
# F90 = lf95
# F90 = ifort
Model = src
version = 400.00
bin/SPheno:
    cd ${Model} ; ${MAKE} F90=${F90} version=${version}
clean:
    rm -f *.o *~ */*.o */*~
cleanall:
    rm -f bin/SPheno lib/*.a *.o *~ */*.o */*~ include/*
.PHONY: bin/SPheno clean cleanall

CodePudding user response:

The output means that make invoked this command:

ar  ../lib/libSPheno.a Control.o

which runs the ar (archive) program and apparently wants to put the Control.o object into the ../lib/libSPheno.a archive. However, that command line is incorrect because there's supposed to be an option after the ar which tells it what operation to perform. This output:

/Library/Developer/CommandLineTools/usr/bin/ar: illegal option -- .
usage:  ar -d [-TLsv] archive file ...
  ...

is printed by the ar program telling you that your invocation is invalid.

Then this line:

make[1]: *** [../lib/libSPheno.a(Control.o)] Error 1

is make telling you that the command it invoked (ar) to build the target ../lib/libSPheno.a(Control.o) failed, with error code 1.

Somewhere in the makefile you need to find the rule that is telling make to run the ar program. We can't tell you where it is; unfortunately your version of make is too old (Apple is notorious for shipping outdated and buggy versions of GNU utilities): newer versions would give you the line number of the rule in the makefile that failed.

Most likely the rule will refer to the variable $(AR) and maybe $(ARFLAGS) or something.

  • Related