Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29273 Discussions

problem with intel fortran compiler & matlab mex files

Michele_Catalano
Beginner
875 Views
Dear All,

I hope this is the right place... I'm trying to compile the basic example to test the linux configuration to build mex files with the intel fortran compiler.

I get the following error:

??? Invalid MEX-file '/home/catalanom/Scrivania/provaF/yprimef.mexglx': libifport.so.5: cannot open shared object file: No such file or directory

What is the problem? I configured the mexopts.sh file as follows>

FC='/opt/intel/Compiler/11.0/081/bin/ia32/
FFLAGS='-fpp -fPIC -u -w95 -warn all'
FLIBS="$RPATH $MLIBS -lm -L/opt/intel/Compiler/11.0/081/lib/ia32/"
FOPTIMFLAGS='-O3'
FDEBUGFLAGS='-g'

Thank you in advance for the help

Michele
0 Kudos
4 Replies
TimP
Honored Contributor III
875 Views
As you have linked against a shared library in the ifort installation, you must have that directory in LD_LIBRARY_PATH environment (as 'source /opt/intel/Compiler/11.0/081/bin/ifortvars.sh ia32' would do), or set it up with ldconfig. If you had set up those environment variables by the ifort script, you would not require full paths in your own script.
0 Kudos
Michele_Catalano
Beginner
875 Views
Quoting - tim18
As you have linked against a shared library in the ifort installation, you must have that directory in LD_LIBRARY_PATH environment (as 'source /opt/intel/Compiler/11.0/081/bin/ifortvars.sh ia32' would do), or set it up with ldconfig. If you had set up those environment variables by the ifort script, you would not require full paths in your own script.


Dear Tim,

thanks for your answer. I get the error yet; I source ifortvars.sh and I get

echo $LD_LIBRARY_PATH/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/mkl/lib/32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/mkl/lib/32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/idb/lib/ia32/

It seems ok.

I compile with mex in verbose mode the followings commands

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -c -I/usr/local/matlab7/extern/include -I/usr/local/matlab7/simulink/include -fpp -fPIC -u -w95 -warn all -O yprimef.F

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -c -I/usr/local/matlab7/extern/include -I/usr/local/matlab7/simulink/include -fpp -fPIC -u -w95 -warn all -O yprimefg.F

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -O -pthread -shared -m32 -Wl,--version-script,/usr/local/matlab7/extern/lib/glnx86/fexport.map -o yprimef.mexglx yprimef.o yprimefg.o /usr/local/matlab7/extern/lib/glnx86/version4.o -Wl,-rpath-link,/usr/local/matlab7/bin/glnx86 -L/usr/local/matlab7/bin/glnx86 -lmx -lmex -lmat -lm -L/opt/intel/Compiler/11.0/081/lib/ia32/

Is there any interaction? I'm not able to fix this, Thank you again

Michele
0 Kudos
TimP
Honored Contributor III
875 Views


Dear Tim,

thanks for your answer. I get the error yet; I source ifortvars.sh and I get

echo $LD_LIBRARY_PATH/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/mkl/lib/32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/mkl/lib/32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/lib/ia32:/opt/intel/Compiler/11.0/081/idb/lib/ia32/

It seems ok.

I compile with mex in verbose mode the followings commands

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -c -I/usr/local/matlab7/extern/include -I/usr/local/matlab7/simulink/include -fpp -fPIC -u -w95 -warn all -O yprimef.F

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -c -I/usr/local/matlab7/extern/include -I/usr/local/matlab7/simulink/include -fpp -fPIC -u -w95 -warn all -O yprimefg.F

-> /opt/intel/Compiler/11.0/081/bin/ia32/ifort -O -pthread -shared -m32 -Wl,--version-script,/usr/local/matlab7/extern/lib/glnx86/fexport.map -o yprimef.mexglx yprimef.o yprimefg.o /usr/local/matlab7/extern/lib/glnx86/version4.o -Wl,-rpath-link,/usr/local/matlab7/bin/glnx86 -L/usr/local/matlab7/bin/glnx86 -lmx -lmex -lmat -lm -L/opt/intel/Compiler/11.0/081/lib/ia32/

Is there any interaction? I'm not able to fix this, Thank you again

Michele
I suppose you should check by 'file /opt/intel/Compiler/11.0/081/lib/ia32/libifport.so.5' that it is actually present as a 32-bit shared object.
If not, your ifort library installation is bad, and you should try uninstall and reinstall.
0 Kudos
Michele_Catalano
Beginner
875 Views
Quoting - tim18
I suppose you should check by 'file /opt/intel/Compiler/11.0/081/lib/ia32/libifport.so.5' that it is actually present as a 32-bit shared object.
If not, your ifort library installation is bad, and you should try uninstall and reinstall.


Hi,

The library is present in the compiler distribution. The same code in fortran is linked successfully.

Michele
0 Kudos
Reply