问题
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