[Couenne] compiling Couenne in a macos

Pietro Belotti pbelott at clemson.edu
Mon Sep 27 15:54:29 EDT 2010


Hello João Pedro,

> $ ./Couenne/src/main/couenne
> dyld: Symbol not found: _Infinity
>  Referenced from: /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
>  Expected in: flat namespace
> in /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
> Trace/BPT trap
> $

As you said below, Infinity is defined in mach.o, which is included in the 
ASL library. The fact that it is not found in dynamic linking might 
indicate a problem with the linker itself (I never had such runtime 
problems before).

> Finally, I tried to link directly the file where Infinity is defined 
> (mach.o, from ASL/solvers) and it did work for this symbol, though 
> another missing symbol was reported (_L_val_ASL).

Apparently, L_val_ASL is the body of a #define line (in getstub.h) that 
looks like

#define L_val L_val_ASL

and although L_val_ASL never seems to be defined in the ASL, there is a 
function definition for L_val in value.c. The preprocessor should hence 
replace the two occurrences of L_val in value.c with L_val_ASL and forget 
about L_val.

In fact, if I edit value.c and replace both occurrences of L_val with 
L_val_ASL, everything compiles. I would suggest trying this as well. It 
didn't change anything for me (it was working before and it is working 
now), but who knows...

> I am using version 0.3 of Couenne, obtained though
> $ svn co https://projects.coin-or.org/svn/Couenne/stable/0.3 Couenne
> The compiler is
> $ gcc --version
> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
>
>
> I am pretty sure that this is a problem with the Apple gcc compiler,
> but any help would be appreciated...

It seems like this version of gcc is a little too sensitive, but compiling 
the ASL within Couenne has given some troubles before.

> PS: I tried to compile without ASL, but curiously the problem was not
> solved:
> $ ../configure -C --without-ASL --prefix=/usr/local FFLAGS="-m64 -O3 -fomit-frame-pointer -pipe"
> $ make
> [...]
> $ ./Couenne/src/main/couennedyld: Symbol not found: _Infinity
>  Referenced from: /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
>  Expected in: flat namespace
> in /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
> Trace/BPT trap
> $

This is instead a problem with Couenne, which should ignore everything in 
ASL if it is excluded.

Unfortunately I do not have a Mac at my avail at the moment and cannot try 
and replicate/solve the problem. I'll try to do this later.

Cheers,
Pietro

--
Pietro Belotti
Dept. of Mathematical Sciences
Clemson University
email: pbelott at clemson.edu
phone: 864-656-6765
www:   myweb.clemson.edu/~pbelott

On Sun, 26 Sep 2010, Joao Pedro Pedroso wrote:

> Hello,
>
> I am having problems with undefined symbols when compiling Couenne in
> a Mac OS X 10.6.4 (Leopard Snow).
>
> I had a first issue with the Fortran compiler (gfortran), which by
> default seems to be compiling for 32 bits; at some point in the
> compilation, the following error was issued:
>
> [...]
> ar cru .libs/libcoinhsl.a .libs/dummy.o .libs/ma27ad.o .libs/ma57ad.o .libs/mc19ad.o
> /usr/bin/ranlib: archive member: .libs/libcoinhsl.a(ma27ad.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
> [...]
>
> I solved this adding "-m64" to the Fortran configuration options:
>
> $ ../configure -C --prefix=/usr/local FFLAGS="-m64 -O3 -fomit-frame-pointer -pipe"
>
> Now it compiles without problems, but there is a runtime problem:
> $ ./Couenne/src/main/couenne
> dyld: Symbol not found: _Infinity
>  Referenced from: /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
>  Expected in: flat namespace
> in /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
> Trace/BPT trap
> $
>
> Strangely, the missing symbols were available in a static library at
> linking time; I checked it with 'nm amplsolver.a'.
>
> I did try to change the order of library inclusion, as suggested in
>   https://projects.coin-or.org/Couenne/ticket/1
> I was not exhaustive, but the changes I tried did not work; .e.g,
> putting amplsolver.a immediately after libCouenneReadnl.la:
>
> $ cd build/Couenne/src/main
> $ /bin/sh ../../../libtool --tag=CXX --mode=link g++  -O3 -fomit-frame-pointer -pipe -DNDEBUG -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas     -o couenne -rpath /usr/local/lib BonCouenne.o libBonCouenne.la ../readnl/libCouenneReadnl.la  /Users/jpp/src/Couenne/build/ThirdParty/ASL/amplsolver.a ../libCouenne.la  /Users/jpp/src/Couenne/build/Couenne/../Cbc/src/libCbc.la /Users/jpp/src/Couenne/build/Couenne/../Cgl/src/libCgl.la /Users/jpp/src/Couenne/build/Couenne/../Osi/src/OsiClp/libOsiClp.la /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/CbcBonmin/libbonmin.la /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/Algorithms/Branching/libbonbranching.la /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/Interfaces/libbonmininterfaces.la /Users/jpp/src/Couenne/build/Couenne/../Ipopt/src/Interfaces/libipopt.la /Users/jpp/src/Couenne/build/Couenne/../Ipopt/src/LinAlg/liblinalg.la  /Users/jpp/src/Coue!
 nne/build/Couenne/../Osi/src/libOsi..la /Users/jpp/src/Couenne/build/Couenne/../Clp/src/libClp.la /Users/jpp/src/Couenne/build/Couenne/../CoinUtils/src/libCoinUtils.la -lm -ldl `cat /Users/jpp/src/Couenne/build/Couenne/../Ipopt/src/Interfaces/ipopt_addlibs_cpp.txt` `cat /Users/jpp/src/Couenne/build/Couenne/../CoinUtils/coinutils_addlibs.txt`
> g++ -O3 -fomit-frame-pointer -pipe -DNDEBUG -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -o .libs/couenne BonCouenne.o -Wl,-bind_at_load  ./.libs/libBonCouenne.dylib ../readnl/.libs/libCouenneReadnl.dylib /Users/jpp/src/Couenne/build/ThirdParty/ASL/amplsolver.a ../.libs/libCouenne.dylib /Users/jpp/src/Couenne/build/Couenne/../Cbc/src/.libs/libCbc.dylib /Users/jpp/src/Couenne/build/Couenne/../Cgl/src/.libs/libCgl.dylib /Users/jpp/src/Couenne/build/Couenne/../Osi/src/OsiClp/.libs/libOsiClp.dylib /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/CbcBonmin/.libs/libbonmin.dylib /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/Algorithms/Branching/.libs/libbonbranching.a /Users/jpp/src/Couenne/build/Couenne/../Bonmin/src/Interfaces/.libs/libbonmininterfaces.a /Users/jpp/src/Couenne/build/Couenne/../Ipopt/src/Interfaces/.libs/libipopt.dylib /Users/jpp/src/Couenne/build/Couenne/../Ipopt/src/LinAlg/.l!
 ibs/liblinalg.a /Users/jpp/src/Couenne/build/Couenne/../Osi/src/.libs/libOsi.dylib /Users/jpp/src/Couenne/build/Couenne/../Clp/src/.libs/libClp.dylib /Users/jpp/src/Couenne/build/Couenne/../CoinUtils/src/.libs/libCoinUtils.dylib -lpthread -ldl -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. /usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64/libgfortranbegin.a -lgfortran -lgcc_s.10.4 -lSystem -llapack -lblas -lm
> creating couenne
> $ ./couenne
> dyld: Symbol not found: _Infinity
>  Referenced from: /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
>  Expected in: flat namespace
> in /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
> Trace/BPT trap
> $
>
>
> Finally, I tried to link directly the file where Infinity is defined
> (mach.o, from ASL/solvers) and it did work for this symbol, though
> another missing symbol was reported (_L_val_ASL).
>
> I am using version 0.3 of Couenne, obtained though
> $ svn co https://projects.coin-or.org/svn/Couenne/stable/0.3 Couenne
> The compiler is
> $ gcc --version
> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
>
>
> I am pretty sure that this is a problem with the Apple gcc compiler,
> but any help would be appreciated...
>
> Best regards,
>
> Joao Pedro
> --
> PS: I tried to compile without ASL, but curiously the problem was not
> solved:
> $ ../configure -C --without-ASL --prefix=/usr/local FFLAGS="-m64 -O3 -fomit-frame-pointer -pipe"
> $ make
> [...]
> $ ./Couenne/src/main/couennedyld: Symbol not found: _Infinity
>  Referenced from: /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
>  Expected in: flat namespace
> in /Users/jpp/src/Couenne/build/Couenne/src/readnl/.libs/libCouenneReadnl.0.dylib
> Trace/BPT trap
> $
>


More information about the Couenne mailing list