Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在库的安装中链接C和Fortran时出错_C_Macos_Fortran_Gfortran - Fatal编程技术网

在库的安装中链接C和Fortran时出错

在库的安装中链接C和Fortran时出错,c,macos,fortran,gfortran,C,Macos,Fortran,Gfortran,我正在安装LoopTools版本2.15(),这是一个库,用于计算物理中所需的特殊函数。我已经在一台装有Linux的计算机上安装了它,现在正试图在Mac上安装它。我必须安装一个fortran编译器,我可以通过macports轻松地完成。但是,在尝试安装软件包时出现以下错误: 正在查找gcc/usr/bin/clang 正在寻找g++/usr/bin/clang++ 寻找fortran/opt/local/bin/gfortran 正在提取Fortran库。。。好啊 gfortran是否附加下划线

我正在安装LoopTools版本2.15(),这是一个库,用于计算物理中所需的特殊函数。我已经在一台装有Linux的计算机上安装了它,现在正试图在Mac上安装它。我必须安装一个fortran编译器,我可以通过macports轻松地完成。但是,在尝试安装软件包时出现以下错误:

正在查找gcc/usr/bin/clang
正在寻找g++/usr/bin/clang++
寻找fortran/opt/local/bin/gfortran
正在提取Fortran库。。。好啊
gfortran是否附加下划线。。。链接Fortran和C时出错
你对如何解决这个问题有什么建议吗

编辑:根据建议,我发布日志文件的最后30行

+ eval setflags CXXFLAGS '-O3 -g -fomit-frame-pointer -ffast-math -Wall  '
++ setflags CXXFLAGS -O3 -g -fomit-frame-pointer -ffast-math -Wall
++ rhs=
++ printf -v rhs ' %q' -O3 -g -fomit-frame-pointer -ffast-math -Wall
++ eval 'CONF_CXXFLAGS="${rhs//\\,/,}"'
+++ CONF_CXXFLAGS=' -O3 -g -fomit-frame-pointer -ffast-math -Wall'
+ echo -n 'does gfortran append underscores... '
+ tee test32232-c.c
int uscore_ = 95;
int uscore = 59;
+ for CONF_BITS in '${CONF_BITS:--m64 -m32}'
+ eval clang -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m64 -c test32232-c.c
++ clang -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m64 -c test32232-c.c
+ eval gfortran -O3 -ffixed-line-length-none -fno-range-check -Wl,-no_compact_unwind -o test32232 test32232.f test32232-c.o
++ gfortran -O3 -ffixed-line-length-none -fno-range-check -Wl,-no_compact_unwind -o test32232 test32232.f test32232-c.o
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
+ for CONF_BITS in '${CONF_BITS:--m64 -m32}'
+ eval clang -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m32 -c test32232-c.c
++ clang -O3 -g -fomit-frame-pointer -ffast-math -fPIC -Wall -m32 -c test32232-c.c
+ eval gfortran -O3 -ffixed-line-length-none -fno-range-check -Wl,-no_compact_unwind -o test32232 test32232.f test32232-c.o
++ gfortran -O3 -ffixed-line-length-none -fno-range-check -Wl,-no_compact_unwind -o test32232 test32232.f test32232-c.o
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
+ ./test32232
./configure: line 264: ./test32232: No such file or directory
+ case $? in
+ echo 'error linking Fortran and C'
+ exit 1
+ rm -fr test32232-c.c test32232-c.o test32232.f =.```

请回答您的问题,并说明您尝试安装的LoopTools版本。我检查了2.15版。如果将环境变量
LOGFILE
设置为文件名,则脚本
configure
可以将错误输出写入文件。否则,将丢弃错误输出。试试看,例如,
LOGFILE=log.txt
导出日志文件
/configure(作为3个单独的命令)并显示问题中
log.txt
的最后一部分,例如,
tail-30log.txt
的输出。我试图安装的版本确实是命令
gfortran>之后的LoopTools 2.15-o test32232 test32232.f test32232-c.o
您可以看到错误消息
ld:library not found for-lSystem
。检查您的系统上是否有库
libSystem.*
,以及库的位置。如果它不在标准位置,可能您必须将库位置添加到
LD\u library\u PATH
和/或
DYLD\u library\u PATH
是O/S的一部分。我怀疑fortran链接器已损坏。我搜索了它,它位于正确的文件夹中。请回答您的问题并告诉我您尝试使用的LoopTools的版本安装。我检查了2.15版。如果将环境变量
LOGFILE
设置为文件名,则脚本
configure
可以将错误输出写入文件。否则,将丢弃错误输出。试试看,例如,
LOGFILE=log.txt
导出日志文件
/configure(作为3个单独的命令)并显示问题中
log.txt
的最后一部分,例如,
tail-30log.txt
的输出。我试图安装的版本确实是命令
gfortran>之后的LoopTools 2.15-o test32232 test32232.f test32232-c.o
您可以看到错误消息
ld:library not found for-lSystem
。检查您的系统上是否有库
libSystem.*
,以及库的位置。如果它不在标准位置,可能您必须将库位置添加到
LD_library_PATH
和/或
DYLD_library_PATH
/usr/lib/libSystem。dylib
是O/s的一部分。我怀疑fortran链接器已损坏。我搜索了它,它位于正确的文件夹中