help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statically linked octave


From: Tatsuro MATSUOKA
Subject: Re: statically linked octave
Date: Thu, 26 Jun 2014 04:10:11 +0900 (JST)

---- Original Message -----
From: kamaraju kusumanchi <address@hidden>
To: address@hidden 
Date: 2014/6/25, Wed 21:25
Subject: statically linked octave

My goal here is to compile a statically linked version of octave on a machine running Debian Jessie and copy the binary to a machine running Redhat Linux 6.4 and run it from there. Is this feasible to do?

This is what I did.
1) Downloaded ftp://ftp.gnu.org/gnu/octave/octave-3.8.1.tar.bz2
2) configured with

=> ../../unZipped/octave-3.8.1/configure --prefix=${HOME}/software/myroot/octave-3.8.1/ --enable-static

=> nohup make 2>&1 

=> nohup make install 2>&1 

However, this does not create a single statically linked binary. The files are spread across multiple directories in ~/software/myroot/octave-3.8.1.

address@hidden:~/software/myroot/octave-3.8.1$ ls
bin  include  lib  libexec  share

Moreover, the octave binary looks for other shared libraries

address@hidden:~/software/myroot/octave-3.8.1$ ldd bin/octave
    linux-vdso.so.1 (0x00007fff787e6000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f1cdcc03000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f1cdca00000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1cdc6f4000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1cdc3f1000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1cdc1db000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1cdbfbd000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1cdbc14000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1cdb9f5000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1cdb7f0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1cdcf72000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1cdb5ec000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1cdb3e6000)


I am also not sure If I got this right, since the octave binary is just 104K where as the install directory is 1.8G. 

address@hidden:~/software/myroot/octave-3.8.1$ du bin/octave-3.8.1 -hs
104K    bin/octave-3.8.1
address@hidden:~/software/myroot/octave-3.8.1$ du . -hs
1.8G    .

Do I have to copy the whole installation directory (~/software/myroot/octave-3.8.1) on to the redhat machine? I was hoping it will be a single binary (however large that is).

raju
----- Original Message -----
From: kamaraju kusumanchi <address@hidden>
To: address@hidden 
Date: 2014/6/25, Wed 21:25
Subject: statically linked octave

My goal here is to compile a statically linked version of octave on a machine running Debian Jessie and copy the binary to a machine running Redhat Linux 6.4 and run it from there. Is this feasible to do?

This is what I did.
1) Downloaded ftp://ftp.gnu.org/gnu/octave/octave-3.8.1.tar.bz2
2) configured with

=> ../../unZipped/octave-3.8.1/configure --prefix=${HOME}/software/myroot/octave-3.8.1/ --enable-static

=> nohup make 2>&1 

=> nohup make install 2>&1 

However, this does not create a single statically linked binary. The files are spread across multiple directories in ~/software/myroot/octave-3.8.1.

address@hidden:~/software/myroot/octave-3.8.1$ ls
bin  include  lib  libexec  share

Moreover, the octave binary looks for other shared libraries

address@hidden:~/software/myroot/octave-3.8.1$ ldd bin/octave
    linux-vdso.so.1 (0x00007fff787e6000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f1cdcc03000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f1cdca00000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1cdc6f4000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1cdc3f1000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1cdc1db000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1cdbfbd000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1cdbc14000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1cdb9f5000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1cdb7f0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1cdcf72000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1cdb5ec000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1cdb3e6000)


I am also not sure If I got this right, since the octave binary is just 104K where as the install directory is 1.8G. 

address@hidden:~/software/myroot/octave-3.8.1$ du bin/octave-3.8.1 -hs
104K    bin/octave-3.8.1
address@hidden:~/software/myroot/octave-3.8.1$ du . -hs
1.8G    .

********************************************************************
I'm mainly using windows and have a little experience on Ubuntu 12.04 LTS.


>The files are spread across multiple directories in ~/software/myroot/octave-3.8.1.
>bin  include  lib  libexec  share

This directory structure is usual for Linux software.
If you want change this structure, you perhaps need to change source code.

>Moreover, the octave binary looks for other shared libraries
It is natural that octave links other shared libraries on Linux because the external libraries on Linux are usually provided in shared libraries.  You perhaps need to build all external dependencies from source in static way.
./configure --enable-static --disable-shared (othrer options)

I have a experience that only hdf5 libraries built in static way and link it as static library to octave because it was necessary to do it. Therefore I think it is possible to build all dependency in static way and build octave against those.
Note that building  all dependencies from source is heavy and time consuming task. 

For dependencies, please refer the below:
http://wiki.octave.org/Building

If you will be able to build static version octave on  Debian Jessie, I do not know whether that works on  Redhat Linux.

Tatsuro




  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]