質問

MATLABでMEXファイルを実行しようとすると、次のエラーが発生しています。

??? Invalid MEX-file
'findimps3.mexa64':
/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/libblas.so.3gf)
.

この問題を解決する方法?

更新: 「文字列MATLAB /.../ libgfortran.3 | grep gfortran」出力gfortran_1.0を見つけました。私はMATLABの中のlibgfortranを変更しようとしましたが、それはうまくいきませんでした。gfortran_1.0で動作する適切なlibblasを見つけることが良いと思います。

役に立ちましたか?

解決

read this link, it explains how to configure matlab on some linux systems.

here the steps that are relevant to you:

To enable running external programs, […] fortran libraries need to be properly updated and linked. Look at the output of this command:

ll "$MATLABDIR/bin/glnxa64/"

It is likely that [this link] exist:

libgfortran.so.3 -> libgfortran.so.3.0.0

Search for [this library] on your machine:

locate libgfortran.so

[…] Update Matlab's links to point to these newer versions:

sudo ln -sf [location of libgfortran.so.3.0.0] "$MATLABDIR/bin/glnxa64/libgfortran.so.3"

他のヒント

I (think I) fixed this problem by running matlab with LD_PRELOAD, like this

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libfreetype.so:/usr/lib/x86_64-linux-gnu/libgfortran.so.3 matlab

Notice freetype was another library I was having a similar problem with.

In my case the following command worked:

sudo ln -sf /usr/lib/gcc/i686-linux-gnu/4.7/libgfortran.so /usr/local/MATLAB/R2012a/sys/os/glnx86/libgfortran.so.3

Matlab was complaining it couldn't find the GFORTRAN1.4 in the following location:

/usr/lib/gcc/i686-linux-gnu/4.7/libgfortran.so

So I linked this location to the library I had :

/usr/local/MATLAB/R2012a/sys/os/glnx86/libgfortran.so.3

I found the location of this library by using the locate command as given above:) Thanks for the help:)

In my case, fixed by
$ ln -sf /usr/lib64/libgfortran.so.3.0.0 /opt/matlab/sys/os/glnxa64/libgfortran.so.3

Errors I meet when using CDSP:
csdp: /opt/matlab/sys/os/glnxa64/libgfortran.so.3: version GFORTRAN_1.4' not found (required by /usr/lib64/atlas/libptf77blas.so.3)
csdp: /opt/matlab/sys/os/glnxa64/libgfortran.so.3: version
GFORTRAN_1.4' not found (required by /usr/lib64/atlas/libf77blas.so.3)

I just ran into the same problem (error usr/lib64/libgfortran.so.3: version `gfortran_1.4' not found) and it was actually not hard to fix. The problem seems to be that gfortran_1.4 version of libgfortran.so.3 comes from the release gcc-4.6.2 (i.e. fortran 4.6).

What I did was downloaded gcc-4.6.2 and built, using the steps: tar -xvf gcc-4.6.2.tar.gz cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir $PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2 --enable-languages=c,fortran,c++,go make make install

Then, once everything was made, I went to the directory where the new, fresh libgfortran.so.3 was sitting (in my case it was /home/testuser/objdir/x86_64-unknown-linux-gnu/32/libgfortran/.libs/)

I copied this version of libgfortran.so.3, and went to the directory where my program was expecting to find libgfortran.so.3. I replaced the old one (the old libgfortran.so.3) with the new one (the one we just copied).

The problem instantly went away. I hope this helps you too!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top