我正在尝试编译Fortran程序调用ShengBTE。它使用一个make文件,其内容如下 -
export FC=gfortran
export FFLAGS=-gfortran -g -O2 -fPIC -fbounds-check
export CFLAGS=-I/home/user/local/include
export LDFLAGS=-L/usr/lib64/ -llapack -lgfortran
当我从根文件夹运行make时,我收到以下错误 -
gfortran -g -O2 -fPIC -fbounds-check -o ../ShengBTE conductivity.o config.o data.o input.o iterations.o misc.o gruneisen.o phonon_routines.o integrals.o processes.o scaling.o symmetry.o wedgetc.o ShengBTE.o -L/usr/lib64/ -llapack -lgfortran
/usr/bin/ld: conductivity.o: undefined reference to symbol 'dnrm2_'
/usr/bin/ld: note: 'dnrm2_' is defined in DSO /usr/lib64/libblas.so.3 so try adding it to the linker command line
/usr/lib64/libblas.so.3: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: [../ShengBTE] Error 1 (ignored)
libblas.so.3存在于/ usr / lib64下,并且应该可以在make文件中使用-L选项的链接器使用。
ls /usr/lib64/libblas*
lrwxrwxrwx 1 23 Apr 17 15:11 /usr/lib64/libblas.so -> /usr/lib64/libblas.so.3*
lrwxrwxrwx 1 30 Jun 27 2013 /usr/lib64/libblas.so.3 -> /etc/alternatives/libblas.so.3*
-rwxr-xr-x 1 362704 Mar 20 2013 /usr/lib64/libblas.so.3.4.2*
我在某处读到gcc可能对文件链接的顺序挑剔。如何通过make文件更改它?