# Has anybody used recent versions of MATLAB on FreeBSD?



## Miles (Oct 3, 2014)

If so, would you care to share your experience, what worked and what didn't? I would just try it out, but to be honest, between having a monster workload and being a machine down, I really cannot right at the moment.

Best,
Jack


----------



## acheron (Oct 3, 2014)

You just can't: recent version of Matlab is 64 bits only and the linuxolator is 32 bits only (I read on a mailing list that a patch of a 64 bits linuxolator is floating around).


----------



## Miles (Oct 3, 2014)

acheron said:
			
		

> You just can't: recent version of Matlab is 64 bits only and the linuxolator is 32 bits only (I read on a mailing list that a patch of a 64 bits linuxolator is floating around).



Ah that is a shame. Not sure I'm up for patching everywhere for my research work. Never mind.

Thanks for the response!


----------



## kpedersen (Oct 3, 2014)

I think emulators/wine works on 64bit but I am not sure if it can run 64bit applications. So might be no good either.

Perhaps VirtualBox? If you use X11 forwarding, it generally feels semi native.


----------



## Miles (Oct 3, 2014)

kpedersen said:
			
		

> Perhaps VirtualBox? If you use X11 forwarding, it generally feels semi native.



Hmm, that is an idea! Thanks.


----------



## SirDice (Oct 3, 2014)

kpedersen said:
			
		

> I think emulators/wine works on 64bit but I am not sure if it can run 64bit applications.


As far as I know only emulators/i386-wine works, the native 64 bit version (emulators/wine) still has a lot of issues. This means it's only possible to run 32 bit Windows applications.


----------



## Miles (Oct 3, 2014)

It's a real shame. I would just run Octave, but we use many of the toolboxes. Never mind.


----------



## Oko (Oct 5, 2014)

VisionIncision said:
			
		

> It's a real shame. I would just run Octave, but we use many of the toolboxes. Never mind.


This is a silly statement. If you need MATLAB you need MATLAB not some buggy clone which supports tiny subsets of MATLAB core funtionality. For education purposes FreeMat is about as good as it gets as a clone of core MATLAB. The major problem is that the real power of MATLAB is its tool boxes which are sold separately. MATLAB is domain specific language which makes it very suitable for specific class of problems. My rule of thumbs is if 90% of what you need to do you can do with built in functions (including tool boxes of course) it is probably wort money if you have that kind of money (tens of thousands of dollars). If you need to program more than 10% of code go for Python. 

Now back to your original question. MATLAB doesn't run on FreeBSD and anybody who is spending tens of thousands of dollars on the software and trying to run on unsupported platform is a fool IMHO. MATLAB is heavy Java application now using some Java numeric libraries even for computations. It used to use Java only for GUI but that was long time ago. Oracle Java doesn't run on FreeBSD. FreeBSD linux compatibility  layer is good enough if you want to run Linux version of Acrobat reader or Skype for anything more is not worthy. Look the commit log and you will see that there is no work on Linux comp for many years. IMHO that thing should be removed anyway from core code.

Sorry for being negative but MATLAB is one of those show stoppers which makes FreeBSD ill suited for scientific computing except in very particular circumstances.  MATLAB is the major reason I run Red Hat on about 20 computing nodes in my Lab. Otherwise they would be running FreeBSD long time ago.


----------



## Miles (Oct 5, 2014)

Oko said:
			
		

> VisionIncision said:
> 
> 
> 
> ...


Another reason why Octave is not an option for me. Also, I thought it was clear from my silly statement that I cannot use Octave due to lack of functionality.



			
				Oko said:
			
		

> For education purposes FreeMat is about as good as it gets as a clone of core MATLAB. The major problem is that the real power of MATLAB is its tool boxes which are sold separately. MATLAB is domain specific language which makes it very suitable for specific class of problems. My rule of thumbs is if 90% of what you need to do you can do with built in functions (including tool boxes of course) it is probably wort money if you have that kind of money (tens of thousands of dollars). If you need to program more than 10% of code go for Python.


Agreed. I could nearly as easily use Python. However, my institute has a site license for MATLAB and all toolboxes. I can do many of the tasks I need to do easily in MATLAB, so why not?



			
				Oko said:
			
		

> Now back to your original question. MATLAB doesn't run on FreeBSD and anybody who is spending tens of thousands of dollars on the software and trying to run on unsupported platform is a fool IMHO. MATLAB is heavy Java application now using some Java numeric libraries even for computations. It used to use Java only for GUI but that was long time ago. Oracle Java doesn't run on FreeBSD. FreeBSD linux compatibility  layer is good enough if you want to run Linux version of Acrobat reader or Skype for anything more is not worthy. Look the commit log and you will see that there is no work on Linux comp for many years. IMHO that thing should be removed anyway from core code.


Again, agreed. If it is not maintained then it really should be removed. Incidentally, in the past when running older versions of MATLAB on Linux with OpenJDK, I always experienced abnormalities in GUI behaviour.



			
				Oko said:
			
		

> Sorry for being negative but MATLAB is one of those show stoppers which makes FreeBSD ill suited for scientific computing except in very particular circumstances.  MATLAB is the major reason I run Red Hat on about 20 computing nodes in my Lab. Otherwise they would be running FreeBSD long time ago.


If the group I have joined did not use MATLAB, then it wouldn't be so much of a problem for me either. However, at this point, MATLAB is essential. 

As I said before, it's a real shame.


----------



## caesius (Oct 6, 2014)

Oko said:
			
		

> VisionIncision said:
> 
> 
> 
> ...



You're bang on the mark there Oko. People need to realise FreeBSD is not for desktop/research use and stop moulding it thus.


----------



## Oko (Oct 6, 2014)

caesius said:
			
		

> You're bang on the mark there Oko. People need to realise FreeBSD is not for desktop/research use and stop moulding it thus.


Well I hope younger people reading this forum will not be as pragmatical and as pessimistic as you and me. Otherwise FreeBSD future is bleak. There is indeed a place for niche products as FreeBSD/PC-BSD desktop (ZFS and life preserver are a pure gems combined with clang+Python+TeXLive) or even OpenBSD desktop (just check what M:Tier is doing with OpenBSD desktops) but main stream users will find both product to the large extend impractical. I have personally done always all my research related work on my OpenBSD desktops/laptops with a bit of cheating when it comes to things like MATLAB (I just use OpenNX client to connect to my Red Hat servers running MATLAB).


----------



## BSDBernd (Oct 6, 2014)

I would say that when it comes to math software, the open source community has excellent programs to offer. My numeric professor didn't use MATLAB, he used scilab (Edit: sorry I wrote scimath (a py library) but wanted to write scilab, which also is in the ports tree) in his classes (and presumably in his research). And there is of course sage, a 'monster' which is a fusion of many in itself complex open source projects. When you do number theory, yes you can use magma, but many use pari/gp which is developed by experts in the field. It is absolutely true that you cannot compete with windows when it comes to gaming or what ever, but when it comes to research and especially mathematics, I would say the open source developed software is on the top or can at least compete with other software in most cases. Take f.e. GAP, an open source project which is the result of a collaboration of a range of universities (and it is a part of the monster sage), this is a giant for dealing with finite groups and discrete mathematics in general. This is extensively used by group theorists. To sum up, when it comes to google hangouts or playing the newest games or writing a text in word, may be you should use windows there, but when it comes to research you definitely can use what is developed at universities and is open source.

Edit: http://www.sagemath.org/   (<- I think version 6.2 is in the ports tree)
Edit2: By the way, sometimes the open source project computes things even faster than its commercial rival (I think you can find statistics on that on the sage page)
Edit3: http://www.scilab.org/


----------



## kpedersen (Oct 6, 2014)

I have had a fiddle with MATLAB during one of my MSc units but not really delved deeper.
Is there a specific reason why the OpenJDK is not good enough to host the program? Is MATLAB written in pure Java or does it call on Linux specific x86_64 shared libraries (i.e perhaps for the toolboxes)?
I have worked with some pretty crazy Java software in the past and found the version of JRE on FreeBSD (and OpenBSD) to be quite adequate.

Then there is the Diablo JDK packages from around FreeBSD 6.x/7.x used to bootstrap the OpenJDK, did they not come from Sun? Perhaps they can still be used.

As for the OP, can you use an older (working?) version of MATLAB? Does your license allow that? Will your toolboxes still work? The handbook documents the steps required for MATLAB 6.5 (http://www.pl.freebsd.org/doc/handbook/ ... atlab.html).

Java == "Write once, run it on Linux and Windows only" I guess


----------



## Miles (Oct 6, 2014)

kpedersen said:
			
		

> As for the OP, can you use an older (working?) version of MATLAB? Does your license allow that? Will your toolboxes still work? The handbook documents the steps required for MATLAB 6.5 (http://www.pl.freebsd.org/doc/handbook/ ... atlab.html).


Unfortunately not. It's a shame, but it's not the end of the world. I have my Slackware machine for MATLAB. Also, a really old Mac that just about runs 2014a, though I probably wont be using the Mac that much!


----------



## Oko (Oct 6, 2014)

BSDBernd said:
			
		

> I would say that when it comes to math software, the open source community has excellent programs to offer. My numeric professor didn't use MATLAB, he used scilab (Edit: sorry I wrote scimath (a py library) but wanted to write scilab, which also is in the ports tree) in his classes (and presumably in his research).


I used to be college math professor :r  I used FreeMat when teaching Linear Algebra. Math professors have luxtury of doing this. In the real world MATLAB is the standard! Scilab is third MATLAB clone, the least compatible and the most buggy out of three clones (GNU Octave, FreeMAT, and SciLab).




			
				BSDBernd said:
			
		

> And there is of course sage, a 'monster' which is a fusion of many in itself complex open source projects.


Sage sucks! It is a kitchen sink interface for many open source projects GNU Octave, Maxima (computer algebra system), numpy+scipy+sympy just to name the few. If you can use Maxima (Mathematica for your info is the gold standard of computer algebra system and the facto standard in mathematical-physics community) you use Maxima you don't need Sage.



			
				BSDBernd said:
			
		

> When you do number theory, yes you can use magma, but many use pari/gp which is developed by experts in the field. It is absolutely true that you cannot compete with windows when it comes to gaming or what ever, but when it comes to research and especially mathematics, I would say the open source developed software is on the top or can at least compete with other software in most cases. Take f.e. GAP, an open source project which is the result of a collaboration of a range of universities (and it is a part of the monster sage), this is a giant for dealing with finite groups and discrete mathematics in general. This is extensively used by group theorists. To sum up, when it comes to google hangouts or playing the newest games or writing a text in word, may be you should use windows there, but when it comes to research you definitely can use what is developed at universities and is open source.



I completely agree with this part of your post. Yes if you need a very specialized product like GAP (actually one of principal contribute is a good friend of mine, math professor of course from Germany and an ardent NetBSD users since circa 1993  :e ) than the open source is the way to go. There is a big discussion in mathematics community how to referee math papers which use computer assisted proofs and the agreement that the code, software, and even underlining OS have to be scrutinized the same way you would check the proof of a normal mathematical theorem. Close source software has no place in fundamental science like mathematics. Of course open source doesn't mean that the product is necessary free as GNU bunch wants you to belive. Open source and free are different categories.

Now lets see how many active research mathematicians are there on the world :stud About 7000-8000
people who are proving theorems for living. Out of them I estimate that no more than 10-15% use computer for anything beyond writing their papers in TeX. Some of those use just Mathematica for example to do symbolic computations like my math physics collaborators. Fraction of those 10% use things like GAP or my personal favorite  PyDSTool written by my former colleague Rob Clewley at Georgia State (I am no longer at Georgia State). How many commercial vendors are interested in that kind population?


----------



## BSDBernd (Oct 6, 2014)

> Sage sucks!


Now that is your personal opinion . But if you look at the testimonial page Sage has, there seem to be people who use Sage in their research and who do not agree with you on that. 
At the Sage page, you can see examples where they f.e. compare Magma and Sage and where Sage is f.e. faster in computing the eigenvalues of a large matrix, an important thing to compute as you would surely agree. So Sage is at least on this important topic better than Magma, and this is not the only topic.
Something tells me that science and education should be one of the areas where materials and tools should be free and open to everyone, or at least there should be good alternatives to proprietary alternatives . 

(This should by the way be my post nr. 100, yey  )


----------



## sulman (Oct 17, 2014)

Oko said:


> Well I hope younger people reading this forum will not be as pragmatical and as pessimistic as you and me. Otherwise FreeBSD future is bleak. There is indeed a place for niche products as FreeBSD/PCBSD desktop (ZFS and life preserver are a pure gems combined with clang+Python+TeXLive) or even OpenBSD desktop (just check what M:Tier is doing with OpenBSD desktops) but main stream users will find both product to the large extend impractical. I have personally done always all my research related work on my OpenBSD desktops/laptops with a bit of cheating when it comes to things like MATLAB (I just use OpenNX client to connect to my Red Hat servers running MATLAB).



It's true, and actually a similar argument can be applied to Linux; I run a Gentoo desktop at work, but I still run a Windows 7 VM for my mail (Exchange with no IMAP...) and some Windows-only applications that work requires.

MATLAB also stopped me from using FreeBSD more (I have it on a few boxes doing various jobs). It is the same with Stata.

There will always be challenges when software firms naturally target the bigger market slices. I see FreeBSD as a great OS with gradual, continuous improvement, and I use it where I can. Life is often about compromise!


----------



## Oko (Jan 22, 2015)

getopt said:


> Unless having become dependent to MATLAB there are NumPy, SciPy and Ipython in the ports.


You are not doing scientific computing for living and it shows. My lab has hundreds of thousands lines of legacy MATLAB code. Do you think we would be able to rewrite it in Python (which we also use by the way just like R) even if we wanted to?


----------



## Oko (Jan 22, 2015)

getopt said:


> At Oko only
> I did not respond to a posting of yours. Clearly speaking, it was not addressed to you personally.
> But his one you get exclusively as you can easily look up at the header of the quote:
> 
> ...


This is a childish post. I have no idea what you found offensive in my post. I mentioned my lab as an example to expose the fallacy of your logic and a bad advise you gave to a serious question. People who use MATLAB (for whatever reason) need MATLAB. MathWorks (for whatever reason) has no FreeBSD version. Thus FreeBSD is not suitable OS for people who need to run MATLAB code. This is where the whole conversation should have ended if we are talking like mature adults.

Suggesting to MATLAB users that they can use Octave, FreeMat, SciLab, Python, Perl, R or whatever else instead of MATLAB is silly and dis-genuine advise whether is typed on yours, mine or anybody else's keyboard.


----------



## sulman (Feb 3, 2015)

getopt said:


> Unless having become dependent to MATLAB there are NumPy, SciPy and Ipython in the ports.



Unfortunately I have to give the researchers what they want, and they are usually familiar with proprietary applications, particularly MATLAB and Stata.


----------



## First_Law_of_Unix (Sep 17, 2022)

caesius said:


> You're bang on the mark there Oko. People need to realise FreeBSD is not for desktop/research use and stop moulding it thus.



That is true and what a big big irony for Unix... FreeBSD was literally evolved and made by researchers for helping closed/open academic research and development to begin with. However it went downhill throughout the years... but now it seems like its being usable at some form for research.

The biggest problem and mistake MATLAB did was creating it using JAVA... if they ever written it in good old C/C++, MATLAB would be highly portable and ported by devs on FreeBSD ASAP and would be reliable.


----------



## Jose (Sep 17, 2022)

Plenty of Java software works just fine on Openjdk / Freebsd. I'm a professional Java programmer, and we only use Openjdk at work. I dunno what Matlab's problem is, and frankly don't care. It appears to be some proprietary Java glue on top of open-source math libraries:





						Which computer programming language are MATLAB R2015b and R2016b written in? - MATLAB Answers - MATLAB Central
					

Which computer programming language are MATLAB... Learn more about computer programming language




					www.mathworks.com


----------

