octave-maintainers
[Top][All Lists]
Advanced

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

Re: f2c obsolete?


From: Thomas Treichl
Subject: Re: f2c obsolete?
Date: Sat, 27 Oct 2007 15:18:43 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

John W. Eaton schrieb:
On 25-Oct-2007, Thomas Treichl wrote:

| Yes it works for IA32. However I'm trying to cross-compile Octave for the PPC
Octave's current configure script is not going to work automatically
for cross builds because it has run-time checks for things like
whether the LAPACK library was compiled with a compatible calling
convention and whether strptime is broken.  I don't see good fixes for
these problems.

jwe

Hi John,

I was a little bit lazy in my last email and I think I should have explained
more about cross-compiling Octave on the IA-architectures for PPC-architectures
on a Mac (so this email is meant more as an info email, if somebody is interested in topic). The fort77 script works for me to build Octave.app on IA and PPC (but I must comment out the ./configure test for PPC - cf. the bottom of this email).

I don't have to use the --build, --target, --host etc. options to cross-compile
on IA32 for PPC, it's a bit more different. I also should have told you the last
time that every IA-Mac comes with a backend that is called 'Rosetta' which makes
it possible to execute PPC-binaries on the IA-platform (however this in detail
works in the background - I don't really know it and I think it doesn't really
matter here) - but what I wanted to say is that I don't fall into the trap eg.
if something is wrong in the LAPACK lib for PPC then I won't see the problem, I
can see the problem because of Rosetta (at least I hope that I can see it). If I
cross-compile for PPC then all tests of the ./configure script are runnning as
PPC-binaries on the IA-platform, it's just a matter which SDK and compiler
options are used.

For the IA-architecture I can use the following configuration flags before I
call ./configure (no cross-compilation, and I reduce these options to the
minimum options that are required to make my explanation easier to understand)

  INSTDIR=/tmp/dependencies-i386
  ARCH="-arch i386"

  CC="gcc ${ARCH}"
  CPP="${GCC} -E"
  CXX="g++ ${ARCH}"

  CCFLAGS="-I${INSTDIR}/include"
  CPPFLAGS="${CCFLAGS}"
  CXXFLAGS="${CCFLAGS}"
  LDFLAGS="-L${INSTDIR}/lib"

  F77="fort77"
  FLIBS="-L${INSTDIR}/lib -lf2c"
  FFLAGS="-I${INSTDIR}/include"

For cross-compilation (supporting gcc-3.3, gcc-4.0.1 and Mac OS 10.3.9(about
2..3 years old) to Mac OS 10.4.10(current) and hopefully Mac OS 10.5(this has
been released two days ago) - you can see the variety of systems that we try to
support with just one Octave.app PPC-binary) I always needed to change the
minimum options from above into this

  export MACOSX_DEPLOYMENT_TARGET=10.3

  INSTDIR=/tmp/dependencies-ppc
  ARCH="-arch ppc"

  CC="gcc ${ARCH}"
  CPP="${GCC} -E"
  CXX="g++ ${ARCH}"

  CCFLAGS="-isysroot /Developer/SDKs/MacOSX10.3.9.sdk -I${INSTDIR}/include"
  CPPFLAGS="${CCFLAGS}"
  CXXFLAGS="${CCFLAGS}"
  LDFLAGS="-L${INSTDIR}/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot \
    -Wl,/Developer/SDKs/MacOSX10.3.9.sdk"

  F77="fort77"
  FLIBS="-L${INSTDIR}/lib -lf2c"
  FFLAGS="-Wc,-arch -Wc,ppc -Wc,-isysroot -Wc,/Developer/SDKs/MacOSX10.3.9.sdk\
    -I${INSTDIR}/include"

and then simply call ./configure, make, make install... and after these steps I
can produce the Octave.app package and then I can check the Octave.app package
again using the Rosetta backend.

  Thomas

PS. My ./configure problem if I cross-compile for PPC on IA, I changed configure.in line 760 into this

    AC_LANG_PUSH(Fortran 77)
    (eval "$ac_compile"; eval "$ac_link") 2>&AS_MESSAGE_LOG_FD
  echo $ac_compile
  echo $ac_link
    AC_LANG_POP(Fortran 77)

The output is

  checking BLAS library calling convention compatibility...
  $F77 -c $FFLAGS conftest.$ac_ext >&5
  $F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5

the config.log says:

  configure:13716: checking BLAS library calling convention compatibility
    MAIN foo:
    MAIN foo:
  i686-apple-darwin8-gcc-4.0.1: unrecognized option '-syslibroot'
  /usr/bin/ld: warning conftest.o cputype (18, architecture ppc) does not match
    cputype (7) for specified -arch flag: i386 (file not loaded)
  /usr/bin/ld: can't map file: /Developer/SDKs/MacOSX10.3.9.sdk ((os/kern)
    invalid argument)collect2: ld returned 1 exit status

So the problem is that I can't feed through the LD flags through the fort77 script to the linker. Can we change the test in a way that we link the program outside of AC_LANG_PUSH(Fortran 77), AC_LANG_POP(Fortran 77) with g++?

  Thomas


reply via email to

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