# Octave mess



## aragats (Apr 13, 2018)

I'm trying to build math/octave in FreeBSD 11.1-RELEASE-p7.
I don't need GUI, however, there is no config option to skip it. Why?
The building process depends on TeX files, which means I have to install at least 1GB (up to 3GB!) of unneeded stuff.
I tried Octave binary package first, but `octave-cli` segfaults when trying to plot anything.

Does anybody use/have installed Octave?
Thanks for advises.


----------



## chrbr (Apr 13, 2018)

I have had used it some time ago. Currently I have it not installed. I do not like the GUI, but I do not like the GUI of Matlab as well.

For many purposes you could consider to use math/py-numpy instead. The usability as a "pocket calculator" as the Matlab or Octave console is not that good. But it works well for numeric things realized in python scripts. math/matplotlib is superior to almost everything else in generating plots. Both pieces of software build up a great team.


----------



## aragats (Apr 13, 2018)

Thanks, chrbr !
I used Octave intensively 3-4 years ago, never installed GUI, everything was fine, but now it's messed up...
As a work-around for the segfault I added to ~/.octaverc:
	
	



```
graphics_toolkit("gnuplot")
```
to force it using math/gnuplot instead of the "native" graphics.


----------



## chrbr (Apr 13, 2018)

Thank you for the hint. It is some time ago I have had used math/octave on FreeBSD. If there is something quick to be checked in interactive mode math/octave is quite useful. At work I have it installed on cygwin because we have to use Windows but no budget for something else ;-).

If things are getting serious math/py-numpy is currently my first choice. Thanks again for the hint, it is not unlikely that I might need it in future.


----------



## aragats (Apr 13, 2018)

chrbr said:


> because we have to use Windows but no budget for something else


Officially I have to use Windows at work too, but I just run it in *bhyve*, the sysadmins believe it's an actual domain workstation (-;


----------



## Oko (Apr 14, 2018)

aragats said:


> I'm trying to build math/octave in FreeBSD 11.1-RELEASE-p7.
> I don't need GUI, however, there is no config option to skip it. Why?


Are you sure that it is possible to install GNU Octave package without GUI? I mean they are emulating MATLAB behavior. You can of course start matlab without gui

`matlab -nodesktop`

but you can't install without it. I am more familiar with the other MATLAB clone called math/freemat which used to be 100% faithful re-implementation of the core MATLAB functionality. That is not a lot considering that true power of MATLAB is in its toolboxes which quickly add thousands of dollars to the cost. However FreeMat was enough to showcase basic Numerical Linear Algebra algorithms when I taught the class. FreeMat looks dead as the lead developer moved on (community was always pretty week). You also have  math/scilab which was an European attempt to create a free clone of MATLAB. I don't think it worked



aragats said:


> The building process depends on TeX files, which means I have to install at least 1GB (up to 3GB!) of unneeded stuff.


Welcome to the wonderful world of over-engineered GNU software. Original Don Knuth's TeX engine, LaTeX macros, Metafont, and MetaPost can be obtained as kerTeX  (under 10 MB) but TeXLive is defacto standard TeX distribution for UNIX. I still remember old good days 1991-2006 when teTeX ( Thomas Esser TeX) was a standard UNIX distro of TeX and friends. It was 100 or so MB. Then Thomas got married and had kids 
Personally I prefer key-value driven TeX (read ConTeXt) but nobody in Mathematics, Physics, and Astronomy will  accept the paper written in ConTeXt. Thus all of us are stuck with LaTeX macros and gazillion packages.




aragats said:


> I tried Octave binary package first, but `octave-cli` segfaults when trying to plot anything.
> 
> Does anybody use/have installed Octave?
> Thanks for advises.


As somebody who uses MATLAB daily to make the living the only situation when using Octave made sense was if you are doing Chemical Engineering. IIRC the original person/group at the University of Wisconsin who developed GNU Octave were members of Chemical Engineering department. If you just want to play little bit with MATLAB language use FreeMat.

I know personally Cleve Moler founder of MathWorks (MATLAB and Simlink) and he is the first rate mathematician and one of best numerical analysts of the second part of 20th century. MATLAB language is second to none when it came to matrix structures. The role of the thumb is that if can find a MATLAB toolbox which can do 90% of functionality you need to prototype a science/engineering experiment you are designing then it is worth every penny. If you need to write more than 10% of code you are better off starting with Python.


Oh and I almost forgot. You should update your installation to 11p9  You are running unpatched system.


----------



## aragats (Apr 14, 2018)

Oko said:


> Are you sure that it is possible to install GNU Octave package without GUI? I mean they are emulating MATLAB behavior. You can of course start matlab without gui


Initially Octave had no GUI, they added it later. The latest version from the official site still has such options:
	
	



```
% ./configure --help | grep -i 'gui\|graphics'
  --without-opengl        don't use OpenGL libraries, disable OpenGL graphics
  --without-qt            don't use Qt libraries, disable Qt GUI
  --without-fltk          don't use FLTK libraries, disable OpenGL graphics
```



Oko said:


> If you just want to play little bit with MATLAB language use FreeMat.


Well, several years ago I used to simulate complex digital signal processing with Octave and Matlab. Now decided to start using it again for data analysis...
Anyway, with gnuplot work-around it doesn't segfault so far.
Will definitely try math/freemat, thanks!


----------



## aragats (Apr 15, 2018)

I was able to build vanilla Octave 4.2.2 from the official site without any GUI, it doesn't depend on any graphical toolkit, Java or TeX.
Here are the configuration options:
	
	



```
% ./configure CPPFLAGS="-I /usr/local/include" LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc6 -L/usr/local/lib/gcc6 -B/usr/local/bin -L/usr/local/lib -L/usr/local/lib -fstack-protector" F77=gfortran6 --without-opengl --without-qt --without-fltk --with-blas="-lopenblasp" --with-lapack="-lopenblasp" --with-magick="-lGraphicsMagick" --disable-openmp --disable-jit --disable-java --enable-shared --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --disable-silent-rules --infodir=/usr/local/info
% gmake
# gmake install
```
Of course, it depends on several critical packages:
devel/gmake
textproc/gsed
math/openblas
math/lapack
graphics/GraphicsMagick
I cannot guarantee that this list is complete though.
Maybe we should create another port, e.g. *octave-cli*.
By the way, math/freemat also has GUI and depends on qt4.


----------

