Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Can not set PATH permanently in order to launch MATLAB system wide (Read 1053 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Can not set PATH permanently in order to launch MATLAB system wide

Hi to all,

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:

i)      PATH=$PATH:/usr/local/MATLAB/R2018a/bin
        export PATH

If i check with echo PATH it schows the directory, but after reboot the directory is not in PATH anymore.

ii) As the before method failed i edited ~/.bashrc:

export MATLAB_HOME=/usr/local/MATLAB/R2018a/bin
export PATH=$PATH:$MATLAB_HOME

then i source the file. 
If i check with echo PATH it schows the directory, but after reboot the directory is not in PATH anymore.

iii) 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!

 

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #1
try put your PATH environment variable to /etc/profile.d

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #2
Thanks for the answer. But how should i do it? I guess that i have to create a sh script, but how should i name it? Or this is of no relevance?

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #3
look the another *.sh files in etc/profile.d
create new file.sh and put in to your
"export MATLAB_HOME=/usr/local/MATLAB/R2018a/bin
export PATH=$PATH:$MATLAB_HOME"

after reboot or "source /etc/profile.d/yournewfile.sh" should it works

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #4
Reading /etc/profile is helpful too. You can use append_path '/some/path' too, as explained in /etc/profile. In /etc/profile.d as well as the .sh files read by /etc/profile I have some .csh files provided by some installed packages, that appear to be used when you are using csh instead of BASH, so the name may vary if you are using a different shell.
There also seems to be an inconsistent feature here:
/etc/profile.d/locale.sh is owned by filesystem 2020.09.03-1
First line:
#!/bin/sh
The shebang isn't required with the current set up. If it's there for compatibility with other shells, then other files are missing this. I suppose it's treated as a comment in this usage and ignored.

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #5
First line:
#!/bin/sh
[/quote]

none of profiles.d/*.sh files use  #!/bin/sh, so do not add it !


Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #7
Hi, thanks for your help.

Alium, your sugestion was thw solution. Now the matlab's executable directory  is in $PATH permanently and can launch from terminal from any location. But some issue persists... If i try to launch from dmenu (i have dwm wm) it appears in the menu but can't launch. What could be the problem in this case?

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #8
maybe some wrong path set in /usr/share/applications/matlab.desktop ?  (i don't know dmenu/dwm - never used that, so i just guess) 

can you find out where dmenu gets instructions on what to run? it should use /usr/share/applications/matlab.desktop too (i guess)

did you use this source? https://aur.archlinux.org/packages/matlab/

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #9
Alium, i will give a try to your suggestion. The strange thing is that if i put in dmenu matlab -desktop, it works.

 

Re: Can not set PATH permanently in order to launch MATLAB system wide

Reply #10
Hi to all,

I found that from dmenu i have to write
Code: [Select]
matlab -desktop
in order to launch matlab from there.  So i thimk that this post can be considered as solved. Many thanks to all for your help.