MATLAB Compiler example matrix driver.c

2 views (last 30 days)
Hello,
I'm working on developing a standalone application using a matlab compiler to generate a c shared library. My application will be a tool that references/calls the c shared library generated from matlab.
To facilitate this process, I'm just running through the matrixdriver wrapper example that is provided in the help documentation pages.
The failure I'm observing is that the function libmatrixInitialize() (reference line 49 in matrixdriver.c) is failing (console output is "Could not initialize the library").
There is no real debug output to figure out why this initialization call would fail.
Please note I'm developing on a mac.
Here are the steps I've taken thus far:
1. Used deploytool to generate libmatrix.dylib
2. use build matrixdriver.c -L. -lmatrix -I. to build the wrapper application
3. setup bash environment variable DYLD_LIBRARY_PATH to include mcr_root/v82/runtime/maci64, mcr_root/v82/sys/os/maci64, mcr_root/v82/bin/maci64 and the path to the libmatrix.dylib file
4. navigate to matrixdriver.app/Contents/MacOS and launch ./matrixdriver
Further details:
- running MATLAB_R2013b
- had to edit mbuildopts.sh to get the deploytool to work with macosx10.8 (as opposed to 10.7)
Thanks for the help in resolving this problem.

Accepted Answer

Stefan Campbell
Stefan Campbell on 13 Feb 2015
Solution was adding the following environment variable: export MCR_CACHE_ROOT=/temp

More Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!