Issue accessing external functions with matlab on linux

1 view (last 30 days)
Hello all,
Recently I have done a fresh install on my work laptop and put on linux instead of windows. Installing MATLAB went relatively smoothly, and I only needed to adjust the folder/file permissions.
However, with my work I use flexures, and for this I use a software package called SPACAR and SPACAR Light. As far as I know within the department everyone has always used this with windows, but seeing how it is just matlab code, I don't see why it would not work with Linux.
Installation
Anyway, the setup of SPACAR + SPACAR Light in windows is just to put these files in the matlab working directory (C:\Users/[user]\Documents\MATLAB\spacar\*files*). I thought it might be similar in linux, but the default directory seems to be the desktop, so instead I put the spacar files under ~/Documents/MATLAB/spacar/*files*, and made sure to add this folder to the MATLAB search path.
The problem
To check the installation, SPACAR light provides a convenient example file. Opening the example file as described in the installation guide, sadly gave a not very verbose error. It says "Error using spacarlight; spacar() is not in your path.". This seems to indicate that the example file can open the 'spacarlight.m' file, and access the spacarlight() function, but cannot access the subsequent spacar() function which is used by spacarlight, eventhough it is in the same directory (I have added a printout of the directory contents using ls ~/Documents/MATLAB/spacar >> spacardircontents.txt, just to confirm, see the file spacardircontents.txt).
What have I tried so far
Firstly, I have tried moving around the spacar example file, and tried to move the SPACAR files to different directories, all without any effect. Additionally, I thought this might be a permission problem, but using sudo chmod -R a+rwx ~/Documents/MATLAB/spacar doesn't improve the situation. And lastly, I have double checked for the availability of all the contents of the SPACAR directory.
Do note, that the file 'spacar.m' which contains the spacar() function, only has the function definition.
Question
SPACAR probably isn't used by many users here, and especially not on linux, but does anyone have any suggestions, or is willing to try out to get SPACAR working on linux?
Also, is it possible for add-ons like this to only be compatible with windows?
Thank you in advance!
Software used:
  • Matlab R2021b
  • SPACAR 2017
  • SPACAR light V1.34
OS:
  • Linux Mint 20.2

Accepted Answer

Walter Roberson
Walter Roberson on 26 Oct 2021
Look at all those mex files. They are compiled implementation for windows 32, windows 64, and mac, but none for Linux. A lot of them. Much of the implementation is precompiled, not MATLAB code at all.
  5 Comments
Walter Roberson
Walter Roberson on 26 Oct 2021
What .mex* files are is renamed shared object files -- what Windows would call DLL and Mac and Linux would call .so files. The three operating systems use different object file formats and have different operating system calls.
Boi Okken
Boi Okken on 26 Oct 2021
I could probably get access to the appropriate source files.

Sign in to comment.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!