[Top][All Lists]

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

Re: Build failure on OS X

From: Otto Maddox
Subject: Re: Build failure on OS X
Date: Sat, 31 Dec 2005 16:16:58 +0000

OK, thanks to the helpful responses on this list, a bit of googling
and some experimentation, I think I have made some progress.  I'll now
describe what I have figured out so far, because it might generalise
to other situations when using a third-party g77 in concert with
Apple's gcc/g++ 3.3.

My GCC 3.4.5 (which includes g77, as well as gcc and g++) is installed
under /opt/local/gcc34.

I restarted the configure/make process to make octave as minimal as I
could (for debugging purposes):

$ env CC=/usr/bin/gcc-3.3 CXX=/usr/bin/g++-3.3
F77=/opt/local/gcc34/bin/g77 ./configure --disable-readline
$ make

and it goes OK until this (continued afterwards):

    /usr/bin/g++-3.3  -I. -I.. -I../liboctave -I../src
    -I../libcruft/misc  -DHAVE_CONFIG_H  -Wall -W -Wshadow -g -O2  \
    -L..    -o octave \
    main.o  balance.o  besselj.o  betainc.o  chol.o  colloc.o  daspk.o 
    dasrt.o  dassl.o  det.o  eig.o  expm.o  fft.o  fft2.o  fftn.o 
    fftw_wisdom.o  filter.o  find.o  fsolve.o  gammainc.o  gcd.o 
    getgrent.o  getpwent.o  getrusage.o  givens.o  hess.o  inv.o  kron.o
     lpsolve.o  lsode.o  lu.o  minmax.o  pinv.o  qr.o  quad.o  qz.o 
    rand.o  schur.o  sort.o  sqrtm.o  svd.o  syl.o  time.o \
    -L../liboctave -L../libcruft -L../src  \
    ../src/liboctinterp.a ../liboctave/liboctave.a 
    ../libcruft/libcruft.a   \
     -framework vecLib  -lncurses -lm 
     -lm -lfrtbegin -lg2c -lgcc_s -lSystemStubs -lSystem
    ld: warning multiple definitions of symbol _xerbla_
    ../src/liboctinterp.a(xerbla.o) definition of _xerbla_ in section
    module) definition of _xerbla_
    ld: Undefined symbols:
    make[2]: *** [octave] Error 1
    make[1]: *** [src] Error 2
    make: *** [all] Error 2

In particular, ld has the following two options passed to it:


which contain Fortran libraries.  But they also contain
libstdc++{.a,.dylib} and libgcc.a, which I temporarily "disabled" by


The problem is that those libraries were shadowing the system
libraries /usr/lib/gcc/darwin/3.3/libstdc++.a and
/usr/lib/gcc/darwin/3.3/libgcc.a.  These system libraries contain the
"undefined symbols" which ld was complaining about.

saveFP and restFP problems seem to be well known to developers.  But I
can only assume that the undefined mangled C++ names are also for
Apple extensions, which is why they're not contained in

(By the way, adding -lcc_dynamic to the linking options is not needed
because saveFP and restFP are contained in

After doing all this, I did another make, followed by make install
which succeeded.

The solution seems to work, but is ugly.  So another question
remains... how to do all this cleanly, that is, how to tell the
compiler/linker not to link against these particular libraries so I
don't have to rename them.  Any ideas?


-- - Accessible with your email software
                          or over the web

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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