• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Was gibt es Schöneres als den Mai draußen in der Natur mit allen Sinnen zu genießen? Lasst uns teilhaben an Euren Erlebnissen und macht mit beim Thema des Monats Da blüht uns was! ---> Klick

Matlab Bibliotheken in Mac OSX

DarthSol

Alkmene
Registriert
17.01.10
Beiträge
32
Wie bereits in diesem Thread geschildert versuche ich nun schon seit einer Weile, die Matlab Bibliotheken in Amira einzubinden, damit ich Amira Datein als *.mat File abspeichern kann.

Die Anleitung von Amira schlägt hierfür folgendes vor:

"On Mac OS X, the AMIRA_LD_LIBRARY_PATH environment variable should be set to MATLAB_INSTALLATION_PATH/bin/maci (for instance: /Applications/MATLAB_R2008b.app/bin/maci)

Leider funktioniert diese Variante bei mir NICHT. Stattdessen erfolgt die Fehlermeldung

Couldn't open libmat.dylib:
dlopen(libmat.dylib, 9): image not found
Couldn't open libeng.dylib:
dlopen(libeng.dylib, 9): image not found
Loading failed, unable to open the following Matlab libraries:
libmat
libeng
The required Matlab libraries need to be in your LD_LIBRARY_PATH.


libmat und libeng befinden sich im Installationsordner von MATLAB

Im 2. Schritt habe ich den Pfad LD_LIBRARY_PATH mit Hilfe von

export LD_LIBRARY_PATH=/Applications/MATLAB_R2010aSV.app/bin/maci

gesetzt, da er offensichtlich diese Umgebungsvariable erwartet.

Die Fehlermeldung beim Speichern sieht anschließend so aus:

Couldn't open libmat.dylib:

dlopen(libmat.dylib, 9): Symbol not found: _miFtell64
Referenced from: /Applications/MATLAB_R2010aSV.app/bin/maci/libmat.dylib
Expected in: /usr/lib/libmx.dylib
Couldn't open libeng.dylib:
dlopen(libeng.dylib, 9): Symbol not found: _miFtell64

Referenced from: /Applications/MATLAB_R2010aSV.app/bin/maci/libmat.dylib

Expected in: /usr/lib/libmx.dylib
Loading failed, unable to open the following Matlab libraries:
libmx
libmat
libeng


Hier muss man sagen:
- Es befindet sich eine Datei libtbb.dylib im selben Verzeichnis wie das referenzierende libmwfl.dylib, kann aus irgendeinem Grunde aber nicht gefunden werden.

- libmat und libeng werden nun offensichtlich im richtigen Ordner gefunden werden, können aber nicht geöffnet werden da der Datei libmx.dylib im Ordner /usr/lib das Symbol _miFtell64 fehlt

Der Suchbefehl

grep -r _miFtell64 *.dylib

Im Installationsordner von MATLAB findet das Symbol aber sehr wohl in der Datei libmx.dylib. Das heißt es wird zum öffnen von libeng.dylib und libmat.dylib anscheined die falsche Datei verwendet?

- Ich habe in der Hoffnung dadurch mehr Informationen zu erhalten jetzt auch mal den XCode installiert.

Für otool -L libmat.dylib im Ordner /Applications/MATLAB_R2010aSV.app/bin/maci/ erhalte ich folgendes Ergebnis

libmat.dylib:
@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)
@loader_path/libmx.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/libhdf5_hl.6.dylib (compatibility version 7.0.0, current version 7.2.0)
@loader_path/libhdf5.6.dylib (compatibility version 7.0.0, current version 7.2.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.0.0)

Für otool -L libeng.dylib das hier:

libeng.dylib:
@loader_path/libeng.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)
@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)
/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.0.0)

Für otool -L libmx.dylib das hier:

libmx.dylib:
@loader_path/libmx.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)
@loader_path/libmwfl.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/libicudata.dylib.40 (compatibility version 40.0.0, current version 40.0.0)
@loader_path/libicuuc.dylib.40 (compatibility version 40.0.0, current version 40.0.0)
@loader_path/libicui18n.dylib.40 (compatibility version 40.0.0, current version 40.0.0)
@loader_path/libicuio.dylib.40 (compatibility version 40.0.0, current version 40.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/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.0.0)



Und finally für otool -L libmx.dylib im referenzierten Ordner /usr/lib das hier:

libmx.dylib:
/usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 315.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)


Bei meiner Suche im Internet habe ich unter anderem auch das hier gefunden, was wohl unter Umständen nützlich sein könnte:

http://stackoverflow.com/questions/1937232/linking-to-a-dynamic-library-on-a-mac-with-full-path

Dort heißt es, dass die Formulierung @loader_path/libeng.dylib unter Umständen Probleme bereiten könnte.

Ach so, sowohl Amira als auch Matlab beruhen auf 32 Bit.


Und noch am Rande: Ich habe es bisher ein einziges Mal geschafft, dass Amira ohne Fehler eine *mat File gespeichert hat. Leider konnte ich dies selbst bei einem Blick in die Command History nicht reproduzieren.













 
Zuletzt bearbeitet:

DarthSol

Alkmene
Registriert
17.01.10
Beiträge
32
Ich habe eine Lösung gefunden, aber sie wirkt recht rustikal.
Ich habe die Datei libmx.dylib in /usr/lib durch die Datei libmx.dylib aus /Applications/MATLAB_R2010a.app/bin/maci ersetzt und den restlichen Inhalt von /Applications/MATLAB_R2010a.app/bin/maci in /usr/lib kopiert.

Es funktioniert jetzt alles, ich hoffe nur dass ich da nichts dummes angestellt habe.
Ich habe sicherheitshalber den /usr/lib Ordner vorher kopiert.