error on installling matlab-gdf in debian with apt

4 views (last 30 days)
Hello all,
I have a Debian bookworm system on my computer. I encountered an error when I tried installing matlab-gdf on Linux terminal using apt. It gives the following error:
Setting up matlab-gdf (0.1.3-11) ...
Building Matlab extensions (logfile at /tmp/gdf-mexbuild-1671961944.j0OkP0P)
sh: 1: mex: not found
sh: 1: mex: not found
dpkg: error processing package matlab-gdf (--configure):
installed matlab-gdf package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
matlab-gdf
I can not see any other error codes or file references. Trying sudo dpkg --configure -a and sudo apt --fix-broken install only shows this. This is the display of the log file shown:
debian-matlab-mexhelper 0.0.21.1
Copyright (C) 2010-2011 Michael Hanke <michael.hanke@gmail.com>
Licensed under GNU General Public License version 3 or later.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Michael Hanke.
Attempt to build Matlab extensions
Package name: gdf
Source directory: /usr/src/matlab/gdf
MEX dir: /usr/lib/matlab/site/gdf
M dir: /usr/share/matlab/site/m/gdf
Build user (if any):
Build command: for f in *.cpp; do mex $f -lGDF; done
Install command: mv -t /usr/share/matlab/site/m/gdf *.mex?*
Clean command: rm -f *.o *.a *.mex*
Attempt to build Matlab extensions:
for f in *.cpp; do mex $f -lGDF; done
Due to failed installation, directory /usr/lib/matlab/site/gdf did not exist. I tried to copy /usr/src/matlab/gdf to /usr/lib/matlab/site/gdf, but it didn't work. In Matlab, mex command works normally and gives correct outputs. Hence, I couldn't understand how to resolve this issue.
Thanks in advance.

Answers (1)

Yash
Yash on 26 May 2023
The error message indicates that the mex command is not found, which is necessary for building MATLAB extensions. The mex command is typically provided by the MATLAB software itself and should be available in the MATLAB installation directory.
To resolve this issue, you can try the following steps:
  1. Make sure MATLAB is properly installed on your system and the mex command is accessible. You can test this by running mex in a terminal outside of MATLAB. If the command is not found, it suggests that MATLAB might not be properly installed or its binary directory is not included in the system's PATH variable.
  2. If MATLAB is installed correctly, you may need to add its binary directory to the system's PATH variable. Open a terminal and run the following command to add the MATLAB binary directory to the PATH:bash
export PATH="/path/to/matlab/bin:$PATH"
Replace /path/to/matlab with the actual path to your MATLAB installation directory.
  • After setting the PATH variable, try installing the matlab-gdf package again using apt. Run the following command:bash
sudo apt install matlab-gdf
This should trigger the installation process again and hopefully find the mex command from the MATLAB installation.
If a terminal window prompts asking for the location of matlab installation : please enter the same.
An image file has been attached to assist you with the same.
1st Approach : /usr/local/MATLAB/R2023a
2nd Approach : /usr/local/MATLAB/R2023a/bin
Note : Only if the first approach doesn't work try the second one also this is the matlab installation location on my system your's might not be the same
Please note that the information provided is based on the assumption that MATLAB is correctly installed on your system. If you encounter any difficulties or require more specific guidance, it is recommended to consult the official MATLAB documentation or seek support from MathWorks, the company behind MATLAB.
I hope this helps :)

Categories

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

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!