Can I install MATLAB in Bash on Ubuntu on Windows?

조회 수: 399(최근 30일)
The Windows 10 Anniversary update (Windows 10 build 1607) has an option to install a Bash shell based on a minimal Ubuntu 14.04 environment. Can I install MATLAB in this environment?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2018년 12월 5일
Bash on Ubuntu on Windows is a minimal installation of Ubuntu and therefore lacks many of the libraries that MATLAB requires to install and run that would be present in a normal Ubuntu Linux installation. This configuration is not qualified for MATLAB.
  댓글 수: 8
Caterina Brighi
Caterina Brighi 2020년 9월 15일
Hi, I am having troubles with the installation of Matlab R2020a on my Ubuntu 18.04 WSL2. I am trying to use the silent installation instructions, by populating the installer_inut.txt file with the output folder, activation key, etc... the command run, but no folder gets created in my output directory. Any advice on how to fix this?
Thanks

댓글을 달려면 로그인하십시오.

추가 답변(12개)

Winston Yu
Winston Yu 2018년 8월 17일
편집: Walter Roberson 2018년 8월 17일
There are several things need to be fixed for default ubuntu on Windows 10
1. update basic library (for R2018a, MATLAB use glibc 3.4.22)
sudo apt-get install libstdc++6
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
2. install display library like mesa library (assume you are using opengl)
apt-get install mesa-utils
3. install jdk
apt-get install default-jdk
4. install execstack
apt-get install execstack
5. As George Yammine suggest, clean ELF of blas and lapack library, at matlabroot/bin/glnxa64, run command:
execstack -c libmwblas.so
execstack -c libmwlapack.so
execstack -s MATLAB
  댓글 수: 4
Mahmod Karndash
Mahmod Karndash 2022년 6월 5일
at step 5 < As George Yammine suggest, clean ELF of blas and lapack library, at matlabroot/bin/glnxa64, run command:
execstack -c libmwblas.so>
I have this error
root@DESKTOP-SMROJT0:/root/softwares/R2018a/bin/glnxa64# execstack -c libmwblas.so
execstack: cannot open "libmwblas.so": No such file or directory
please help

댓글을 달려면 로그인하십시오.


Winston Yu
Winston Yu 2022년 5월 21일
Mathworks now have mpm package to installing Linux binary: matlab-dockerfile/MPM.md at main · mathworks-ref-arch/matlab-dockerfile · GitHub
So, on WSL2, run these steps
sudo apt-get install -y unzip
wget https://www.mathworks.com/mpm/glnxa64/mpm
chmod +x mpm
./mpm install --release=R2018a --destination=/usr/local/MATLAB/R2018a MATLAB
Then MATLAB will be installed /usr/local/MATLAB/R2018a
Mahmod, you can't use /mnt/d to do any installation operation and also can't install MATLAB at /mnt/d, /mnt is Windows NTFS filesystem, can't be used as true Linux file system, you need to install the software somewhere else.
  댓글 수: 3
Yuquan Xu
Yuquan Xu 2023년 3월 6일 20:35
This is the best solution I have found. Thank you so so much! Just use mpm to install Matlab and any add-ons you like, but for matlab, you still need to do a silent acitivation.

댓글을 달려면 로그인하십시오.


Winston Yu
Winston Yu 2022년 5월 22일
Mahmod :
Same as /mnt/d, /mnt/c is not a good place to install any WSL2 based software, it's NTFS also. you have to install the software not on /mnt and not use anything at /mnt during the installation.
I feel that your WSL2 installation is corrupted, the error message like:
mkdir: cannot create directory ‘/home/daren/.cache’: Permission denied
indicate that something wrong with your WSL2 installation
Winston
  댓글 수: 2
Mahmod Karndash
Mahmod Karndash 2022년 5월 24일
I have wsl2 and I check the version of WSL each is set to by entering the command: wsl -l -v in PowerShell and I have
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\Daren> wsl -l -v
NAME STATE VERSION
* Ubuntu-16.04 Running 2
PS C:\Users\Daren>
but when i run the following commands in ubuntu terminal
export DISPLAY=:0
export LIBGL_ALWAYS_INDIRECT=1
startlxde ( main command to run the desktop)
i have error
mkdir: cannot create directory ‘/home/daren/.cache’: Permission denied
-bash: /home/daren/.cache/wslu/integration: Permission denied
daren@DESKTOP-SMROJT0:~$ sudo -s
[sudo] password for daren:
root@DESKTOP-SMROJT0:~# export DISPLAY=:0
root@DESKTOP-SMROJT0:~# export LIBGL_ALWAYS_INDIRECT=1
root@DESKTOP-SMROJT0:~# startlxde
Agent pid 555
** Message: main.vala:99: Session is LXDE
** Message: main.vala:100: DE is LXDE
(lxsession:553): Gtk-WARNING **: cannot open display: :0
root@DESKTOP-SMROJT0:~#
and I can not see the lxde desktop
please help me to install wsl2 and desktop (GUI) in WSL and how to install matlab r2018a in wsl As mentioned in the priorTuturial https://www.mathworks.com/matlabcentral/answers/uploaded_files/1007325/PSI%20using%20SNAP_STAMPS%20tutorial%201%20_Installation%20and%20preperation%20(2).pdf
My processing of the data in my thesis is contingent on that and I don't have much time
Please forgive my ignorance in these topics, and thank you very much for your support and help

댓글을 달려면 로그인하십시오.


Enrico Schulz
Enrico Schulz 2017년 9월 18일
Which library is exactly missing? It is very easy to add every needed library. There's lot of software that is actually runing, including graphical nautilus, synaptic, FSL etc. with xlaunch.
matlab -nodesktop -nodisplay -nojvm -nosplash Without the need for any graphical output I am running into the following error message: MATLAB: detail/MvmLocalBoundMethods.cpp:114: static void mvm::detail::MvmLocalBoundMethods::initMethods(bool): Assertion `Failed to open local mvm library: libmwblas.so: cannot enable executable stack as shared object requires: Invalid argument' failed. Aborted (core dumped)
Best wishes!
  댓글 수: 2
Philip Borghesani
Philip Borghesani 2017년 11월 3일
편집: MathWorks Support Team 2020년 1월 2일
That error appears to be related to this missing feature: cannot enable executable stack as shared object requires. No missing library is causing the issue.

댓글을 달려면 로그인하십시오.


Mufti Mahmud
Mufti Mahmud 2017년 10월 2일
Dear MathWorks Support Team,
as the installation goes on well without any problem, would it be possible to let us know the required libraries to run which we may try to install manually and use it from the Bash!
That would be great!
Many thanks!

alexandre obert
alexandre obert 2017년 10월 27일
The same error occurred when trying to implement Runtime through linux native programs - I've got ths error with freesurfer. I do not find any valuable solution by now...
  댓글 수: 2
alexandre obert
alexandre obert 2017년 11월 6일
Hi Kyle, Thanks, I'll contact you asap!

댓글을 달려면 로그인하십시오.


Philip Borghesani
Philip Borghesani 2017년 11월 3일
I am curious Why would anyone want to do this? I can think of a few reasons, that I don't think are very good, but can think of no showstopper reason. I am not going to list my ideas here to avoid tainting the list.
What problem do you expect to solve or feature do you expect to gain by running Linux MATLAB on Windows instead of Windows MATLAB? Please post responses as comments to this answer.
  댓글 수: 11
Mahmod Karndash
Mahmod Karndash 2022년 4월 25일
Please help , how do you install Matlab 2018a for Linux on Ubuntu WSL.I am using ubuntu16.04 wsl and I tried to install matlab r2018a but I can not, please help
When running the Installer on Linux, I see the below in terminal:
Preparing installation files …
Installing …
Finished.
the installer does not launch and MATLAB is not installed.
root@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives installer_input.txt patents.txt version.txt
bin install_guide.pdf readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo ./install
Preparing installation files …
Installing …
Finished
root@DESKTOP-SMROJT0:/mnt/d/R2018a#
I tried using the suggested solution from mathworks but it didn’t work:
oot@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives install_guide.pdf patents.txt version.txt
bin installer_input.txt readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo chmod -R 777 matlab_R2018a_glnxa64
chmod: cannot access ‘matlab_R2018a_glnxa64’: No such file or directory
root@DESKTOP-SMROJT0:/mnt/d/R2018a#
please help وMy work and results are stalled because of that
thank you in advance

댓글을 달려면 로그인하십시오.


Francois
Francois 2018년 3월 9일
Is there any hope for having this working at some point?
The one thing I tried for getting rid of these errors is the following:
execstack -s glnxa64/libmwblas.so
execstack -s glnxa64/libmwlapack.so
But then the execution simply stops after displaying the message "MATLAB is selecting SOFTWARE OPENGL rendering", without any error.
This would be helpful for setting up some specific research software environments, that require combinations of many programs (MATLAB, SPM, FreeSurfer, ...) in Windows environments.

Sabyasachi Ghosh
Sabyasachi Ghosh 2021년 10월 22일
Is this still not possible, even with WSLg? I get the following error:
```
./install
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to launch web window with error: Unable to launch the MATLABWindow application. The exit code was: 127
Aborted
```
  댓글 수: 1
cui
cui 2021년 11월 27일
Is your platform windows 10 or 11, WSLg is not supported on windows 10, and windows 11 is still immature?

댓글을 달려면 로그인하십시오.


Mahmod Karndash
Mahmod Karndash 2022년 5월 20일
Please help , how do you install Matlab 2018a for Linux on Ubuntu WSL.I am using ubuntu16.04 wsl and I tried to install matlab r2018a but I can not, please help
When running the Installer on Linux, I see the below in terminal:
Preparing installation files …
Installing …
Finished.
the installer does not launch and MATLAB is not installed.
root@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives installer_input.txt patents.txt version.txt
bin install_guide.pdf readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo ./install
Preparing installation files …
Installing …
Finished
root@DESKTOP-SMROJT0:/mnt/d/R2018a#
I tried using the suggested solution from mathworks but it didn’t work:
root@DESKTOP-SMROJT0:/mnt/d/R2018a# ls
activate.ini install licenses ui
archives install_guide.pdf patents.txt version.txt
bin installer_input.txt readme.txt
etc java sys
help license_agreement.txt trademarks.txt
root@DESKTOP-SMROJT0:/mnt/d/R2018a# sudo chmod -R 777 matlab_R2018a_glnxa64
chmod: cannot access ‘matlab_R2018a_glnxa64’: No such file or directory
root@DESKTOP-SMROJT0:/mnt/d/R2018a#
please help وMy work and results are stalled because of that
thank you in advance

Mahmod Karndash
Mahmod Karndash 2022년 5월 22일
편집: Walter Roberson 2022년 5월 22일
mkdir: cannot create directory ‘/home/daren/.cache’: Permission denied
-bash: /home/daren/.cache/wslu/integration: Permission denied
-bash: /home/daren/.cache/wslu/integration: Permission denied
daren@DESKTOP-SMROJT0:/mnt/c/WINDOWS/system32$ sudo apt-get install -y
[sudo] password for daren:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
daren@DESKTOP-SMROJT0:/mnt/c/WINDOWS/system32$ wget https://www.mathworks.com/mpm/glnxa64/mpm
--2022-05-22 11:19:00-- https://www.mathworks.com/mpm/glnxa64/mpm
Resolving www.mathworks.com (www.mathworks.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.mathworks.com’
daren@DESKTOP-SMROJT0:/mnt/c/WINDOWS/system32$ wget https://www.mathworks.com/mpm/glnxa64/mpm
--2022-05-22 12:01:53-- https://www.mathworks.com/mpm/glnxa64/mpm
Resolving www.mathworks.com (www.mathworks.com)... 104.122.196.55
Connecting to www.mathworks.com (www.mathworks.com)|104.122.196.55|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-05-22 12:01:54 ERROR 404: Not Found.
daren@DESKTOP-SMROJT0:/mnt/c/WINDOWS/system32$
please help ,,,,thank you in advance
  댓글 수: 4

댓글을 달려면 로그인하십시오.


Jestzer
Jestzer 2023년 3월 6일 20:52
편집: Jestzer 2023년 3월 6일 20:54
For installation alone, you can use MATLAB Package Manager to do an installation with minimal fuss.
However, you'll probably still have issues launching MATLAB because you're probably missing plenty of libraries. To see which ones you're missing, run the MATLABWindow application until you no longer get any library errors and it launches. By default, MATLAB R2022b installs to /usr/local/MATLAB/R2022b and the MATLABWindow application is in /usr/local/MATLAB/R2022b/bin/glnxa64. Its name is literally MATLABWindow, so you can do ./MATLABWindow once you've cd'd into the folder. Obviously, you'll need to change folder I mentioned above if you're not using R2022b or installed it elsewhere.
This approach worked for me on WSL2 with Ubuntu and Debian. If you don't know which libraries to install, use this search page.

범주

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

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by