help-octave
[Top][All Lists]
Advanced

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

Re: ARPACK library causing problem while compiling Octave-2.9.10


From: Daniel Oberhoff
Subject: Re: ARPACK library causing problem while compiling Octave-2.9.10
Date: Thu, 26 Apr 2007 09:52:57 +0200

Hi,

I am not sure if this is still important now, maybe if you want to install the arpack package from forge.

Your makefile looks pretty regular to me. But what really matters is that the corresponding settings are the same for the other fortran packages (blas, lapack, etc...), so you should check how those were compiled too. Or if you installed them with a binary installer (i.e. your flavour linux package installer) you should probably install arpack the same way.

Daniel

Am 20.04.2007 um 16:28 schrieb R S Ananda Murthy:

Daniel Oberhoff wrote:
Hi,

When I was preparing a 2.9.10 port for macports I ran into similar problems with arpack. The problem there was that the arpack port used different compiler directives/compilers for compiling the fortran files. The difference is in the way underscores are used. I have no overview which is used when, but I have seen __fun and _fun before, fun_ seems unusual to me.

The compiler directives should be the same for all of your fortran libraries (arpack, blas, maybe also suitesparse?). And in your case they seem not to be.

You could try to find out where those functions are usually defined (maybe lapack or blas) and then look at how the names are mangled inside that library (ldd on linux, otool on osx) and then compare to how they are mangled in arpack.

It is a little weird in your case also though, because the undefined references seem to be inside arpack, so I wonder how you ever got arpack compiled. Or was it a binary install using rpms or debian packages? In that case the corresponding dependency manager is broken.

Octave is usually happey when all fortran libs mangle names the same, detects the mangling and applies it everywhere, it just has to be consistent.

Daniel

Am 20.04.2007 um 13:23 schrieb R S Ananda Murthy:

Hello,

I am trying to compile octave-2.9.10 on Zenwalk-4.4.1. I have already arpack library installed. This is detected by configure. But compiling proceeds for some time and then stops with the following error message:

/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slartg_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slahqr_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slarfg_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `cunm2r_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slapy2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `zlanhs_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `claset_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clahqr_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `strevc_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slarnv_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slanhs_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `ssteqr_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slanst_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slasrt_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clacpy_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `strsen_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `sorm2r_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `ctrsen_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `sgeqr2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slacpy_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clascl_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `zlarnv_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slamch_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clartg_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `dlanhs_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clanhs_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slae2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slascl_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `dlarnv_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slarf_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `cgeqr2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slasr_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slabad_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slaev2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slanv2_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `ctrevc_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `clarnv_'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../libarpack.so: undefined
reference to `slaset_'
collect2: ld returned 1 exit status
make[2]: *** [octave] Error 1
make[2]: Leaving directory `/root/octave_new/octave-2.9.10/src'
make[1]: *** [src] Error 2
make[1]: Leaving directory `/root/octave_new/octave-2.9.10'
make: *** [all] Error 2

What may be the problem?

Thanks for your help,

Anand
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave



I compiled ARPACK from source. I have BLAS and LAPACK already installed. This is my ARmake.inc:

###################################################################### #####
#
#  Program:         ARPACK
#
#  Module:          ARmake.inc
#
#  Purpose:         Top-level Definitions
#
#  Creation date:   February 22, 1996
#
#  Modified:
#
#  Send bug reports, comments or suggestions to address@hidden
#
###################################################################### ######
#
# %---------------------------------%
# |  SECTION 1: PATHS AND LIBRARIES |
# %---------------------------------%
#
#
# %--------------------------------------%
# | You should change the definition of  |
# | home if ARPACK is built some place   |
# | other than your home directory.      |
# %--------------------------------------%
#
home = $(PWD)/.
#
#  %--------------------------------------%
#  | The platform identifier to suffix to |
#  | the end of library names             |
#  %--------------------------------------%
#
PLAT = PIV
#
#  %------------------------------------------------------%
#  | The directories to find the various pieces of ARPACK |
#  %------------------------------------------------------%
#
BLASdir      = $(home)/BLAS
LAPACKdir    = $(home)/LAPACK
UTILdir      = $(home)/UTIL
SRCdir       = $(home)/SRC
#
#DIRS        = $(BLASdir) $(LAPACKdir) $(UTILdir) $(SRCdir)
#
# %-------------------------------------------------------------------% # | Comment out the previous line and uncomment the following | # | if you already have the BLAS and LAPACK installed on your system. | # | NOTE: ARPACK assumes the use of LAPACK version 2 codes. | # %-------------------------------------------------------------------%
#
DIRS         = $(UTILdir) $(SRCdir)
#
# %---------------------------------------------------%
# | The name of the libraries to be created/linked to |
# %---------------------------------------------------%
#
ARPACKLIB  = $(home)/libarpack.a
LAPACKLIB =
BLASLIB =
#
ALIBS =  $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB)
#
#
# %---------------------------------------------------------%
# |                  SECTION 2: COMPILERS                   |
# |                                                         |
# | The following macros specify compilers, linker/loaders, |
# | the archiver, and their options.  You need to make sure |
# | these are correct for your system.                      |
# %---------------------------------------------------------%
#
#
# %------------------------------%
# | Make our own suffixes' list. |
# %------------------------------%
#
.SUFFIXES:
.SUFFIXES:    .f    .o
#
# %------------------%
# | Default command. |
# %------------------%
#
.DEFAULT:
   @$(ECHO) "Unknown target $@, try:  make help"
#
# %-------------------------------------------%
# |  Command to build .o files from .f files. |
# %-------------------------------------------%
#
.f.o:
   @$(ECHO) Making $@ from $<
   @$(FC) -c $(FFLAGS) $<
#
# %-----------------------------------------%
# | Various compilation programs and flags. |
# | You need to make sure these are correct |
# | for your system.                        |
# %-----------------------------------------%
#
FC      = f77
FFLAGS    = -O -fPIC

LDFLAGS =
CD      = cd

ECHO    = echo

LN      = ln
LNFLAGS = -s

MAKE    = make

RM      = rm
RMFLAGS = -f

SHELL   = /bin/sh
#
#  %----------------------------------------------------------------%
#  | The archiver and the flag(s) to use when building an archive   |
#  | (library).  Also the ranlib routine.  If your system has no    |
#  | ranlib, set RANLIB = touch.                                    |
#  %----------------------------------------------------------------%
#
AR = ar
ARFLAGS = rv
#RANLIB  = touch
RANLIB   = ranlib
#
# %----------------------------------%
# | This is the general help target. |
# %----------------------------------%
#
help:
   @$(ECHO) "usage: make ?"


This is my build script for ARPACK:


#!/bin/bash

#---( Zenwalk Build Script
#---( Build Script written for ARPACK
#---( Home Page: http://www.caam.rice.edu/software/ARPACK/
#---( Source1 URL: http://www.caam.rice.edu/software/ARPACK/SRC/ arpack96.tar.gz #---( Source2 URL: http://www.caam.rice.edu/software/ARPACK/SRC/ patch.tar.gz #---( Source3 URL: http://www.caam.rice.edu/software/ARPACK/ RiceBSD.doc
#---( Build script by R S Ananda Murthy (address@hidden)
#---( Date build script was last modified: Friday, April, 20, 2007.


#------------------( Set Package Name & Version )

soft='arpack'
softversion='2.1'
packageversion='46.1'


#------------------( Check for source files )


if [ -f arpack96.tar.gz  ]; then
  echo "Source1 file .. ok"
else
  echo "Source1 file does not exit. Downloading it ..."
  wget -c http://www.caam.rice.edu/software/ARPACK/SRC/arpack96.tar.gz
fi


if [ -f patch.tar.gz ]; then
  echo "Source2 file .. ok"
else
  echo "Source2 file does not exit. Downloading it ..."
  wget -c http://www.caam.rice.edu/software/ARPACK/SRC/patch.tar.gz
fi

if [ -f RiceBSD.doc ]; then
  echo "Source3 file .. ok"
else
  echo "Source3 file does not exit. Downloading it ..."
  wget -c http://www.caam.rice.edu/software/ARPACK/RiceBSD.doc
fi


#------------------( Set Package CPU Architecture Optimizations )


arch='i486'
cpu='i686'


#------------------( Set Build Location Variables )


buildir=$(pwd)
srcpkg="$buildir/arpack96.tar.gz"
src="$buildir/ARPACK"
package="$soft-$softversion-$arch-$packageversion"
dest="$buildir/$package"


#------------------( Clean, prepare the work area and extract the source code )


cd $buildir
rm -rf $src
tar -xvf $srcpkg
tar -xvf patch.tar.gz
rm -f $dest.tgz
rm -rf $dest
mkdir -p $dest


#------------------( Set Build Ownerships and CFLAGS and CXXFLAGS )


chown -R root:root .

find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;

export CFLAGS="-O2 -march=$arch -mtune=$cpu"
export CXXFLAGS="-O2 -march=$arch -mtune=$cpu"


#------------------( Configure, Make And Install The Software )


rm -f $src/ARmake.inc
cp $buildir/ARmake.inc.custom $src/ARmake.inc

cd $src
mkdir static shared

cd shared

for dir in ../SRC ../UTIL; do
make -f $dir/Makefile VPATH=$dir srcdir=$dir FC=g77 FFLAGS="- fPIC" \
      single double complex complex16
 done
 gcc -shared -Wl,-soname,libarpack.so.2 -o libarpack.so.2.1 *.o

cd ..

cd static
 for dir in ../SRC ../UTIL; do
make -f $dir/Makefile VPATH=$dir srcdir=$dir FC=g77 FFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" all
 done

ar rv libarpack.a *.o
ranlib libarpack.a


#------------------( Move Library To Correct Location )


install -d $dest/usr/lib
install -p -m644 $buildir/ARPACK/static/libarpack.a $buildir/ARPACK/ shared/libarpack.so.2.1 $dest/usr/lib
ln -s libarpack.so.2.1 $dest/usr/lib/libarpack.so.2
ln -s libarpack.so.2 $dest/usr/lib/libarpack.so


#------------------( Move Documentation and License To Correct Location )



mkdir -p $dest/usr/doc/$soft-$softversion
cp -a $buildir/ARPACK/README $dest/usr/doc/$soft-$softversion
cp -a $buildir/ARPACK/DOCUMENTS/*.doc $dest/usr/doc/$soft-$softversion
cp -a $buildir/RiceBSD.doc $dest/usr/doc/$soft-$softversion



#------------------( Copy Build The Script )


mkdir -p $dest/usr/src/$soft-$softversion
cp $buildir/build-$soft.sh $dest/usr/src/$soft-$softversion/build- $soft.sh


#------------------( Create The Slackdesc )



mkdir -p $dest/install
cat <<EOF > $dest/install/slack-desc
|-----handy- ruler------------------------------------------------------| arpack: ARPACK (A collection of F77 routines to solve eigen value problems)
arpack:
arpack: The package is designed to compute a few eigenvalues and corresponding arpack: eigenvectors of a general n by n matrix A. It is most appropriate for arpack: large sparse or structured matrices A where structured means that a arpack: matrix-vector product w <- Av requires order n rather than the usual arpack: order n**2 floating point operations. This software is based upon an arpack: algorithmic variant of the Arnoldi process called the Implicitly
arpack: Restarted Arnoldi Method (IRAM).
arpack:
arpack: Packaged on a Zenwalk-4.4.1 system.
EOF



#------------------( Create The doinst.sh )


cat <<EOF > $dest/install/doinst.sh
ldconfig
EOF



#------------------( Compress The Package And Clean Up The Work Area )


cd $dest
makepkg -l y -c n $package.tgz
mv $package.tgz ../$package.tgz
rm -rf $src
rm -rf $dest


#------------------( Generate the MD5 Check Sum )


cd $buildir
md5sum $package.tgz > $package.md5
zen_pkgcheck_new.pl $package.tgz

This buildscript is working fine and creating the ARPACK package.

Should octave-2.9.10 be compiled without installing ARPACK as suggested by David Bateman?


--- Anand




reply via email to

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