Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
3511 views
libcairo undefined symbol: FT_Get_Var_Design_Coordinates error when calling R from compiled MATLAB application on Centos7
I'm posting this question to document the solution to a problem which had me stuck for several weeks for which no answer was found on StackExchange or discussion boards. (Answer forthcoming) I'm trying to run a compiled matlab program (MATLAB 2017a) compiled using the application compiler toolbox (M...
I'm posting this question to document the solution to a problem which had me stuck for several weeks for which no answer was found on StackExchange or discussion boards. (Answer forthcoming) I'm trying to run a compiled matlab program (MATLAB 2017a) compiled using the application compiler toolbox (Matlab compiler 6.4) on a Centos7 operating system. The tricky part is that my Matlab program uses the "system" command to call R and knit an rmarkdown document. To get standalone matlab programs to run on linux operating systems it is necessary to set LD_LIBRARY_PATH like thus:
export LD_LIBRARY_PATH={$LD_LIBRARY_PATH}:/usr/local/MATLAB/MATLAB_Runtimev92/v92/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/sys/opengl/lib/glnxa64
The problem was, this broke R in the following way:
In grDevices::png(f) :
  unable to load shared object '/usr/lib64/R/library/grDevices/libs//cairo.so':
  /lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
Testing the R code independently I found it ran fine when run with sudo privileges. This didn't work because the MATLAB program wouldn't work when run with sudo privileges. Turns out, sudo privileges clear LD_LIBRARY_PATH: https://unix.stackexchange.com/questions/171262/ld-library-path-always-blank-after-sudo One workaround I found was to change my system call in MATLAB to call with sudo but its a sloppy fix since it requires the user to type their sudo password halfway through the program run. So I'm looking for a better fix.
Zachary Klamer (41 rep)
Jan 8, 2021, 08:59 PM • Last activity: May 29, 2025, 11:06 PM
1 votes
0 answers
183 views
Matlab crush with local glibc2.34 installed
I have Ubuntu20.04 and Matlab 2023b installed. When I start simulink(part of Matlab) the program crashes with: `Inconsistency detected by ld.so: ../elf/dl-tls.c: 517: _dl_allocate_tls_init: Assertion 'listp != NULL' failed!`, which is [well known issue](https://www.mathworks.com/matlabcentral/answer...
I have Ubuntu20.04 and Matlab 2023b installed. When I start simulink(part of Matlab) the program crashes with: Inconsistency detected by ld.so: ../elf/dl-tls.c: 517: _dl_allocate_tls_init: Assertion 'listp != NULL' failed!, which is [well known issue](https://www.mathworks.com/matlabcentral/answers/1454674-why-does-matlab-crash-on-linux-with-inconsistency-detected-by-ld-so-elf-dl-tls-c-597-_dl_allo) with newer Matlab versions with linux OS that goes with glibc older than version 2.34. [Official bug fix proposed by MathWorks](https://github.com/mathworks/build-glibc-bz-19329-patch) is to patch your glibc for your whole OS, which is not desirable in my case. [I saw one solution](https://www.mathworks.com/matlabcentral/answers/1567188-simulink-crash-in-ubuntu-20-04) that would be suitable for me, which is installing glibc2.34 locally and then adding its path to LD_LIBRARAY_PATH variable, only while running Matlab, which would result in only Matlab using the other version of glibc. I have followed [this steps](https://askubuntu.com/questions/1345342/how-to-install-glibc-2-32-when-i-already-have-glibc2-31) to install glibc2.34 locally. I verified that it works with command:
user@hostname[~]: ~/glibc/glibc-2.34-install/bin/ldd --version
ldd (GNU libc) 2.34
Copyright (C) 2021 Free Software Foundation, Inc.
To oprogramowanie jest darmowe; warunki kopiowania są opisane w źródłach.
Autorzy nie dają ŻADNYCH gwarancji, w tym również gwarancji MOŻLIWOŚCI
SPRZEDAŻY lub PRZYDATNOŚCI DO KONKRETNYCH ZASTOSOWAŃ.
Autorami są Roland McGrath i Ulrich Drepper.
But after adding glibc/lib into LD_LIBRARAY_PATH, I got segfault error on simple binaries like ls:
user@hostname[~/glibc]❯ export LD_LIBRARY_PATH="/home/dsadowsk/glibc/glibc-2.34-install/lib:$LD_LIBRARY_PATH"
user@hostname[~/glibc]❯ ls
Segmentation fault
user@hostname[~/glibc]❯ /opt/matlab/R2023b/bin/matlab
Segmentation fault
It looks exactly like [this issue](https://unix.stackexchange.com/questions/272606/locally-installing-glibc-2-23-causes-all-programs-to-segfault) , but unfortunately I don't understand very well, how the solution works, and it doesn't work for the matlab here, as for ls command.
user@hostname[~/glibc]❯ /lib64/ld-linux-x86-64.so.2 --library-path /lib64 /bin/ls
build  glibc-2.34  glibc-2.34-install  glibc-2.34.tar.gz
user@hostname[~/glibc]❯ /lib64/ld-linux-x86-64.so.2 --library-path /lib64 /opt/matlab/R2023b/bin/matlab
/opt/matlab/R2023b/bin/matlab: error while loading shared libraries: /opt/matlab/R2023b/bin/matlab: invalid ELF header
How can I be able to run matlab binary with glibc2.34 installed locally and not for my whole system? Thank you for any thoughts you have.
DarKreter (11 rep)
Oct 16, 2024, 08:33 PM • Last activity: Oct 17, 2024, 08:05 AM
2 votes
1 answers
536 views
I cannot use the keyboard shortcut <ctrl>+<alt>+<enter> in matlab running in emacs running in screen
In my usual setup, I use use matlab-emacs to run Matlab through the Emacs GUI. I run Matlab and emacs on a Linux server, and use ssh and X forwarding so this all shows up on my local Ubuntu laptop. I would like to further complicate this setup by running emacs in screen. This mostly works with the n...
In my usual setup, I use use matlab-emacs to run Matlab through the Emacs GUI. I run Matlab and emacs on a Linux server, and use ssh and X forwarding so this all shows up on my local Ubuntu laptop. I would like to further complicate this setup by running emacs in screen. This mostly works with the notable exception that the keyboard shortcut Ctrl+Alt+Enter which tells Matlab to run a block of code, doesn't seem to do anything. I presume this shortcut is getting sent perhaps somewhere locally on my own machine? I notice the menu bar at the top of my terminal on my laptop changes when I try to run this command. Does anyone have a clever suggestion for how I can get Ctrl+Alt+Enter to run Matlab code blocks as expected?
ohnoplus (353 rep)
Aug 25, 2015, 11:38 PM • Last activity: Jan 26, 2024, 02:25 AM
1 votes
0 answers
106 views
How to properly kill a service upon shutdown?
I am having some issues with a component that I have installed recently, that is Matlab Drive Connector for Linux Fedora 37. The app itself works fine, interacts well with main Matlab program, but it annoys me very much upon shutdown of my machine. Seems like this application relies on a service tha...
I am having some issues with a component that I have installed recently, that is Matlab Drive Connector for Linux Fedora 37. The app itself works fine, interacts well with main Matlab program, but it annoys me very much upon shutdown of my machine. Seems like this application relies on a service that systemd can't properly terminate when I shutdown or reboot. Luckily there's a time limit after which the system forcefully terminates the service. An easy fix would be to manually stop the service using the application itself, running MATLABConnector stop, but I sometimes forget to type it in before shutdown. Any idea on how I can fix this issue? Having MATLABConnector stop run automatically before shutdown would solve the issue, but I honestly have no clue on how to perform that.
Luca Domeneghetti (11 rep)
Apr 3, 2023, 09:59 AM • Last activity: Apr 3, 2023, 02:58 PM
1 votes
1 answers
232 views
Arch Linux Matlab Command Window creation failed
I just changed a font in my matlab and when I reopened it, it crashes. I ran Matlab on steam deck, an arch linux based system. The following is the log. MATLAB is selecting SOFTWARE OPENGL rendering. MESA-LOADER: failed to open radeonsi: /home/deck/matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.s...
I just changed a font in my matlab and when I reopened it, it crashes. I ran Matlab on steam deck, an arch linux based system. The following is the log. MATLAB is selecting SOFTWARE OPENGL rendering. MESA-LOADER: failed to open radeonsi: /home/deck/matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/radeonsi_dri.so) (search paths /usr/lib/dri, suffix _dri) failed to load driver: radeonsi MESA-LOADER: failed to open kms_swrast: /home/deck/matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/kms_swrast_dri.so) (search paths /usr/lib/dri, suffix _dri) failed to load driver: kms_swrast MESA-LOADER: failed to open swrast: /home/deck/matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/swrast_dri.so) (search paths /usr/lib/dri, suffix _dri) failed to load swrast driver Gtk-Message: 23:26:44.587: Failed to load module "canberra-gtk-module"
Jack LI (11 rep)
Sep 5, 2022, 04:29 AM • Last activity: Sep 7, 2022, 03:01 PM
2 votes
2 answers
62 views
How to prevent Matlab filebrowser to do any changes in filesystem?
I get significant amount of artifacts in Matlab 2016a and 2016b, which are damaging my filesystem, etc random cursor movements moving my `Documents` folder to `Pictures`. I do not want that such actions are possible in Matlab because it is not stable in Linux. OS: Debian 64 bit Linux kernel: 4.6 of...
I get significant amount of artifacts in Matlab 2016a and 2016b, which are damaging my filesystem, etc random cursor movements moving my Documents folder to Pictures. I do not want that such actions are possible in Matlab because it is not stable in Linux. OS: Debian 64 bit Linux kernel: 4.6 of backports Hardware: Asus Zenbook UX303UA Matlab: 2016a, 2016b prerelease
L&#233;o L&#233;opold Hertz 준영 (7138 rep)
Oct 7, 2016, 01:59 PM • Last activity: Sep 4, 2022, 09:20 AM
0 votes
0 answers
278 views
How can I open MATLAB R2022a hosted on macOS over X11?
Question: **How can I open MATLAB R2022a hosted on macOS over X11?** I recently installed MATLAB R2022A on macOS, replacing an older Mac with an old 2017 installation. The license is a Network Named User license, and the license is working. However, we are having a problem with using MATLAB over X11...
Question: **How can I open MATLAB R2022a hosted on macOS over X11?** I recently installed MATLAB R2022A on macOS, replacing an older Mac with an old 2017 installation. The license is a Network Named User license, and the license is working. However, we are having a problem with using MATLAB over X11. I should note that X11 is working in general, with both IDL and xeyes working over the same client-host connection, so this is a MATLAB configuration or application issue. MATLAB works when used locally on the new Mac by a named user. It opens graphically when the app is double-clicked, and in Terminal we can call the $MATLABROOT/bin/matlab binary, which also opens the GUI app. When users SSH into the system and use that binary, MATLAB opens headlessly. This is also true when they use the "-desktop" argument (which should not be needed, but we tested). Additionally, when we run MATLAB in this headless mode and then use the command "desktop" receive an error message: /Applications/MATLAB_R2022a.app/bin/matlab -desktop Copyright 1984-2022 The MathWorks, Inc. R2022a Update 3 (9.12.0.1975300) 64-bit (maci64) June 2, 2022 To get started, type doc. For product information, visit www.mathworks.com. >> desktop Error using desktop The Desktop is not available in this configuration Error in desktop >> I called Mathworks over this issue and received a reply that they didn't provide assurance of remote usability, or support for remote usage. In MATLAB 2017 this was all seamless. A user would see the application GUI over X11 when the user executed the binary over SSH. X11 forwarding is enabled in sshd_config on the server and I stage an ssh_config file on all related clients which includes X11 forwarding automatically. All other X11 purposes, such as IDL and xeyes, are working.
MasterOfNone (101 rep)
Aug 2, 2022, 08:03 PM • Last activity: Aug 3, 2022, 04:14 PM
0 votes
2 answers
394 views
Cannot link to matlab libmat.so and libmx.so under Eclipse IDE
I am trying to compile **matcreat.cpp** under **Eclipse C++ IDE**. It allows to exchange matlab data with c++ programs. At some point I compile the program : /* * matcreat.cpp - MAT-file creation program * * See the MATLAB External Interfaces/API Guide for compiling information. * * Calling syntax:...
I am trying to compile **matcreat.cpp** under **Eclipse C++ IDE**. It allows to exchange matlab data with c++ programs. At some point I compile the program : /* * matcreat.cpp - MAT-file creation program * * See the MATLAB External Interfaces/API Guide for compiling information. * * Calling syntax: * * matcreat * * Create a MAT-file which can be loaded into MATLAB. * * This program demonstrates the use of the following functions: * * matClose * matGetVariable * matOpen * matPutVariable * matPutVariableAsGlobal * * Copyright 1984-2007 The MathWorks, Inc. */ #include #include /* For strcmp() */ #include /* For EXIT_FAILURE, EXIT_SUCCESS */ #include /* For STL */ #include "mat.h" #define BUFSIZE 256 int main() { MATFile *pmat; mxArray *pa1, *pa2, *pa3; std::vector myInts; myInts.push_back(1); myInts.push_back(2); printf("Accessing a STL vector: %d\n", myInts); double data = { 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0 }; const char *file = "mattest.mat"; char str[BUFSIZE]; int status; printf("Creating file %s...\n\n", file); pmat = matOpen(file, "w"); if (pmat == NULL) { printf("Error creating file %s\n", file); printf("(Do you have write permission in this directory?)\n"); return(EXIT_FAILURE); } pa1 = mxCreateDoubleMatrix(3,3,mxREAL); if (pa1 == NULL) { printf("%s : Out of memory on line %d\n", __FILE__, __LINE__); printf("Unable to create mxArray.\n"); return(EXIT_FAILURE); } pa2 = mxCreateDoubleMatrix(3,3,mxREAL); if (pa2 == NULL) { printf("%s : Out of memory on line %d\n", __FILE__, __LINE__); printf("Unable to create mxArray.\n"); return(EXIT_FAILURE); } memcpy((void *)(mxGetPr(pa2)), (void *)data, sizeof(data)); pa3 = mxCreateString("MATLAB: the language of technical computing"); if (pa3 == NULL) { printf("%s : Out of memory on line %d\n", __FILE__, __LINE__); printf("Unable to create string mxArray.\n"); return(EXIT_FAILURE); } status = matPutVariable(pmat, "LocalDouble", pa1); if (status != 0) { printf("%s : Error using matPutVariable on line %d\n", __FILE__, __LINE__); return(EXIT_FAILURE); } status = matPutVariableAsGlobal(pmat, "GlobalDouble", pa2); if (status != 0) { printf("Error using matPutVariableAsGlobal\n"); return(EXIT_FAILURE); } status = matPutVariable(pmat, "LocalString", pa3); if (status != 0) { printf("%s : Error using matPutVariable on line %d\n", __FILE__, __LINE__); return(EXIT_FAILURE); } /* * Ooops! we need to copy data before writing the array. (Well, * ok, this was really intentional.) This demonstrates that * matPutVariable will overwrite an existing array in a MAT-file. */ memcpy((void *)(mxGetPr(pa1)), (void *)data, sizeof(data)); status = matPutVariable(pmat, "LocalDouble", pa1); if (status != 0) { printf("%s : Error using matPutVariable on line %d\n", __FILE__, __LINE__); return(EXIT_FAILURE); } /* clean up */ mxDestroyArray(pa1); mxDestroyArray(pa2); mxDestroyArray(pa3); if (matClose(pmat) != 0) { printf("Error closing file %s\n",file); return(EXIT_FAILURE); } /* * Re-open file and verify its contents with matGetVariable */ pmat = matOpen(file, "r"); if (pmat == NULL) { printf("Error reopening file %s\n", file); return(EXIT_FAILURE); } /* * Read in each array we just wrote */ pa1 = matGetVariable(pmat, "LocalDouble"); if (pa1 == NULL) { printf("Error reading existing matrix LocalDouble\n"); return(EXIT_FAILURE); } if (mxGetNumberOfDimensions(pa1) != 2) { printf("Error saving matrix: result does not have two dimensions\n"); return(EXIT_FAILURE); } pa2 = matGetVariable(pmat, "GlobalDouble"); if (pa2 == NULL) { printf("Error reading existing matrix GlobalDouble\n"); return(EXIT_FAILURE); } if (!(mxIsFromGlobalWS(pa2))) { printf("Error saving global matrix: result is not global\n"); return(EXIT_FAILURE); } pa3 = matGetVariable(pmat, "LocalString"); if (pa3 == NULL) { printf("Error reading existing matrix LocalString\n"); return(EXIT_FAILURE); } status = mxGetString(pa3, str, sizeof(str)); if(status != 0) { printf("Not enough space. String is truncated."); return(EXIT_FAILURE); } if (strcmp(str, "MATLAB: the language of technical computing")) { printf("Error saving string: result has incorrect contents\n"); return(EXIT_FAILURE); } /* clean up before exit */ mxDestroyArray(pa1); mxDestroyArray(pa2); mxDestroyArray(pa3); if (matClose(pmat) != 0) { printf("Error closing file %s\n",file); return(EXIT_FAILURE); } printf("Done\n"); return(EXIT_SUCCESS); } At some point the program depends on libmat.so and libmx.so Matlab API so I wonder how to link it under Eclipse. Without any link I get 18:57:21 **** Incremental Build of configuration Debug for project essai **** make all Building target: essai Invoking: GCC C++ Linker g++ -o "essai" ./matcreat.o /usr/bin/ld : ./matcreat.o : dans la fonction « main » : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:44 : référence indéfinie vers « matOpen_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:51 : référence indéfinie vers « mxCreateDoubleMatrix_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:58 : référence indéfinie vers « mxCreateDoubleMatrix_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:64 : référence indéfinie vers « mxGetPr_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:66 : référence indéfinie vers « mxCreateString_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:73 : référence indéfinie vers « matPutVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:79 : référence indéfinie vers « matPutVariableAsGlobal_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:85 : référence indéfinie vers « matPutVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:96 : référence indéfinie vers « mxGetPr_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:97 : référence indéfinie vers « matPutVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:104 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:105 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:106 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:108 : référence indéfinie vers « matClose_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:116 : référence indéfinie vers « matOpen_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:125 : référence indéfinie vers « matGetVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:130 : référence indéfinie vers « mxGetNumberOfDimensions_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:135 : référence indéfinie vers « matGetVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:140 : référence indéfinie vers « mxIsFromGlobalWS_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:145 : référence indéfinie vers « matGetVariable_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:151 : référence indéfinie vers « mxGetString_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:162 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:163 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:164 : référence indéfinie vers « mxDestroyArray_800 » /usr/bin/ld : /home/baptiste/Code_Info/PLPLP4/PLPLP4_DEV/essai/Debug/../matcreat.cpp:166 : référence indéfinie vers « matClose_800 » collect2: erreur: ld a retourné le statut de sortie 1 make: *** [makefile:60 : essai] Erreur 1 "make all" terminated with exit code 2. Build might be incomplete. So I try following https://stackoverflow.com/questions/61220237/undefined-references-for-mat-h-in-c to put -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmx.so -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmat.so in poperties >> C++ Build >>Settings >>GCC C++ Linker >> Linker flags. I get 19:00:44 **** Incremental Build of configuration Debug for project essai **** make all Building target: essai Invoking: GCC C++ Linker g++ -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmx.so -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmat.so -o "essai" ./matcreat.o /usr/bin/ld : ne peut trouver -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmx.so /usr/bin/ld : ne peut trouver -l/usr/local/MATLAB/R2020b/bin/glnxa64/libmat.so collect2: erreur: ld a retourné le statut de sortie 1 make: *** [makefile:60 : essai] Erreur 1 "make all" terminated with exit code 2. Build might be incomplete Any Idea? I am new in C++, thanks in advance B
Bap23 (1 rep)
May 20, 2022, 03:04 PM • Last activity: May 22, 2022, 03:36 PM
2 votes
2 answers
1429 views
slow Matlab on Ubuntu LTS and ZERO Swap
I was using Matlab2012 under Win7 and my algorithm was consuming a huge amount of memory though it was fast (80 seconds for one iteration). Now I am using Matlab2013 under Ubuntu 12.04 LTS and though the usage of the RAM is very small, but the time is extremely higher than it was on windows (30 minu...
I was using Matlab2012 under Win7 and my algorithm was consuming a huge amount of memory though it was fast (80 seconds for one iteration). Now I am using Matlab2013 under Ubuntu 12.04 LTS and though the usage of the RAM is very small, but the time is extremely higher than it was on windows (30 minutes for the iteration and not finished untill now). As I said the RAM is showing a usage of 1G out of 8G ...while the swap is showing 0% of 8G. I checked the default value and it is 60, but not used by anyhow!! What might be the problem, and how to speed up Matlab the way it was before?
waleed shawki (21 rep)
Aug 1, 2013, 05:57 PM • Last activity: Apr 12, 2022, 09:07 AM
2 votes
1 answers
5934 views
Updating to GLIBC 2.34 for use with Matlab
I am running Matlab B2021b on a Linux mint machine. `uname -r ` output: ``` 5.14.0-1024-oem ``` I checked my GLIBC version and got this ``` ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is...
I am running Matlab B2021b on a Linux mint machine. uname -r output:
5.14.0-1024-oem
I checked my GLIBC version and got this
ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
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 Roland McGrath and Ulrich Drepper.
which tells me that I have glib version 2.31 which has a bug . On the MathWorks website the guy who reported the bug stated 3 solutions. The first one is to run open_system(new_system('abcdef123456')); bdclose('abcdef123456') in the console before opening a project but this results in the same crash as when running simulink. The second option is to use glib 2.34 or later which is what I am looking for. Is it possible to update to glib 2.34? Running sudo apt-get update && sudo apt-get upgrade does not seem to fix the issue. I am avoiding the last option because I am fairly certain that I will break my system trying to patch this bug and it is somewhat hard for me to pull off. I am not sure if the updated 2021a Matlab version is affected and using that version is my last resort
n3tw0rkrunner (21 rep)
Mar 26, 2022, 08:42 PM • Last activity: Apr 3, 2022, 11:59 AM
0 votes
1 answers
49 views
how to translate this bashrc code to suse 11 commands
I am trying to link MATLAB with Cadence Virtuoso (an electrical engineering software) in SUSE Linux 11, and I have manual PDF that is the guide to do so. My problem is that the commands that are given in the manual are not compatible with Linux SUSE. Does anyone know how to translate the following c...
I am trying to link MATLAB with Cadence Virtuoso (an electrical engineering software) in SUSE Linux 11, and I have manual PDF that is the guide to do so. My problem is that the commands that are given in the manual are not compatible with Linux SUSE. Does anyone know how to translate the following commands to SUSE compatible commands?
setenv LD_LIBRARY_PATH cds_root spectre/tools/dfII/lib:cds_root spectre/tools/lib:${LD_LIBRARY_PATH}
setenv MATLABPATH cds_root spectre/tools/spectre/matlab:${MATLABPATH}
TheDeparted (73 rep)
Dec 24, 2021, 08:23 PM • Last activity: Dec 24, 2021, 09:04 PM
0 votes
1 answers
333 views
Unvisible application content within VNC / XFCE
I do have a weird render issue of some applications that I'm running within a **tigervnc** session on a remote host where **XFCE** is started. As you can see from the screenshot, while applications display correctly their content (e.g. file browser, visual studio code, ..), the matlab window does no...
I do have a weird render issue of some applications that I'm running within a **tigervnc** session on a remote host where **XFCE** is started. As you can see from the screenshot, while applications display correctly their content (e.g. file browser, visual studio code, ..), the matlab window does not show its content. I believe this is **not a matlab related issue** since If I run matlab through a "ssh -X" session on the same host, it is displayed properly. It might be related, I have also seen that kind of rendering issue with matplotlib when triggering the pyplot.show(), the image is kind of transparent and we see the image to display mixed with the desktop background image. enter image description here If necessary, the xstartup script is
#!/bin/sh
# Start Xfce4 Desktop
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session xfce4-session &
and the vncserver is ran with vncserver -SecurityTypes None -depth 32 -geometry 1680x1050 -cleanstale Thank you very much for your help
Jeremy (3 rep)
Jul 18, 2021, 05:12 PM • Last activity: Jul 22, 2021, 03:02 PM
0 votes
1 answers
333 views
Matlab QT libraries prevent programs from running
I have `matlab` on my machine with `Compiler` toolbox. In order for compiler code to work, it needs access to libraries. They are supposed to be saved in `LD_LIBRARY_PATH` So I adjusted my `.bashrc` to include: MATLAB_LIB="/usr/local/MATLAB/MATLAB_Runtime/v95/runtime/glnxa64:/usr/local/MATLAB/MATLAB...
I have matlab on my machine with Compiler toolbox. In order for compiler code to work, it needs access to libraries. They are supposed to be saved in LD_LIBRARY_PATH So I adjusted my .bashrc to include: MATLAB_LIB="/usr/local/MATLAB/MATLAB_Runtime/v95/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v95/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v95/extern/bin/glnxa64" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MATLAB_LIB but now i cannot run many programs from the command line, e.g.: ~$ gnuplot gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Network.so.5: no version information available (required by gnuplot) gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Core.so.5: no version information available (required by gnuplot) gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Core.so.5: no version information available (required by gnuplot) gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Gui.so.5: no version information available (required by gnuplot) gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libtiff.so.5: no version information available (required by /lib/x86_64-linux-gnu/libgd.so.3) gnuplot: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libtiff.so.5: no version information available (required by /lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0) gnuplot: relocation error: gnuplot: symbol qt_version_tag version Qt_5.11 not defined in file libQt5Core.so.5 with link time reference or ~$ vim vim: symbol lookup error: /lib/x86_64-linux-gnu/libpython3.7m.so.1.0: undefined symbol: XML_SetHashSalt or ~$ kate kate: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Xml.so.5: no version information available (required by kate) kate: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Core.so.5: no version information available (required by kate) kate: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Core.so.5: no version information available (required by kate) kate: /usr/local/MATLAB/MATLAB_Runtime/v95/bin/glnxa64/libQt5Widgets.so.5: no version information available (required by kate... If i remove the definition of the libraries from the .bashrc file, all works well. Is there something that i can do to avoid these problems other than remove the path to the libraries in the .bashrc file?
atapaka (675 rep)
Jun 16, 2021, 06:23 PM • Last activity: Jun 17, 2021, 02:07 AM
0 votes
2 answers
307 views
Can not set PATH permanently in order to launch MATLAB system wide
I have the following issue: I recently installed MATLAB R2018a in my artix linux (runit). I can launch matlab from the location where the launcher is, i.e., `/usr/local/MATLAB/R2018a/bin`, but if I try to launch it from another location I can't. So I tried to append the mentioned directory to PATH w...
I have the following issue: I recently installed MATLAB R2018a in my artix linux (runit). I can launch matlab from the location where the launcher is, i.e., /usr/local/MATLAB/R2018a/bin, but if I try to launch it from another location I can't. So I tried to append the mentioned directory to PATH with different methods: PATH=$PATH:/usr/local/MATLAB/R2018a/bin export PATH If I check with echo PATH, it shows the directory, but after reboot the directory is not in PATH anymore. As the above method failed, I edited ~/.bashrc: export MATLAB_HOME=/usr/local/MATLAB/R2018a/bin export PATH=$PATH:$MATLAB_HOME then I sourced the file. If I check with echo $PATH it shows the directory, but after reboot the directory is not in $PATH anymore. The last method failed too, so I edited ~/.config/shell/profile the same result as before. Can anybody tell what I am doing wrong? I am new to artix runit so maybe I made a big mistake. Thanks in advance!
Arturo (3 rep)
Jan 15, 2021, 05:30 PM • Last activity: Feb 3, 2021, 04:54 PM
2 votes
1 answers
1489 views
Matlab showing blank screen when I connect remotely with xrdp in CentOS 7
If I use my CentOS 7 computer everything works fine but when I connect remotely (I have tried connecting from Ubuntu and Windows xrdp clients) everything works fine too except Matlab which shows a blank screen. [![enter image description here][2]][2] [1]: https://i.sstatic.net/zabp8.png [2]: https:/...
If I use my CentOS 7 computer everything works fine but when I connect remotely (I have tried connecting from Ubuntu and Windows xrdp clients) everything works fine too except Matlab which shows a blank screen. enter image description here It is a visual bug because I click on the blank screen and It does stuff. I can't understand why this only happens when connecting remotely. I have tried using gnome and xfce desktop environments and nothing changes. Also I have other Ubuntu computers which I connect remotely and Matlab works fine there.
David1212k (131 rep)
Jan 28, 2021, 09:40 AM • Last activity: Jan 29, 2021, 09:21 AM
9 votes
3 answers
44447 views
Set LD_LIBRARY_PATH correctly
I am using Docker with image of Ubuntu 16.04. I am using this docker to run: - Import C++ classes in python with the help of boost.python - Import matlab's python package in python with the help Matlab Runtime (MCR). Before I have installed MCR in the docker, I have installed boost using: $ sudo apt...
I am using Docker with image of Ubuntu 16.04. I am using this docker to run: - Import C++ classes in python with the help of boost.python - Import matlab's python package in python with the help Matlab Runtime (MCR). Before I have installed MCR in the docker, I have installed boost using: $ sudo apt-get install -y libboost-all-dev and I was able to wrap C++ classes and call them in python. Then I have installed MCR and one of the requirement is to set LD_LIBRARY_PATH to Matlab's library. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB/MATLAB_Runtime/v94/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/extern/bin/glnxa64 It worked, I was able to run matlab's python package in python but testing the C++ classes wrappers failed due to change of LD_LIBRARY_PATH. For example, I get the following error when I try to import C++ class in python: /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0: undefined symbol: XML_SetHashSalt If I unset LD_LIBRARY_PATH C++ import works but MCR fails. So the question what LD_LIBRARY_PATH should be in order to run both C++ classes and Matlab's python package successfully? I have tried to add path to boost libraries to LD_LIBRARY_PATH but didn't work, so the env value would be: /usr/lib/x86_64-linux-gnu:/usr/local/MATLAB/MATLAB_Runtime/v94/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v94/extern/bin/glnxa64 **EDIT** the dependencies of C++ library file before setting the LD_LIBRARY_PATH: linux-vdso.so.1 (0x00007ffcee0dc000) libpython3.4m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0 (0x00007f9d69e59000) libboost_python-py34.so.1.55.0 => /usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.55.0 (0x00007f9d69c09000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9d698fe000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9d695fd000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9d693e7000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9d6903c000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9d68e34000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f9d68c0b000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9d689f0000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9d687d3000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9d685cf000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f9d683cc000) /lib64/ld-linux-x86-64.so.2 (0x00007f9d6a6c3000) After setting the LD_LIBRARY_PATH: linux-vdso.so.1 (0x00007ffc42e9b000) libpython3.4m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0 (0x00007fad9635b000) libboost_python-py34.so.1.55.0 => /usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.55.0 (0x00007fad9610b000) libstdc++.so.6 => /usr/local/MATLAB/MATLAB_Runtime/v94/sys/os/glnxa64/libstdc++.so.6 (0x00007fad95d8a000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fad95a89000) libgcc_s.so.1 => /usr/local/MATLAB/MATLAB_Runtime/v94/sys/os/glnxa64/libgcc_s.so.1 (0x00007fad95873000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fad954c8000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fad952c0000) libexpat.so.1 => /usr/local/MATLAB/MATLAB_Runtime/v94/bin/glnxa64/libexpat.so.1 (0x00007fad95095000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fad94e7a000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fad94c5d000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fad94a59000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fad94856000) /lib64/ld-linux-x86-64.so.2 (0x00007fad96bc5000)
Coderji (117 rep)
Aug 15, 2018, 01:45 PM • Last activity: Jan 20, 2021, 11:04 PM
1 votes
0 answers
249 views
MariaDB connector (remote)
I'm new to databases and have some very basic how-to/where-to questions: 1. I have successfully setup a MariaDB + phpmyadmin on my raspberrypi zero (running the latest diet-pi), including a database with a couple of columns, which works like a charm. 2. Now, under Windows, I would like to import the...
I'm new to databases and have some very basic how-to/where-to questions: 1. I have successfully setup a MariaDB + phpmyadmin on my raspberrypi zero (running the latest diet-pi), including a database with a couple of columns, which works like a charm. 2. Now, under Windows, I would like to import the data into Matlab, using adodb_connect(), created by the community (link ), to analyze some data that I stored in the database. From the docs of that file: > Package adodb_toolbox allows communication with different types of databases through Microsoft's ADO (ActiveX Data Objects) OLEDB component. The package was designed to work on Microsoft SQL Server, Oracle, Microsoft Access, MySQL and other databases. However I can't find good and straightforward guide on how to install ODBC on my raspberry pi (as far as I understand MariaDB should, for all intents and purposes, classify as a 'MYSQL database'), this usually means I'm not following the most common implementations anymore, which is why I'm asking for some general questions (after reading/googling): - Would you (e.g. a poweruser or expert) have advice on a more straight forward option to import the data to Matlab (or even Java, or even Windows) from my SQL database rather than this OLEDB interface? (the goal here is to make the database as accessible as possible) - Is there a good guide or resource I should follow to install this (database connector or whatever would be more advisable) on my raspberry pi? thanks!
user2305193 (143 rep)
Sep 30, 2020, 06:12 PM
3 votes
0 answers
1500 views
in KDE, can I create a rule that makes a new window appear in the desktop of the app that created it?
This has been asked before: https://unix.stackexchange.com/q/203906/324792, but it was for a different WM, and there are no answers. Maybe there is an answer for KDE? I am using virtual desktops to organize things. I want different desktops to be different environments that don't interfere with each...
This has been asked before: https://unix.stackexchange.com/q/203906/324792 , but it was for a different WM, and there are no answers. Maybe there is an answer for KDE? I am using virtual desktops to organize things. I want different desktops to be different environments that don't interfere with each other. However, when an application, in a desktop I'm not currently in, opens a new window, it will be created in my current desktop. This is usually annoying (unless I'm not doing any interactive work), and it always breaks the order I'm trying to keep. I have tried the "Special window settings" option, but it seems that there are only two general options - 1. Force a window (configurable class etc.) to always appear on a _specific_ desktop (which is not what I want) - there are details of when and how but no way to say "the window of the creating app" 2. Not forcing at all - in which case, new windows will appear on the _current_ desktop, which is what I have now. What I want, and can't find, is simply a way to make new windows appear in the same desktop as the application (window? process?) that created them. I'm using KDE 4.3.5, and I only have user privileges. The application in question is usually (but not always) Matlab.
laugh salutes Monica C (81 rep)
Jun 21, 2020, 09:34 AM • Last activity: Jun 26, 2020, 11:15 AM
0 votes
1 answers
467 views
memory increase after completion of scripts
(I am new user of linux). I am running several matlab scripts in parallel using nohup in this form: (cd Documents/dir_001; nohup matlab -nodisplay -nosplash -nodesktop -r "run('/home/user/Documents/dir_001/myScript.m')") & (cd Documents/dir_002; nohup matlab -nodisplay -nosplash -nodesktop -r "run('...
(I am new user of linux). I am running several matlab scripts in parallel using nohup in this form: (cd Documents/dir_001; nohup matlab -nodisplay -nosplash -nodesktop -r "run('/home/user/Documents/dir_001/myScript.m')") & (cd Documents/dir_002; nohup matlab -nodisplay -nosplash -nodesktop -r "run('/home/user/Documents/dir_002/myScript.m')") & (cd Documents/dir_003; nohup matlab -nodisplay -nosplash -nodesktop -r "run('/home/user/Documents/dir_003/myScript.m')") & I notice (by using top -u ) that when my scripts finish their routines (I can tell it is finished by looking at directories, when a directory is empty then a script has completed it job) the memory associated to the scripts start to increase progressively. I have to kill the PID to prevent it to keep growing. My questions: - Why does not the memory usage go to minimum value if not zero right after the script finish its routine? - Why does the memory increase? when running a script it consumes 1% of memory, and after completion it keeps growing to values 1.3%, 1.5%, 1.9%, 2%, and so on. How can I fix it? I would like to automatically kill the PID after a script is completed
Bur Nor (3 rep)
Jun 19, 2020, 08:40 PM • Last activity: Jun 19, 2020, 09:33 PM
0 votes
1 answers
1421 views
Matlab License: License checkout failed. License Manager Error -9
Im on Linux Manjaro. I tried everything that came to my mind but I'm still getting this error: ```bash [john@john-pc bin]$ sudo ./matlab License checkout failed. License Manager Error -9 Your username does not match the username in the license file. To run on this computer, you must run the Activati...
Im on Linux Manjaro. I tried everything that came to my mind but I'm still getting this error:
[john@john-pc bin]$ sudo ./matlab
License checkout failed.
License Manager Error -9
Your username does not match the username in the license file. 
To run on this computer, you must run the Activation client to reactivate your license.

Troubleshoot this issue by visiting: 
https://www.mathworks.com/support/lme/R2020a/9 

Diagnostic Information:
Feature: MATLAB 
License path: /root/.matlab/R2020a_licenses:/usr/local/MATLAB/R2020a/licenses/license.dat:/usr/local/MATLAB/R2020a
/licenses/license_john-pc_40911196_R2020a.lic 
Licensing error: -9,57.
I ran ./activate_matlab.sh and activated it through the license file AND login into MathWorks online. I deleted the installation .lic in R2020a/license/ and created a new one. I tried creating a license file with every mac address I could find. Nothing works. I keep getting this error. Only once I managed to use Matlab, which was right after installing it. Then after the first time closing it I'm I have been stuck on this error for 2 days. Please help me.
John (197 rep)
Jun 4, 2020, 12:53 PM • Last activity: Jun 4, 2020, 02:01 PM
Showing page 1 of 20 total questions