(last updated 3/24/04 by yours truly, Fang)
Finally, I've successfully compiled and installed CLN 1.1.6 for Mac OS X.
My system is a dual (533 MHz) G4 with 256 MB RAM, running OS X 10.3.3.
(Yeah, I know, slightly outdated, I'm due for a new machine next year...)
I used Apple's gcc/g++-3.3
.
All the prerequisite libraries and tools (such as libgmp
) have been
installed using fink
.
(I used a few optional tools in the process:
ccache
and distcc
to speedup recompilations
and use both of my low-end processors for parallel make-ing.)
What was the challenge in building it and why is there a page for this?
There are some common issues with compiling some open source packages
out-of-the-box with configure
and make
.
The linker was the greatest stumbling block to overcome, with some
help from a correspondent,
Jonathan Brandmeyer.
Here are the magic incantations I invoked to install CLN:
configure --with-gmp CC="g++" CXX="g++" CPPFLAGS=-I/sw/include LDFLAGS="-lc -lstdc++ -L/sw/lib -Wl,-read_only_relocs,warning" CFLAGS=-I/sw/include CXXFLAGS="-I/sw/include -L/sw/lib"
g++
with "ccache
" for fast re-building, which is not necessary./sw/include
" and "/sw/lib
" direct the
compiler/linker to look in the fink paths for libgmp
.g++
, as opposed to gcc
, along with -lstdc++
overcame some linker errors
about not finding symbols such as:
etc., during building of executables in the_ZTVN10__cxxabiv117__class_type_infoE __ZTVN10__cxxabiv120__si_class_type_infoE __ZTVN10__cxxabiv121__vmi_class_type_infoE __ZTVSt9bad_alloc __ZTVSt9exception ___cxa_pure_virtual ___gxx_personality_v0
tests
directory.
-lc
just for good measure, because I've had issues with omitting it before in other programs that happen to use libc
-Wl,-read_only_relocs,warning
, the linker dies with:
ld: .libs/libcln.3.0.0.dylib-master.o has external relocation entries in non-writable section (__TEXT,__StaticInit) for symbols:
include/cln/config.h
, comment out
#define ASM_UNDERSCOREbecause it is wrong. Why? I'd have to give it some thought...
include/cln/number.h
reads #if 0Again, didn't stop to think about why, just wanted to compile the damn thing already.
make CC="g++" CXX="g++" LDFLAGS="-lc -lstdc++ -L/sw/lib -Wl,-read_only_relocs,warning"
configure
script,
which generated the libtool
script, didn't always respect the options
I passed to it. Which? I forget, but rather than think about it,
I just hit it with a bigger hammer.
stdc++
library:
but the build process completed successfully in the end, so I don't know why I bothered to even write about it here. Ah, yes, because I used to get that message regarding*** Warning: linker path does not have real file for library -lstdc++. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libstdc++ and none of the candidates passed a file format test *** using a file magic. Last file checked: /usr/lib/gcc/darwin/default/libstdc++.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it.
libgmp
but the anal-retentive path specifications fixed that.
make check
.
Go get coffee. Wait, I don't drink coffee.
make install
.
That wasn't so bad now.
-O3
or -mcpu=7450 -fast
to CFLAGS
to see what this
baby is really made of.
Now, onto installing GiNaC. Hmmm, which version should I attempt first, 1.1.6, 1.1.7, or 1.2.0? I'll just let my computer run overnight and see what happens in the morning.
to be continued...