Friday, November 30, 2007

Building ARPACK on openSUSE 10.3

I needed an installation of ARPACK for FreeMat and couldn't find a convenient way to get it installed on an openSUSE box I was using. So I googled for a bit and came up with the following hack.
  • Make sure fortran is installed: rpm -q gcc-fortran.
  • Download the RPM from ATrpms.
  • Extract files from rpm using (see ):
    rpm2cpio arpack-2.1.7.src.rpm | cpio -ivmud
  • Edit the .spec file so the BuildRequires statement for gfortran is for gcc-fortran instead of gcc-gfortran. (That took several "rpm -q --provides gcc-gfortran" not found queries before I realized the package is named gcc-fortran on openSUSE.)
  • Build the RPM: rpmbuild -ba arpack.spec
  • Install the RPMs. In my case the RPMS were in /usr/src/packages/RPMS/i586. I installed the arpack-2.1-7.i586.rpm, then arpack-devel-2.1-7.i586.rpm and finally arpack-static-2.1-7.i586.rpm.

Unfortunately, FreeMat still does not pick up the version of ARPACK built above when running configure. I suspect it's something to do with the differences between f77 and gfortran. Check here for some fortran relevant autoconf macros.

FreeMat checks the fortran configuration with AC_PROG_F77 and AC_F77_LIBRARY_LDFLAGS in it's and uses several AC_F77_XXX macros in acinclude.m4 and checks for ARPACK with AC_F77_FUNC(znaupd).

Have to get back to this one later.

No comments: