Error linking C and Fortran in installation of library

女生的网名这么多〃 提交于 2021-02-05 09:01:32

问题


I'm installing LoopTools version 2.15 (http://www.feynarts.de/looptools/LT25Guide.pdf), a library which evaluates special functions needed in physics. I had already installed it on a computer with Linux, and am now trying to install it on a Mac. I had to install a fortran compiler, which I did easily through macports. However, the following error appears when I try to install the package:

looking for gcc... /usr/bin/clang
looking for g++... /usr/bin/clang++
looking for fortran... /opt/local/bin/gfortran
extracting the Fortran libraries... ok
does gfortran append underscores... error linking Fortran and C

Do you have any suggestions on how to solve the problem?

EDIT: under suggestion, I post the last 30 lines of the logfile

+ 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 =.```

来源:https://stackoverflow.com/questions/57996656/error-linking-c-and-fortran-in-installation-of-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!