Hi Nicolas,
Thanks for the reply. I think I screwed up by not building as a
universal (I had edited the Makefile in my python distribution so that
distutils wouldn't create universal libraries, which was breaking many
other things for me). I think this solves the issue I initially posted
about.
To answer your question, I checked that the libraries are there:
$ ls -al /Applications/MATLAB_R2008b.app/bin/maci/lib{eng,mx,mat,ut}.dylib
-rwxr-xr-x 1 paul admin 24588 Aug 5 2008
/Applications/MATLAB_R2008b.app/bin/maci/libeng.dylib
-rwxr-xr-x 1 paul admin 141296 Aug 5 2008
/Applications/MATLAB_R2008b.app/bin/maci/libmat.dylib
-rwxr-xr-x 1 paul admin 431460 Aug 5 2008
/Applications/MATLAB_R2008b.app/bin/maci/libmx.dylib
-rwxr-xr-x 1 paul admin 801300 Aug 5 2008
/Applications/MATLAB_R2008b.app/bin/maci/libut.dylib
Building with the default EPD universal binary distutils settings,
not sure what the errors mean:
--------------------------------
python setup.py install
running install
running build
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.5
copying mlabwrap.py -> build/lib.macosx-10.3-fat-2.5
copying awmstools.py -> build/lib.macosx-10.3-fat-2.5
running build_ext
building 'mlabrawmodule' extension
creating build/temp.macosx-10.3-fat-2.5
gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3
-I/tmp/_py/libraries/usr/local/include -D_V6_5_OR_LATER=1
-D_V7_3_OR_LATER=1 -I/Applications/MATLAB_R2008b.app/extern/include
-I/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/numpy-1.3.0n1-py2.5-macosx-10.3-fat.egg/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/4.3.0/include/python2.5
-c mlabraw.cpp -o build/temp.macosx-10.3-fat-2.5/mlabraw.o
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-L/usr/local/lib
-L/Library/Frameworks/Python.framework/Versions/4.3.0/lib -bundle
-undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/mlabraw.o
-L/Applications/MATLAB_R2008b.app/bin/maci
-L/Applications/MATLAB_R2008b.app/bin/maci -leng -lmx -lmat -lut
-lstdc++ -o build/lib.macosx-10.3-fat-2.5/mlabrawmodule.so
ld: warning in build/temp.macosx-10.3-fat-2.5/mlabraw.o, file is not
of required architecture
ld: warning in /Applications/MATLAB_R2008b.app/bin/maci/libeng.dylib,
file is not of required architecture
ld: warning in /Applications/MATLAB_R2008b.app/bin/maci/libmx.dylib,
file is not of required architecture
ld: warning in /Applications/MATLAB_R2008b.app/bin/maci/libmat.dylib,
file is not of required architecture
ld: warning in /Applications/MATLAB_R2008b.app/bin/maci/libut.dylib,
file is not of required architecture
ld: warning, duplicate dylib
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/Python.framework/Versions/4.3.0/lib/libz.1.dylib
ld: warning, duplicate dylib
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/Python.framework/Versions/4.3.0/lib/libz.1.dylib
running install_lib
copying build/lib.macosx-10.3-fat-2.5/mlabrawmodule.so ->
/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages
running install_egg_info
Removing /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabwrap-1.0.1-py2.5.egg-info
Writing /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabwrap-1.0.1-py2.5.egg-info
-----------------------------------
and now I get HDF5 errors. This is an improvement except that I was
stuck on this when trying Matlab 2009a (comes with HDF5 1.8.1 whereas
Matlab 2008b seems to come with HDF5 1.6.5). It seems something is
trying to create a HDF5 mat file on startup. This must be peculiar to
me.
python tests/test_mlabwrap.py
HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 0.
Back trace follows.
#000: ../../../../sources/hdf5/src/H5F.c line 1935 in H5Fcreate():
invalid file name
major(01): Function arguments
minor(05): Bad value
HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 0.
Back trace follows.
#000: ../../../../sources/hdf5/src/H5D.c line 1072 in H5Dcreate():
not a location ID
major(01): Function arguments
minor(03): Inappropriate type
#001: ../../../../sources/hdf5/src/H5G.c line 2441 in H5G_loc():
invalid object ID
major(01): Function arguments
minor(05): Bad value
HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 0.
Back trace follows.
#000: ../../../../sources/hdf5/src/H5F.c line 2564 in H5Fclose():
not a file ID
major(01): Function arguments
minor(03): Inappropriate type
This is the matlab generated stack trace:
-------------------
Stack Trace:
[0] libSystem.B.dylib:flockfile~(0, 0, 0xffff0000 "commpage 32-bit",
0) + 22 bytes
[1] libSystem.B.dylib:fwrite~(0x016ad5ec "MATLAB 7.0 MAT-file, ", 1,
21, 0) + 78 bytes
[2] libmat.dylib:writeMATHeader(__sFILE*)(0, 0x016ad4bc "r+b", 0,
0xb0e2e3c0) + 67 bytes
[3] libmat.dylib:TerminateMATFile_7(MATFile_tag*)(0x215c5640,
0x215c5640, 1, 0x00590000) + 437 bytes
[4] libmat.dylib:matClose(0x215c5640, 0xb0e2e37f, 0xb0e2e37e, 0) + 20 bytes
[5] libmwbuiltins.dylib:SaveMAT::CloseFile()(0x21ec9fe0, 0x2187a748
"MATLAB:save:cantWriteFile", 1, 0xb0e2e3c8) + 86 bytes
[6] libmwbuiltins.dylib:SaveMAT::~SaveMAT()(0x21ec9fe0, 0x401d3333,
0x21ecbc40, 0x035ce7c8 "MLABRAW_ERROR_") + 33 bytes
[7] libmwbuiltins.dylib:SaveStdioMAT::~SaveStdioMAT()(0x21ec9fe0,
0xb0e2ef80, 0, 0x21ecbc40) + 32 bytes
------------------
It seems it is trying to write stdio to a mat file and is failing. No
one has posted a similar problem. I wouldn't waste your time on this.
I am looking through the mlabraw.cpp file and there seems to be only
about 8 or so eng functions that I would need to wrap to have basic
use of the Matlab engine. I will try that first with ctypes and maybe
that will help me understand what the issue is with mlabwrap on my
machine.
Thanks!
Pål
On Wed, Jun 17, 2009 at 11:33 PM, Nicolas Pinto<pinto@...> wrote:
> Also, are you sure libexpat.dylib symlink points to the correct lib ?
>
> Cheers,
>
> N
>
> On Wed, Jun 17, 2009 at 5:30 PM, Nicolas Pinto <pinto@...> wrote:
>>
>> Dear Paul,
>>
>> I got a similar error when DYLD_LIBRARY_PATH wasn't set correctly (see
>> below).
>>
>> Are you sure $DYLD_LIBRARY_PATH/lib{eng,mat,ut}.dylib exist ?
>> ls -al $DYLD_LIBRARY_PATH/lib{eng,mat,ut}.dylib
>>
>> mlabwrap works on my mac when I use
>> DYLD_LIBRARY_PATH=/Applications/Work/MATLAB_R2008a/bin/maci
>>
>> Best,
>>
>> N
>>
>>
>> unset DYLD_LIBRARY_PATH
>>
>> python tests/test_mlabwrap.py
>> Traceback (most recent call last):
>> File "tests/test_mlabwrap.py", line 38, in <module>
>> from mlabwrap import *
>> File "/Library/Python/2.5/site-packages/mlabwrap.py", line 190, in
>> <module>
>> import mlabraw
>> ImportError: dlopen(/Library/Python/2.5/site-packages/mlabrawmodule.so,
>> 2): Library not loaded: @loader_path/libeng.dylib
>> Referenced from: /Library/Python/2.5/site-packages/mlabrawmodule.so
>> Reason: image not found
>>
>> ldd /Library/Python/2.5/site-packages/mlabrawmodule.so
>> /Library/Python/2.5/site-packages/mlabrawmodule.so:
>> @loader_path/libeng.dylib (compatibility version 0.0.0, current
>> version 0.0.0)
>> @loader_path/libmx.dylib (compatibility version 0.0.0, current
>> version 0.0.0)
>> @loader_path/libmat.dylib (compatibility version 0.0.0, current
>> version 0.0.0)
>> @loader_path/libut.dylib (compatibility version 0.0.0, current
>> version 0.0.0)
>> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
>> version 7.4.0)
>> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
>> version 1.0.0)
>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version 111.1.4)
>>
>> ls /Applications/Work/MATLAB_R2008a/bin/maci/lib{eng,mx,mat,ut}.dylib
>> /Applications/Work/MATLAB_R2008a/bin/maci/libeng.dylib
>> /Applications/Work/MATLAB_R2008a/bin/maci/libmx.dylib
>> /Applications/Work/MATLAB_R2008a/bin/maci/libmat.dylib
>> /Applications/Work/MATLAB_R2008a/bin/maci/libut.dylib
>>
>> export DYLD_LIBRARY_PATH=/Applications/Work/MATLAB_R2008a/bin/maci
>>
>> python tests/test_mlabwrap.py
>> Test basic behavior. ... ADDPATHed tests
>> ok
>> testCallArgs (__main__.mlabwrapTC) ... ADDPATHed tests
>> ok
>> Test that docstring extraction works OK. ... ADDPATHed tests
>> ok
>> Testing order flags cause no problems ... ADDPATHed tests
>> ok
>> indexing and co: time for some advanced proxied __getitem__ and
>> __setitem__ etc.. ... ADDPATHed tests
>> ok
>> A few explicit tests for mlabraw ... ADDPATHed tests
>> ok
>> Make sure sparse arrays work. ... ADDPATHed tests
>> ok
>> test more subtle stuff. This must come last, hence the XXX ... ADDPATHed
>> tests
>> ok
>>
>> ------------------------------
>> ----------------------------------------
>> Ran 8 tests in 28.809s
>>
>> OK
>>
>> On Wed, Jun 17, 2009 at 5:01 PM, Paul Northug <pnorthug@...> wrote:
>>>
>>> Before I give up on mlabwrap, I tried installing it again one last
>>> time. If anyone has any ideas on what to do, please let me know. I am
>>> not familiar with Mac OS myself unfortunately. If you jump to the end,
>>> you see there is some library loading conflict with libut. I
>>> understand that it will be difficult for mlabwrap to anticipate
>>> everyone's particular install issues.
>>>
>>> Otherwise, I will try to wrap some of the Matlab engine functions in
>>> Cython or use the sage matlab pexpect interface. Or ctypes. Please let
>>> me know if anyone else has done this in Cython already. Thanks!
>>>
>>> I have:
>>>
>>> MLABRAW_CMD_STR=/Applications/MATLAB_R2008b.app/bin/matlab
>>> DYLD_LIBRARY_PATH=/Applications/MATLAB_R2008b.app/bin/maci
>>>
>>> Install:
>>>
>>> python setup.py install
>>> running install
>>> running build
>>> running build_py
>>> creating build
>>> creating build/lib.macosx-10.3-fat-2.5
>>> copying mlabwrap.py -> build/lib.macosx-10.3-fat-2.5
>>> copying awmstools.py -> build/lib.macosx-10.3-fat-2.5
>>> running build_ext
>>> building 'mlabrawmodule' extension
>>> creating build/temp.macosx-10.3-fat-2.5
>>> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
>>> -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
>>> -I/tmp/_py/libraries/usr/local/include -D_V6_5_OR_LATER=1
>>> -D_V7_3_OR_LATER=1 -I/Applications/MATLAB_R2008b.app/extern/include
>>>
>>> -I/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/numpy-1.3.0n1-py2.5-macosx-10.3-fat.egg/numpy/core/include
>>> -I/Library/Frameworks/Python.framework/Versions/4.3.0/include/python2.5
>>> -c mlabraw.cpp -o build/temp.macosx-10.3-fat-2.5/mlabraw.o
>>> g++ -g -L/usr/local/lib
>>> -L/Library/Frameworks/Python.framework/Versions/4.3.0/lib -bundle
>>> -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/mlabraw.o
>>> -L/Applications/MATLAB_R2008b.app/bin/maci
>>> -L/Applications/MATLAB_R2008b.app/bin/maci -leng -lmx -lmat -lut
>>> -lstdc++ -o build/lib.macosx-10.3-fat-2.5/mlabrawmodule.so
>>> ld: warning, duplicate dylib
>>> /Library/Frameworks/Python.framework/Versions/4.3.0/lib/libz.1.dylib
>>> running install_lib
>>> copying build/lib.macosx-10.3-fat-2.5/mlabrawmodule.so ->
>>>
>>> /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages
>>> running install_egg_info
>>> Removing
>>> /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabwrap-1.0.1-py2.5.egg-info
>>> Writing
>>> /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabwrap-1.0.1-py2.5.egg-info
>>>
>>> Linked libraries:
>>>
>>> $otool -L
>>> /Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabrawmodule.so
>>>
>>> @loader_path/libeng.dylib (compatibility version 0.0.0, current
>>> version 0.0.0)
>>> @loader_path/libmx.dylib (compatibility version 0.0.0, current
>>> version 0.0.0)
>>> @loader_path/libmat.dylib (compatibility version 0.0.0, current
>>> version 0.0.0)
>>> @loader_path/libut.dylib (compatibility version 0.0.0, current
>>> version 0.0.0)
>>> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
>>> version 7.4.0)
>>> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
>>> version 1.0.0)
>>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>> version 111.1.4)
>>>
>>> python tests/test_mlabwrap.py
>>> Traceback (most recent call last):
>>> File "tests/test_mlabwrap.py", line 38, in <module>
>>> from mlabwrap import *
>>> File
>>> "/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabwrap.py",
>>> line 190, in <module>
>>> import mlabraw
>>> ImportError:
>>> dlopen(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/mlabrawmodule.so,
>>> 2): Library not loaded: @loader_path/libexpat.dylib
>>> Referenced from: /Applications/MATLAB_R2008b.app/bin/maci/libut.dylib
>>> Reason: Incompatible library version: libut.dylib requires version
>>> 7.0.0 or later, but libexpat.dylib provides version 0.0.0
>>>
>>> These libraries are all in /Applications/MATLAB_R2008b.app/bin/maci
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Crystal Reports - New Free Runtime and 30 Day Trial
>>> Check out the new simplified licensing option that enables unlimited
>>> royalty-free distribution of the report engine for externally facing
>>> server and web deployment.
>>> http://p.sf.net/sfu/businessobjects
>>> _______________________________________________
>>> Mlabwrap-user mailing list
>>> Mlabwrap-user@...
>>> https://lists.sourceforge.net/lists/listinfo/mlabwrap-user
>>
>>
>>
>> --
>> Nicolas Pinto
>> Ph.D. Candidate, Brain & Computer Sciences
>> Massachusetts Institute of Technology, USA
>> http://web.mit.edu/pinto
>
>
>
> --
> Nicolas Pinto
> Ph.D. Candidate, Brain & Computer Sciences
> Massachusetts Institute of Technology, USA
> http://web.mit.edu/pinto
>
|