A blog about my experiences with bioinformatics, operating systems, and random other technologies and bits.

Monday, June 18, 2007

Building GCC on Solaris

Update: On OpenSolaris 2008.11 I used the following (after having intalled gcc packages from blastwave):

../gcc-4.3.2/configure --with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,objc,fortran --with-mpfr=/opt/csw --with-gmp=/opt/csw --with-libiconv-prefix=/opt/csw --prefix=/usr/local && gmake -j4

I got a new laptop (my old one was 2 1/2 years old, huge, and prone to overheating - but other than that still not a bad machine). The new laptop is a Dell Inspiron E1505N, shipped with Ubuntu. I removed Ubuntu immediately as my experiences have never been good with it. Vista was installed and removed the next day as well. I'm now happily running (for the most part) Windows XP 64 edition and Solaris Developer edition on the machine. Perhaps a full review of Solaris will be in order later, but for now, I wanted to show how to build GCC 4.2.0 on Solaris.

It is rather simple once you know the tricks.... I leave it to the reader to deduce why all this works, as much of it was just trial and error. Note: I never got gcj to work and I didn't bother with ada. There were several bugs in boehm-gc with which I ran out of patience. Please let me know if you have better success =) I'm new to Solaris still; I've primarily been a user of Linux for the past few years.

Here is the path that was used to build GCC:
bash-3.00$ echo $PATH

export LD_LIBRARY_PATH=/opt/csw/lib
(make sure you have mpfr and gmp installed - I installed the packages from blastwave)

And the command to build:
../gcc-4.2.0/configure --with-as=/opt/csw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-threads=posix --enable-multilib --enable-nls --with-included-gettext --with-system-zlib --with-mpfr=/opt/csw --with-gmp=/opt/csw --enable-languages=c,c++,objc,fortran --enable-shared --with-libiconv-prefix=/opt/csw && gmake -j 4

The result:

bash-3.00$ gcc -v
Reading specs from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/specs
Target: i386-pc-solaris2.8
Configured with: ../sources/gcc-4.0.2/configure --prefix=/opt/csw/gcc4 --with-local-prefix=/opt/csw --with-gnu-as --with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix --enable-shared --enable-multilib --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib --with-system-zlib --enable-languages=c,c++,f95,java,objc,ada
Thread model: posix
gcc version 4.0.2

No comments: