4
我已經gfortran安裝在我的系統和文件libgfortran.a
上可以在/usr/lib/gcc/x86_64-linux-gnu/4.6/
找到。使用nm
我確信,功能_gfortran_compare_string
中有定義:無法鏈接到libgfortran.a
$ nm /usr/lib/gcc/x86_64-linux-gnu/4.6/libgfortran.a | grep _gfortran_compare_string
返回
0000000000000000 T _gfortran_compare_string
0000000000000000 T _gfortran_compare_string_char4
但是,我的CUDA-C程序的鏈接器引發錯誤:
/usr/local/cuda-6.0/bin/nvcc --cudart static -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/home/chung/lapack-3.5.0 -link -o "pQP" ./src/pQP.o -lgfortran -llapacke -llapack -lcublas -lblas -lcurand
nvcc warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
/home/chung/lapack-3.5.0/liblapack.a(ilaenv.o): In function `ilaenv_':
ilaenv.f:(.text+0x81): undefined reference to `_gfortran_compare_string'
和後來另一個錯誤,又涉及到libgfortran:
/home/chung/lapack-3.5.0/liblapack.a(xerbla.o): In function `xerbla_':
xerbla.f:(.text+0x49): undefined reference to `_gfortran_st_write'
xerbla.f:(.text+0x54): undefined reference to `_gfortran_string_len_trim'
xerbla.f:(.text+0x66): undefined reference to `_gfortran_transfer_character_write'
xerbla.f:(.text+0x76): undefined reference to `_gfortran_transfer_integer_write'
xerbla.f:(.text+0x7e): undefined reference to `_gfortran_st_write_done'
xerbla.f:(.text+0x87): undefined reference to `_gfortran_stop_string'
但是,再次使用納米,我發現_gfortran_st_write
等在libgfortran.a中定義。
注: LAPACK利用libgfortran的。我最近安裝了lapack並運行了所有測試,並且都通過了。
令人驚歎!太感謝了!我會永遠感激! –