0

I have tried to compile Octave 3.4.3 on Kubuntu 10.04 LTS on an AMD64 machine but make fails with the following error

/bin/bash ../libtool  --tag=F77   --mode=compile f77  -O -c -o arpack/src/libcruft_la-cgetv0.lo `test -f 'arpack/src/cgetv0.f' || echo './'`arpack/src/cgetv0.f
libtool: compile:  f77 -O -c arpack/src/cgetv0.f  -fPIC -o arpack/src/.libs/libcruft_la-cgetv0.o
   cgetv0:
Cannot open file debug.h
/usr/bin/f77: aborting compilation
make[2]: *** [arpack/src/libcruft_la-cgetv0.lo] Error 1
make[2]: Leaving directory `/home/andrew/Documents/my_source_makes/octave-3.4.3/libcruft'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andrew/Documents/my_source_makes/octave-3.4.3'
make: *** [all] Error 2 

On the assumption that something might be wrong with the relevant(?) debug.h file, the contents of octave-3.4.3/libcruft/arpack/src/debug.h are

c
c\SCCS Information: @(#)
c FILE: debug.h   SID: 2.3   DATE OF SID: 11/16/95   RELEASE: 2
c
c     %---------------------------------%
c     | See debug.doc for documentation |
c     %---------------------------------%
      integer  logfil, ndigit, mgetv0,
     &         msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
     &         mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
     &         mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
      common /debug/
     &         logfil, ndigit, mgetv0,
     &         msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
     &         mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
     &         mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd 

I don't really understand any of this so can anyone point out why make is failing and what I can do to fix it?

halfdan
  • 33,545
  • 8
  • 78
  • 87
babelproofreader
  • 530
  • 1
  • 6
  • 20

1 Answers1

1

Please see http://linuxpixies.blogspot.com/2011/05/building-octave-34-on-debian-sid.html.

I think this should solve your problem.

OK, I thought my answer would be easily adapted to ubuntu.

So, I adding more info:

aptitude build-dep octave2.9 should pool all dependecies. Please make sure you have the UNIVERSE repos enabled in your sources.list. Than you need to install gcc-4.3 and gfortran-4.3.

I hope this helps.

oz123
  • 27,559
  • 27
  • 125
  • 187
  • Unfortunately your suggestion does not work for me - sudo aptitude build-dep octave3.2 gives an error message Unable to find the source package for "octave3.2" and sudo aptitude install gcc-4.5 gfortran-4.5 g++-4.5 gives an error message Couldn't find any package whose name or description matched "gcc-4.5" Couldn't find any package whose name or description matched "gfortran-4.5" Couldn't find any package whose name or description matched "g++-4.5" – babelproofreader Nov 19 '11 at 19:16
  • That is because ubuntu 10.04 comes with Octave2.9. – oz123 Nov 19 '11 at 20:59
  • I tried changing the numbers to 4.3 instead of 4.5, but I still get the same error when I try make. Is it perhaps an error with the arpack libraries I have installed? – babelproofreader Nov 23 '11 at 20:59
  • The libraries were installed from the repositories using Synaptic. I have also successfully installed Octave 3.2.3 from the repositories using Synaptic, so maybe it isn't the libraries. I really am at a complete loss. – babelproofreader Nov 24 '11 at 21:10
  • i think i know what is your problem. Your fortran compiler is not there. it seems like /usr/bin/f77 is working. you need to install gfortran. and make sure this is your compiler. – oz123 Nov 24 '11 at 22:14
  • do me a a favor and post here what is your fortan77 compiler. Do "which f77" and then "file /usr/bin/f77". put the answers here. – oz123 Nov 24 '11 at 22:22
  • "which f77" gives /usr/bin/f77 and "file /usr/bin/f77" gives /usr/bin/f77: symbolic link to `/etc/alternatives/f77' Additionally, the Synaptic package manager shows that I already have gfortran-4.4 installed. – babelproofreader Nov 27 '11 at 14:37
  • do you know about the debian-alternatives system ? you need to make sure that your gfortran is your fortran compiler. So, just to bypass the alternatives system, remove the symbolic link, and when you configure your install do "./configure --with-f77=gfortran-4.3" or something like that. Btw, did you do make clean between all the builds ? I have the feeling your problem is in general the build process and not ubuntu ... – oz123 Nov 27 '11 at 15:07
  • Until your previous comment I had not even known of the existence of the debian-alternatives system, but a bit of Google-foo has cleared up some of my ignorance. On the matter of removing the symbolic link can you confirm which f77 file needs to be removed; the one that resides in /usr/bin or the one in /etc/alternatives? On visual inspection of both they seem to be identical. – babelproofreader Nov 28 '11 at 21:26
  • move both of them to a known location so you don't destroy anything computer, and just make sure your are compiling with gfortran. Sometimes the default fortran77 compiler in debian is actually f2c - which translates fortran77 to C code, but unfortunately it fails compiling octave libraries... – oz123 Nov 28 '11 at 22:42
  • I think I've finally managed to successfully compile and install Octave-3.4.3! I moved the f77 files as you suggested and then issued the command ./configure F77=gfortran-4.4 followed by make, make check and sudo make install and everything seemed to go as it should. Now when I type octave in the terminal the "splash" says that Octave-3.4.3 is running. Many thanks for your patience and help. – babelproofreader Nov 30 '11 at 04:32
  • don't forget to run make check to run the tests! – oz123 Nov 30 '11 at 04:38