Installing CLN on Mac OS X (darwin)

GiNaC -- symbolic math library, CLN -- class library of numbers

(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:

  1. 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"

  2. Jonathan informed me about fixes in some header files:

  3. make CC="g++" CXX="g++" LDFLAGS="-lc -lstdc++ -L/sw/lib -Wl,-read_only_relocs,warning"

  4. Watch the console scroll by with compilation commands for an hour... You mustn't take your attention away from the screen or it won't work. (Pardon the sarcasm, it's late here...)
    I noticed some linker warning message about not finding the real stdc++ library:
    *** 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.
    
    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 libgmp but the anal-retentive path specifications fixed that.

  5. That should do the trick. Given that everything is successful, make check. Go get coffee. Wait, I don't drink coffee.

  6. Assuming that all tests passed, make install. That wasn't so bad now.
If you try these commands, or variations thereof, please let me know whether your build is successful, especially if you work out exactly which syllables of the above incantations are needed, and which are not. Eventually, with restored patience, I'll try adding -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...


[back to main]