フィルターのクリア

Mex 64bit library error

3 ビュー (過去 30 日間)
Adrianna
Adrianna 2011 年 8 月 11 日
Hi,
I am trying to compile another mex program. I believe the problem lies in the library list but I don't know what is missing as the requested library is there.
Here is the error I get:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libgfortran.a: relocation R_X86_64_32 against, '.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libgfortran.a: could not be reads symbols: Bad value
Any help is much appreciated.
Adrianna

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2011 年 8 月 12 日
  2 件のコメント
Adrianna
Adrianna 2011 年 8 月 14 日
Are you suggesting reinstalling gcc with a modified make file? This seems odd that there would not be a simpler way to deal with standard installations of fundamental software such as gcc.
Kaustubha Govind
Kaustubha Govind 2011 年 8 月 17 日
No, I'm not suggesting that. I think what's happening is that you're trying to load a library in your MEX-file that has not been compiled with the -fPIC option.
Where is the symbol .rodata.str1 coming from? Is that in your FORTRAN code? How did you link it to your MEX-function?

サインインしてコメントする。


Michael
Michael 2011 年 9 月 1 日
Matlab is using libgfortran.a but it should instead be using libgfortran.so.3
I've been able to get around this by explicitly including libgfortran.so.3 in the mex call, i.e.
mex myProgram.F90 /usr/local/MATLAB/R2011a/sys/os/glnxa64/libgfortran.so.3 -output myProgram
note you'll need to modify this based on the location of your gfortran library

カテゴリ

Help Center および File ExchangeFortran with MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by