specify compiler used by loadlibrary

2 Ansichten (letzte 30 Tage)
Thomas Wilborn
Thomas Wilborn am 19 Aug. 2015
Kommentiert: Thomas Wilborn am 19 Aug. 2015
This Q is for Matlab 2015a on linux. When I call loadlibrary from Matlab command prompt, it generates a "thunk" .so file from an intermediate .c file that loadlibrary must autogenerate then delete after the "thunk" .so file is created. How can I specify the location of the compiler to use to create the "thunk" .so file?
  2 Kommentare
Philip Borghesani
Philip Borghesani am 19 Aug. 2015
I am curious why do you wish to control this on Linux?
Thomas Wilborn
Thomas Wilborn am 19 Aug. 2015
Hi Philip,
I have an existing .so library that was compiled using g++ 4.4.5. I loaded it from a Matlab 2015a function "F" using loadlibrary and it worked fine.
Then I compiled the Matlab function "F" using mcc version 2015a and ran it. The compiled code ran fine, but crashed upon exit. Note that 2015a says it is only compatible with code compiled with gcc 4.7.x, so I suspect that is the reason for the crash.
Then I compiled the Matlab function "F" using mcc version 2013a and ran it. The compiled code ran fine and did NOT crash upon exit! Note that 2013a says it is only compatible with code compiled with gcc 4.4.x.
I'd like to use 2015a for my project, but recompiling some legacy .so files using gcc 4.7.x is not feasible. I was hoping that if Matlab 2015a could compile the thunk .so file with 4.4.x, then my existing .so files would be compatible with Matlab 2015a after using mcc 2015a.
Thanks for your help. Let me know if more information would be helpful.
Tom

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Philip Borghesani
Philip Borghesani am 19 Aug. 2015
The compiler used is the one configured/found with mex -setup. This answer may help if you need to modify your configuration: Setup MEX compiler for R2014a for Linux

Kategorien

Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by