SPheno-4.0.5 make 命令不是 运行 (MacOS)

SPheno-4.0.5 make command not running (MacOS)

在我的工作中,我使用了一个名为 SPheno 的基于 Fortran 的程序。安装 SPheno-4.0.4 后,我尝试安装新版本 SPheno-4.0.5,但是,当在 Makefile 中选择 F90 = gfortran 时,就像我在我的工作 SPheno-4.0.4 版本上所做的那样,它 returns 我报了以下错误:

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

这个错误是什么意思,我需要更改什么?我什至尝试 copy/paste 来自 SPheno-4.0.4 的 Makefile,只是为了检查。

以防万一,当 运行 命令 gfortran -v 它 returns 我:

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)

正在运行的 Makefile 如下:

# 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

输出意味着 make 调用了这个命令:

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

其中 运行 是 ar(存档)程序,显然想要将 Control.o 对象放入 ../lib/libSPheno.a 存档。但是,该命令行是不正确的,因为在 ar 之后应该有一个选项告诉它要执行什么操作。这个输出:

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

ar 程序打印,告诉您您的调用无效。

然后这一行:

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

make 告诉您它调用 (ar) 构建目标 ../lib/libSPheno.a(Control.o) 的命令失败,错误代码为 1。

您需要在 makefile 的某处找到告诉 make 到 运行 ar 程序的规则。我们不能告诉你它在哪里;不幸的是,您的 make 版本太旧(Apple 因发布过时且有缺陷的 GNU 实用程序版本而臭名昭著):较新的版本会为您提供 makefile 中失败规则的行号。

规则很可能会引用变量 $(AR),也可能引用 $(ARFLAGS) 或其他变量。