尽管已安装gfortran,但找不到-lgfortran [英] Cannot find -lgfortran though gfortran is installed

查看:772
本文介绍了尽管已安装gfortran,但找不到-lgfortran的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
​​找不到lgfortran

Possible Duplicate:
lgfortran not found

我必须承认我的问题与​​ lgfortran找不到非常相似,但是因为我是Linux的新手,所以我需要更多帮助,但在上面的文章中找不到我想要的东西.

I must admit that my question can be considered to be very similar to lgfortran not found, but as I am a newbie in Linux I need more help and I couldn't find what I am looking for in the above post.

我安装了一个新的Linux Mint Debian版本,我正在尝试为Ada制作一个lapack绑定.

I have a fresh linux mint Debian edition installed and I am trying to make a lapack binding for Ada to work.

如果我检查gfortran,我会得到:

If I check for gfortran, I get:

gfortran-4.6 -v
Using built-in specs.
COLLECT_GCC=gfortran-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.6/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-1' --with-   bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-1)

如果我locate libgfortran,我得到:

/usr/lib/gcc/i486-linux-gnu/4.6/libgfortran.a
/usr/lib/gcc/i486-linux-gnu/4.6/libgfortran.so
/usr/lib/gcc/i486-linux-gnu/4.6/libgfortran.spec
/usr/lib/gcc/i486-linux-gnu/4.6/libgfortranbegin.a
/usr/lib/i386-linux-gnu/libgfortran.so.3
/usr/lib/i386-linux-gnu/libgfortran.so.3.0.0
/usr/share/doc/libgfortran3
/var/lib/dpkg/info/libgfortran3.list
/var/lib/dpkg/info/libgfortran3.md5sums
/var/lib/dpkg/info/libgfortran3.postinst
/var/lib/dpkg/info/libgfortran3.postrm
/var/lib/dpkg/info/libgfortran3.shlibs
/var/lib/dpkg/info/libgfortran3.symbols

运行makefile时,我得到:

make all
gcc -c cxbbase.ads
gcc -c cxbbase.ads
gnatmake cxbi.adb -largs ifinc.o -lgfortran -lm
gnatbind -x cxbi.ali
gnatlink cxbi.ali ifinc.o -lgfortran -lm
/usr/gnat/libexec/gcc/i686-pc-linux-gnu/4.5.3/ld: cannot find -lgfortran
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/gnat/bin/gcc
gnatmake: *** link failed.
make: *** [cxbi] Error 4

我正在使用的makefile在这里:

The makefile that I'm using is here:

http://12000.org/my_notes/ada/lapack_and_blas/lapack_interf_makefile.txt

由于我是Linux的新手,如果能获得有关如何解决此问题的详细说明,我将不胜感激.

As I am very new to Linux, I would be very grateful if I could get detailed instructions on how to fix this.

谢谢

推荐答案

解决方案是将/usr/lib/gcc/i486-linux-gnu/4.6转换为LIBRARY_PATH.此解决方案在Comp Lang Ada上进行了讨论:

The solution was to /usr/lib/gcc/i486-linux-gnu/4.6 to LIBRARY_PATH. This solution is discussed here on Comp Lang Ada:

https://groups.google.com/forum/#!topic/comp.lang.ada/Ii7YljKqu5M

这篇关于尽管已安装gfortran,但找不到-lgfortran的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆