bugGNU Octave - Bugs: bug #35408, Static build of octave fails on...

 
 

bug #35408: Static build of octave fails on 3.4.3 OpenSUSE 11.4

Submitted by:  spasmous <spasmous>
Submitted on:  Mon 30 Jan 2012 08:49:26 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 31 Jan 2012 05:04:13 AM UTC, comment #4:

I checked in the following change. With it, I can build Octave with --enable-static --disable-shared --disable-dl on my Debian system.

http://hg.savannah.gnu.org/hgweb/octave/rev/21572e9bd365

John W. Eaton <jwe>
Project Administrator
Mon 30 Jan 2012 11:13:03 PM UTC, comment #3:

With a few simple changes, I can do a "static" build of Octave using the current development sources. I'll try to incorporate these changes into the build system soon.
All the .oct files, all of liboctinterp, liboctave, and libcruft are linked together in one big happy executable file. However, it the Octave executable still depends on shared system libraries.

Trying to pass "-static" to gcc for the final link results in the error

on my system. But I think that is a system problem, not a bug in Octave. A fully static build should be possible if your system has the proper static system libraries available.

John W. Eaton <jwe>
Project Administrator
Mon 30 Jan 2012 10:40:51 PM UTC, comment #2:

It's a good thing you don't need a fully static Octave because this hasn't actually been possible for several versions.

The answer to your second question is the environment variable LD_LIBRARY_PATH. Set that variable in the shell to the path where your shared libraries exist ("mylibs" directory). Then run Octave. This is some reasonable documentation on this concept (http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html).

If that works then I will close this bug.

Rik <rik5>
Project Administrator
Mon 30 Jan 2012 09:36:31 PM UTC, comment #1:

I don't really NEED a static compilation, just a portable version that I can run off a USB drive.

I'd be just as happy to copy all the needed libraries into a directory "mylibs" inside $builddir and point octave to find them. When I compile (default, non-static build) and type ldd octave it looks in the default places - how can I make it look in "mylibs"?

spasmous <spasmous>
Mon 30 Jan 2012 08:49:26 PM UTC, original submission:

I'm on Suse 11.4 and trying to compile Octave 3.4.3 as a static build with gcc-4.5 and gfortran-4.5. After searching the web for a while I figured these were the right options:

./configure --disable-dl --disable-shared --enable-static

Do internal array bounds checking: false
Build static libraries: true
Build shared libraries: false
Dynamic Linking: false
Include support for GNU readline: true
64-bit array dims and indexing: false

configure: WARNING: I didn't find gperf.
configure: WARNING: I didn't find flex.
configure: WARNING: I didn't find bison.
configure: WARNING: UMFPACK not found.
configure: WARNING: qrupdate not found.
configure: WARNING: AMD library not found.
configure: WARNING: COLAMD library not found.
configure: WARNING: CCOLAMD library not found.
configure: WARNING: CHOLMOD library not found.
configure: WARNING: CXSparse library not found.
configure: WARNING: cURL library not found.
configure: WARNING: GLPK library not found.
configure: WARNING: GraphicsMagick++ library not found.
configure: WARNING: HDF5 library not found.
configure: WARNING: Qhull library not found.
configure: WARNING: OpenGL libs (GL and GLU) not found.

make -j4

...
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -pthread -DHAVE_CONFIG_H -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -pthread -g -O2 -pthread -o octave main.o ./liboctinterp.la ../liboctave/liboctave.la ../libcruft/libcruft.la ../libcruft/libranlib.la ../libgnu/libgnu.la -L/usr/lib64 -lpcre -lreadline -lncurses -llapack -lblas -lm -L/usr/lib64/gcc/x86_64-suse-linux/4.5 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../.. -lgfortran -lm -lm
libtool: link: gcc -g -O2 -pthread -DHAVE_CONFIG_H -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -pthread -g -O2 -pthread -o octave main.o ./.libs/liboctinterp.a /home/spas/octave-3.4.3/liboctave/.libs/liboctave.a -L/usr/lib64 ../liboctave/.libs/liboctave.a /home/spas/octave-3.4.3/libcruft/.libs/libcruft.a ../libcruft/.libs/libcruft.a ../libcruft/.libs/libranlib.a ../libgnu/.libs/libgnu.a -lpcre -lreadline -lncurses -llapack -lblas -L/usr/lib64/gcc/x86_64-suse-linux/4.5 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../.. -lgfortran -lm -pthread

Then there are thousands of lines of errors starting with this:

/home/spas/octave-3.4.3/liboctave/.libs/liboctave.a(liboctave_la-file-ops.o): In function `octave_tempnam(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
/home/spas/octave-3.4.3/liboctave/file-ops.cc:659: warning: the use of `tempnam' is dangerous, better use `mkstemp'
./.libs/liboctinterp.a(liboctinterp_la-octave.o): In function `operator<< <std::char_traits<char> >':
/usr/include/c++/4.5/ostream:513: undefined reference to `std::cerr'
/usr/include/c++/4.5/ostream:513: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
./.libs/liboctinterp.a(liboctinterp_la-octave.o): In function `operator<< <char, std::char_traits<char>, std::allocator<char> >':
...

spasmous <spasmous>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by spasmous (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 31 Jan 2012 05:04:13 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1