You are not logged in.

#1 2008-04-22 20:06:32

bioe007
Member
Registered: 2007-11-12
Posts: 56

octave + dependencies

Hi I am new to Arch and enjoying it very much so far. I've run into a bit of a stumbling block with Octave and I'm not sure how to fix it. I apologize if this is the wrong subforum, I didn't see one for scientific stuff so I default to the 'Im a n00b and clueless' smile

I have always built the 'faster' versions of available libraries and the suitesparse stuff for sparse matrix manipulation in octave

here are the dependencies I've built so far (in order):
------fftw
------qhull
------metis
------hdf5
------gotoblas
-----lapack
-----glpk
----suitesparse

I get everything except octave built, apply the maxarray.h.in patch. I have a PKGBUILD for each dependency, but unless someone thinks they're useful, I'll just post my octave pkgbuild:

pkgname=octave
pkgver=3.0.0
pkgrel=1
pkgdesc="Mathematical computing tool"
arch=('i686')
url="http://www.gnu.org/software/octave/index.html"
license=('GPL')
depends=( 'fftw' 'hdf5'    'gotoblas'
        'metis'    'suitesparse'
        'lapack' 'qhull' )
makedepends=()
source=(    ftp://ftp.octave.org/pub/octave/${pkgname}-${pkgver}.tar.bz2
                    "gcc-4.3.patch")
md5sums=( 'd5512acdf60ac04398ff258cbc37f3c4' 'bb92b9c83a5f8531aa80244a75a32990')

build() {

    cd $startdir/src/$pkgname-$pkgver
    patch -Np1 -i "$startdir/gcc-4.3.patch" || return 1

#    CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse3 -fno-strict-aliasing -fPIC" \
#    CXXFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse3 -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC" \
# CPPFLAGS="-I/usr/include/suitesparse -I/usr/include" \

        FFLAGS="-march=prescott -O -fexternal-blas -pipe -fomit-frame-pointer -fno-strict-aliasing -fPIC" \
    CFLAGS="${CFLAGS} -fno-strict-aliasing -fPIC" \
    CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing -fPIC"
    LDFLAGS="-L/usr/lib" \
    ./configure \
        --prefix=/opt/$pkgname-$pkgver \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --mandir=/usr/man \
        --infodir=/usr/info \
        --docdir=/usr/doc/$PRGNAM-$VERSION \
        --enable-shared \
        --disable-static \
        --with-f77=gfortran \
        --with-blas=/usr/lib/libgoto_core2p-r1.25.so \
        --with-lapack=/usr/liblapack.so.3 \

    make -j3 || exit 1
    make DESTDIR=$startdir/pkg install || exit 1

}

here is the error I am getting:

g++  -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wold-style-cast -march=prescott -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse3 -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -rdynamic \
    -L..  -fPIC -L/usr/lib -o octave \
    main.o  \
    -L../liboctave -L../libcruft -L../src -Wl,-rpath -Wl,/opt/octave/lib/octave-3.0.0 \
    -loctinterp -loctave  -lcruft   \
     -lumfpack -lamd -lcamd -lcolamd \
    -lcholmod -lccolamd -lcxsparse -llapack /usr/lib/libgoto_core2p-r1.25.so \
    -lfftw3 -lreadline  -lncurses -ldl -lhdf5 -lz -lm  -L/usr/lib -L/usr/lib/gcc/i686-pc-linux-gnu/4.3.0 -L/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/../../.. -lhdf5 -lz -lgfortranbegin -lgfortran -lm
../liboctave/liboctave.so: undefined reference to `METIS_NodeComputeSeparator'
../liboctave/liboctave.so: undefined reference to `METIS_NodeND'
collect2: ld returned 1 exit status
make[2]: *** [octave] Error 1
make[2]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.0/src'
make[1]: *** [src] Error 2
make[1]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.0'
make: *** [all] Error 2

I'm not sure how liboctave could have metis symbols without the rest of the build being aware of them? (metis would be linked in by way of suitesparse) do I need to explicitly add LDFLAGS="-lmetis" ? it seems backwards to me that liboctave has metis symbols but the rest of the build process doesnt understand them.. I can not remember adding -lmetis before (on other distros I've built this setup with) but I could be wrong. I don't want to link in a library unnecessarily either.

I guess I don't really understand the ramifications of -lmetis on the rest of the build... ?

i'm confused.

Offline

#2 2008-04-22 20:26:45

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: octave + dependencies

If you are not lucky here, you might want to try octave mailing list.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#3 2008-04-22 20:41:08

bioe007
Member
Registered: 2007-11-12
Posts: 56

Re: octave + dependencies

thanks for the quick response.

I went ahead and changed my PKGBUILD to include this line:

LDFLAGS="-lmetis"

and now its compiled, and working...

btw- thanks to you for a previous post where you answered someones question about strlen issue.

Offline

#4 2008-04-23 06:00:38

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: octave + dependencies

bioe007 wrote:

thanks for the quick response.

I went ahead and changed my PKGBUILD to include this line:

LDFLAGS="-lmetis"

and now its compiled, and working...

Ok, but I don't think you should need to do that. I think this flag should be added automatically by the autotools script of octave.
Or maybe octave relies on libtools files to work properly, so try rebuilding metis package with that option in the PKGBUILD :
options=(libtool)

Then check if you have .la files in that new metis package, and try building octave again.

btw, I'm still very confused about building / compilation stuff, so I could very well be way off..

btw- thanks to you for a previous post where you answered someones question about strlen issue.

Hm, I have no idea what you are referring to here smile


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#5 2008-04-23 18:59:29

bioe007
Member
Registered: 2007-11-12
Posts: 56

Re: octave + dependencies

i was referring to this thread

i did rebuild metis:

pkgname=metis
pkgver=4.0
pkgrel=1
pkgdesc="A set of programs for partitioning graphs, fem meshes, and producing fill reducing orderings for sparse matrices."
arch=('i686')
url="http://www.gnu.org/software/octave/index.html"
license=('GPL')
depends=()
makedepends=()
source=(http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/${pkgname}-${pkgver}.tar.gz)
md5sums=('0aa546419ff7ef50bd86ce1ec7f727c7')
options=(libtool)

build() {

    PREFIX=/usr
    cd $startdir/src/$pkgname-$pkgver

    cp -f $startdir/Makefile.in.archlinux ./Makefile.in
    make

    install -d -m755 $startdir/pkg/$PREFIX/{bin,lib,share/$pkgname,man,include}
    install -m644 $startdir/src/$pkgname-$pkgver/{Doc/*,CHANGES,INSTALL,VERSION,Makefile.in} $startdir/pkg/$PREFIX/share/$pkgname

    install -m755 $startdir/src/$pkgname-$pkgver/{pmetis,kmetis,oemetis,onmetis,partnmesh,partdmesh,mesh2nodal,mesh2dual,graphchk} $startdir/pkg/$PREFIX/bin
    install -m755 $startdir/src/$pkgname-$pkgver/lib* $startdir/pkg/$PREFIX/lib
    install -m755 $startdir/src/$pkgname-$pkgver/Lib/metis.h $startdir/pkg/$PREFIX/include


}

but it did not create 'libmetis.la' - I'm not sure how/where the libmetis makefile would make use libtool

$ cat src/metis-4.0/Lib/Makefile 
include ../Makefile.in

INCLUDES = -I.

CFLAGS = $(COPTIONS) $(OPTFLAGS) $(INCLUDES)
LD = $(CC) -L. 


OBJS = coarsen.o fm.o initpart.o match.o ccgraph.o memory.o \
       pmetis.o pqueue.o refine.o util.o timing.o debug.o \
       bucketsort.o graph.o stat.o kmetis.o kwayrefine.o \
       kwayfm.o balance.o ometis.o srefine.o sfm.o separator.o \
       mincover.o mmd.o mesh.o meshpart.o frename.o fortran.o \
       myqsort.o compress.o parmetis.o estmem.o \
       mpmetis.o mcoarsen.o mmatch.o minitpart.o mbalance.o \
       mrefine.o mutil.o mfm.o mkmetis.o mkwayrefine.o mkwayfmh.o \
       mrefine2.o minitpart2.o mbalance2.o mfm2.o \
       kvmetis.o kwayvolrefine.o kwayvolfm.o subdomains.o

.c.o:
    $(CC) $(CFLAGS) -c $*.c

../libmetis.a: $(OBJS)
    $(AR) $@ $(OBJS)
    $(RANLIB) $@

clean:
    rm -f *.o

realclean:
    rm -f *.o ; rm -f ../libmetis.a

i'm not sure how/what the difference between .a and .la for libraries are, only that they are static.


I could add something to create a shared library.

Offline

#6 2008-04-23 19:13:04

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: octave + dependencies

bioe007 wrote:

i was referring to this thread

Oh I see, I forgot about that smile

but it did not create 'libmetis.la' - I'm not sure how/where the libmetis makefile would make use libtool

Ok then maybe it doesn't provide any.
So setting LDFLAGS manually might be the only way in that case, but I don't know really.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2008-04-23 22:32:55

bioe007
Member
Registered: 2007-11-12
Posts: 56

Re: octave + dependencies

I have created a shared libmetis.so.4 now am rebuilding with octave-3.0.1 (3.0.1 no longer requires the gcc 4.3 patch) but it still doesn't work (breaks with same error)

it works for now at least

Offline

#8 2008-04-25 14:54:58

bioe007
Member
Registered: 2007-11-12
Posts: 56

Re: octave + dependencies

new problem with this build, yesterday I upgraded (pacman -Syyu ) and added tex to my box (pacman -S texinfo) and so now the build tries to make octave's documentation, but it breaks:

gawk -f ./mkcontrib.awk ./contributors.in > contributors.texi-t
contributors.texi is unchanged
TEXINPUTS="..:.:./..::" texi2pdf ./octave.texi
You don't have a working TeX binary (tex) installed anywhere in
your PATH, and texi2dvi cannot proceed without one.  If you want to use
this script, you'll need to install TeX (if you don't have it) or change
your PATH or TEX environment variable (if you do).  See the --help
output for more details.

For information about obtaining TeX, please see http://www.tug.org.  If
you happen to be using Debian, you can get it with this command:
  apt-get install tetex-bin
make[3]: [octave.pdf] Error 1 (ignored)
TEXINPUTS="..:.:./..::" texi2pdf octave-a4.texi -t @afourpaper
You don't have a working TeX binary (tex) installed anywhere in
your PATH, and texi2dvi cannot proceed without one.  If you want to use
this script, you'll need to install TeX (if you don't have it) or change
your PATH or TEX environment variable (if you do).  See the --help
output for more details.

For information about obtaining TeX, please see http://www.tug.org.  If
you happen to be using Debian, you can get it with this command:
  apt-get install tetex-bin
make[3]: [octave-a4.pdf] Error 1 (ignored)
../../mkinstalldirs /home/perry/abs/local/octave/pkg/usr/man/man1 /home/perry/abs/local/octave/pkg/usr/info
mkdir /home/perry/abs/local/octave/pkg/usr
chmod 0755 /home/perry/abs/local/octave/pkg/usr
mkdir /home/perry/abs/local/octave/pkg/usr/man
chmod 0755 /home/perry/abs/local/octave/pkg/usr/man
mkdir /home/perry/abs/local/octave/pkg/usr/man/man1
chmod 0755 /home/perry/abs/local/octave/pkg/usr/man/man1
mkdir /home/perry/abs/local/octave/pkg/usr/info
chmod 0755 /home/perry/abs/local/octave/pkg/usr/info
installing ./mkoctfile.1 in /home/perry/abs/local/octave/pkg/usr/man/man1
installing ./octave.1 in /home/perry/abs/local/octave/pkg/usr/man/man1
installing ./octave-bug.1 in /home/perry/abs/local/octave/pkg/usr/man/man1
installing ./octave-config.1 in /home/perry/abs/local/octave/pkg/usr/man/man1
installing info files in /home/perry/abs/local/octave/pkg/usr/info
installing ./dir in /home/perry/abs/local/octave/pkg/usr/info
make[3]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc/interpreter'
making install in liboctave
make[3]: Entering directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc/liboctave'
TEXINPUTS="..:.:./..::" \
      texi2dvi liboctave.texi
You don't have a working TeX binary (tex) installed anywhere in
your PATH, and texi2dvi cannot proceed without one.  If you want to use
this script, you'll need to install TeX (if you don't have it) or change
your PATH or TEX environment variable (if you do).  See the --help
output for more details.

For information about obtaining TeX, please see http://www.tug.org.  If
you happen to be using Debian, you can get it with this command:
  apt-get install tetex-bin
make[3]: [liboctave.dvi] Error 1 (ignored)
TEXINPUTS="..:.:./..::" \
      texi2pdf liboctave.texi
You don't have a working TeX binary (tex) installed anywhere in
your PATH, and texi2dvi cannot proceed without one.  If you want to use
this script, you'll need to install TeX (if you don't have it) or change
your PATH or TEX environment variable (if you do).  See the --help
output for more details.

For information about obtaining TeX, please see http://www.tug.org.  If
you happen to be using Debian, you can get it with this command:
  apt-get install tetex-bin
make[3]: [liboctave.pdf] Error 1 (ignored)
make[3]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc/liboctave'
making install in refcard
make[3]: Entering directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc/refcard'
make[3]: Nothing to be done for `install'.
make[3]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc/refcard'
make[2]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1/doc'
making install in examples
make[2]: Entering directory `/home/perry/abs/local/octave/src/octave-3.0.1/examples'
make[2]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
for f in info-emacs-info info-emacs-octave-help; do \
      /bin/install -c ./$f /home/perry/abs/local/octave/pkg/opt/octave/libexec/octave/3.0.1/exec/i686-pc-linux-gnu/$f; \
    done
../mkinstalldirs /home/perry/abs/local/octave/pkg/opt/octave/share/octave/3.0.1/imagelib
for f in octave-sombrero.png; do \
      rm -f /home/perry/abs/local/octave/pkg/opt/octave/share/octave/3.0.1/imagelib/$f; \
      /bin/install -c -m 644 ./$f /home/perry/abs/local/octave/pkg/opt/octave/share/octave/3.0.1/imagelib/$f; \
    done
if test -n "desktop-file-install"; then \
      desktop-file-install --dir=/home/perry/abs/local/octave/pkg/opt/octave/share/applications \
        --vendor www.octave.org octave.desktop; \
    fi
make[2]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1/examples'
make[1]: Leaving directory `/home/perry/abs/local/octave/src/octave-3.0.1'
PKGBUILD: line 45: cd: /home/perry/abs/local/octave/pkg//opt/octave-3.0.1: No such file or directory
==> ERROR: Build Failed.
    Aborting...

did I miss something about texinfo on Arch ? the build says no 'tex' binary, but I have:

$ which texi2pdf texi2dvi
/usr/bin/texi2pdf
/usr/bin/texi2dvi

but no plain 'tex' binary that I can see. anyone know what this 'tex' binary is supposed to be? sounds like a wrapper script but I'm not sure. I will look into the texinfo build but if anyone knows this issue I'd appreciate some advice.

thanks

--edit--

full build output is here: http://pastebin.com/f45202dfd

Last edited by bioe007 (2008-04-25 14:57:41)

Offline

#9 2008-04-25 20:15:49

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: octave + dependencies

Do you want the doc? If not, there is probably a way to disable it at ./configure time.

Otherwise, it tells you that you don't have tex, and suggest you to install tetex.
This package is in extra but the project is unmaintained.
So you might want to try texlive from community instead.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#10 2008-04-25 22:30:03

bioe007
Member
Registered: 2007-11-12
Posts: 56

Re: octave + dependencies

yes, I wanted the doc. I did find texlive, but it installs to /opt, so I had to modify $PATH during the build to get it to work.

thanks for the help

Offline

#11 2008-04-26 06:58:32

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: octave + dependencies

bioe007 wrote:

yes, I wanted the doc. I did find texlive, but it installs to /opt, so I had to modify $PATH during the build to get it to work.

When you install something to /opt/, you need to log out and log in again so that /etc/profile gets properly sourced.
Or if you just need it in the current shell, you can just do temporarily "source /etc/profile".


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

Board footer

Powered by FluxBB