In what (small) ways can I modify Octave's compile options to enhance it without breaking it?
Posted
by
irrational John
on Super User
See other posts from Super User
or by irrational John
Published on 2012-04-10T22:11:55Z
Indexed on
2012/04/10
23:33 UTC
Read the original article
Hit count: 346
If the title to this question seems a bit vague, I am sorry. But I wasn't sure how to distill what I am attempting to do into a single sentence.
A few weeks back I learned that I could build and install recent releases of Octave on an Ubuntu 12.04 system by following the steps below.
Install the tools needed to compile, link, and run octave. For Ubuntu the commands below have worked for me.
sudo apt-get build-dep octave3.2 sudo apt-get install build-essential gnuplot gtk2-engines-pixbuf sudo apt-get install libfontconfig-dev bison
Next, download the source code for an Octave release from the Gnu Project Archives for Octave and unpack the archive into a folder on your system.
Use the commands below to build, check, and install octave.
./configure make make check sudo make install
Unfortunately it turns out that the above builds an Octave that contains all the debugging symbol tables. The object files alone are huge taking up around 1.7 GB.
The current Octave documentation suggests
To compile without debugging symbols try the command
make CFLAGS=-O CXXFLAGS=-O LDFLAGS=
instead of justmake
.
However, when I tried this it did not work. The -g
option was still used for the compiles. For the heck of it I instead tried ./configure CFLAGS=-O CXXFLAGS=-O
and this did work. (Instead of ~1.7GB the result of the build now takes up around 253MB).
My questions are
- Is this actually the correct (recommended?) method to use to compile Octave without debugging symbols (i.e. without
-g
)? - How would I compile Octave so it uses x86_64 rather than x86?
Note: I am not asking how to compile Octave to use the (experimental) 64-bit integers for array dimensions. I just want to allow the compiler to use the extra registers and word sizes available when an app runs in 64-bit mode. - Is a (more) complete list available for the directives used with the Octave Makefile?
I have only seenmake
,make check
, andmake install
documented. But apparentlymake distclean
is also allowed. (It removes the compilation results so you can do a complete rebuild of everything.)
I'm wondering what else might be available.
FWIW, I have tried using
./configure CFLAGS="-O3 -mtune=core2 -m64" CXXFLAGS="-O3 -mtune=core2 -m64"
and, surprisingly, it not only appeared to build, but also ran and passed the make check
tests. The ./configure
script even gave me the (deceptively?) reassuring message "Octave is now configured for x86_64-unknown-linux-gnu".
But of course that's not the same thing as saying it actually "works". Is there a recommended way to enable Octave to run as an x86_64 app?
I have also tried looking inside the Octave Makefile
to see if I could decipher what command line directives it accepts. I got nowhere. I have not a single clue as to how that Makefile does whatever it is that it does.
© Super User or respective owner