Recent Changes - Search:

edit SideBar

PtolemyClassic

Ptolemy Classic requires an old version of C++, below are the steps I took under Ubuntu.

Building gcc-2.95

Based on http://www.trevorpounds.com/blog/?p=111 (PDF)

I started with gcc-4.9.2 under RHEL, but had problems so I moved to Ubuntu.

sudo mkdir -p /opt/x86_64/gcc
sudo chown $USER /opt/x86_64/gcc

gcc-4.4.2

mkdir gcc-4.4.2
cd gcc-4.4.2
wget http://www.netgull.com/gcc/releases/gcc-4.4.2/gcc-4.4.2.tar.gz
tar xzf gcc-4.4.2.tar.gz
mkdir gcc-4.4.2-objdir
cd gcc-4.4.2-objdir
../gcc-4.4.2/configure --prefix=/opt/x86_64/gcc/gcc-4.4.2 --enable-languages=c,c++
make >& make.out
make install >& install.out

gcc-3.4.6

cd ../..
mkdir gcc-3.4.6
cd gcc-3.4.6
wget http://www.netgull.com/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz
tar -zxf gcc-3.4.6.tar.gz
cd gcc-3.4.6
wget http://www.trevorpounds.com/blog/wp-content/uploads/2010/01/gcc-multilib-fix-v3.3.x-to-v4.2.3.debian.x86_64.diff
patch -p0 < gcc-multilib-fix-v3.3.x-to-v4.2.3.debian.x86_64.diff
mkdir ../gcc-3.4.6-objdir
cd ../gcc-3.4.6-objdir
export PATH=/opt/x86_64/gcc/gcc-4.4.2/bin:${PATH}
CFLAGS=-D_FORTIFY_SOURCE=0 ../gcc-3.4.6/configure --prefix=/opt/x86_64/gcc/gcc-3.4.6 --enable-languages=c,c++
make >& make.out
make install >& install.out

For info about CFLAGS=-D_FORTIFY_SOURCE=0, see Ubuntu: gcc-3.4.6: __open_missing_mode ();

gcc-3.2.3

cd ../..
mkdir gcc-3.2.3
wget http://www.netgull.com/gcc/releases/gcc-3.2.3/gcc-3.2.3.tar.gz
tar -zxf gcc-3.2.3.tar.gz
cd gcc-3.2.3
wget http://www.trevorpounds.com/blog/wp-content/uploads/2010/01/gcc-multilib-fix-v3.2.x.debian.x86_64.diff
patch -p0 < gcc-multilib-fix-v3.2.x.debian.x86_64.diff
mkdir ../gcc-3.2.3-objdir
cd ../gcc-3.2.3-objdir
export PATH=/opt/x86_64/gcc/gcc-3.4.6/bin:${PATH}
../gcc-3.2.3/configure --prefix=/opt/x86_64/gcc/gcc-3.2.3 --enable-languages=c,c++
make >& make.out
make install >& install.out

gcc-3.2.1

cd ../..
mkdir gcc-3.2.1
wget http://www.netgull.com/gcc/releases/gcc-3.2.1/gcc-3.2.1.tar.gz
tar -zxf gcc-3.2.1.tar.gz
cd gcc-3.2.1
wget https://chess.eecs.berkeley.edu/ptexternal/wiki/uploads/Main/gcc-multilib-fix-v3.1.x.debian.x86_64.diff.txt
patch -p0 < gcc-multilib-fix-v3.2.x.debian.x86_64.diff.txt
mkdir ../gcc-3.2.1-objdir
cd ../gcc-3.2.3-objdir
export PATH=/opt/x86_64/gcc/gcc-3.2.3/bin:${PATH}
../gcc-3.1.1/configure --prefix=/opt/x86_64/gcc/gcc-3.1.1 --enable-languages=c,c++ --enable-threads=posix
make >& make.out
make install >& install.out

gcc-3.0.4

cd ../..
mkdir gcc-3.0.4
wget http://www.netgull.com/gcc/releases/gcc-3.0.4/gcc-3.0.4.tar.gz
tar -zxf gcc-3.0.4.tar.gz
cd gcc-3.0.4
wget https://chess.eecs.berkeley.edu/ptexternal/wiki/uploads/Main/gcc-v3.0.x.debian.x86_64.diff.txt
patch -p0 < gcc-v3.0.x.debian.x86_64.diff.txt
mkdir ../gcc-3.0.4-objdir
cd ../gcc-3.0.4-objdir
export PATH=/opt/x86_64/gcc/gcc-3.2.1/bin:${PATH}
../gcc-3.0.4/configure --prefix=/opt/i386/gcc/gcc-3.0.4 --enable-languages=c,c++ --enable-threads=posix --host i386-pc-linux-gnu
make >& make.out
make install >& install.out

Problems

RHEL 3.1.1: __strtol_l' undeclared (first use this function)

/bin/sh ../libtool --tag CXX --mode=compile /home/cxh/src/gcc-3.1.1/gcc-3.1.1-o\
bjdir/gcc/xgcc -shared-libgcc -B/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/gcc/ -\
nostdinc++  -L/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/x86_64-unknown-linux-gnu\
/libstdc++-v3/src -L/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/x86_64-unknown-lin\
ux-gnu/libstdc++-v3/src/.libs -B/opt/x86_64/gcc/gcc-3.1.1/x86_64-unknown-linux-\
gnu/bin/ -B/opt/x86_64/gcc/gcc-3.1.1/x86_64-unknown-linux-gnu/lib/ -isystem /op\
t/x86_64/gcc/gcc-3.1.1/x86_64-unknown-linux-gnu/include -nostdinc++ -I/home/cxh\
/src/gcc-3.1.1/gcc-3.1.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/include/x\
86_64-unknown-linux-gnu -I/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/x86_64-unkno\
wn-linux-gnu/libstdc++-v3/include -I../../../../gcc-3.1.1/libstdc++-v3/libsupc+\
+  -I../../../../gcc-3.1.1/libstdc++-v3/libmath    -g -O2 -D_GNU_SOURCE -fno-im\
plicit-templates  -Wall -Wno-format -W -Wwrite-strings -Winline  -fdiagnostics-\
show-location=once  -ffunction-sections -fdata-sections -g    -c c++locale.cc
/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/gcc/xgcc -shared-libgcc -B/home/cxh/sr\
c/gcc-3.1.1/gcc-3.1.1-objdir/gcc/ -nostdinc++ -L/home/cxh/src/gcc-3.1.1/gcc-3.1\
.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/home/cxh/src/gcc-3.1.1/g\
cc-3.1.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/opt/x86_64/g\
cc/gcc-3.1.1/x86_64-unknown-linux-gnu/bin/ -B/opt/x86_64/gcc/gcc-3.1.1/x86_64-u\
nknown-linux-gnu/lib/ -isystem /opt/x86_64/gcc/gcc-3.1.1/x86_64-unknown-linux-g\
nu/include -nostdinc++ -I/home/cxh/src/gcc-3.1.1/gcc-3.1.1-objdir/x86_64-unknow\
n-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/home/cxh/src/gcc-3\
.1.1/gcc-3.1.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/include -I../../../\
../gcc-3.1.1/libstdc++-v3/libsupc++ -I../../../../gcc-3.1.1/libstdc++-v3/libmat\
h -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-str\
ings -Winline -fdiagnostics-show-location=once -ffunction-sections -fdata-secti\
ons -g -c c++locale.cc  -fPIC -DPIC -o .libs/c++locale.o
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long int]':
c++locale.cc:51: `__strtol_l'
undeclared (first use this function)
c++locale.cc:51: (Each undeclared identifier is reported only once for each
   function it appears in.)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long unsigned
   int]':
c++locale.cc:69: `__strtoul_l'
undeclared (first use this function)

This matches one of the posts in http://www.trevorpounds.com/blog/?p=111, but there was no solution.

As a workaround, I decided to try Ubuntu.

Ubuntu: gcc-3.4.6: __open_missing_mode ();

gcc   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-\
prototypes -pedantic -Wno-long-long    -DHAVE_CONFIG_H    -I. -I. -I../../gcc-3\
.4.6/gcc -I../../gcc-3.4.6/gcc/. -I../../gcc-3.4.6/gcc/../include   \
        -DTARGET_MACHINE=\"x86_64-unknown-linux-gnu\" \
        -c ../../gcc-3.4.6/gcc/collect2.c -o collect2.o
In file included from /usr/include/fcntl.h:279:0,
                 from ../../gcc-3.4.6/gcc/system.h:214,
                 from ../../gcc-3.4.6/gcc/collect2.c:30:
In function ‘open’,
    inlined from ‘collect_execute’ at ../../gcc-3.4.6/gcc/collect2.c:1537:20:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to ‘__open_missi\
ng_mode’ declared with attribute error: open with O_CREAT in second argument ne\
eds 3 arguments
    __open_missing_mode ();
                        ^

Solution: Install gcc-4.4.2 first?

Solution: From http://www.trevorpounds.com/blog/?p=111&cpage=1#comment-16

"@sonal: It looks like this is an issue related to the the compilation flag -D_FORTIFY_SOURCE=2 added starting with Ubuntu 8.10. You can read more about it on the Ubuntu wiki @ http://wiki.ubuntu.com/CompilerFlags#-D_FORTIFY_SOURCE=2."
However, the easiest way to work around the issue is to override the implicit compiler flag as part of the configure command as follows:"
"CFLAGS=-D_FORTIFY_SOURCE=0 ../gcc-3.4.6/configure --prefix=/opt/x86_64/gcc/gcc-3.4.6 --enable-languages=c,c++"

Ubuntu: gcc-3.4.6 fails with /usr/include/features.h:374:25: sys/cdefs.h: No such file or directory

home/cxh/src/gcc-3.4.6/gcc-3.4.6-objdir/gcc/xgcc -B/home/cxh/src/gcc-3.4.6/gcc\
-3.4.6-objdir/gcc/ -B/opt/x86_64/gcc/gcc-3.4.6/x86_64-unknown-linux-gnu/bin/ -B\
/opt/x86_64/gcc/gcc-3.4.6/x86_64-unknown-linux-gnu/lib/ -isystem /opt/x86_64/gc\
c/gcc-3.4.6/x86_64-unknown-linux-gnu/include -isystem /opt/x86_64/gcc/gcc-3.4.6\
/x86_64-unknown-linux-gnu/sys-include -O2 -DIN_GCC    -W -Wall -Wwrite-strings \
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./inc\
lude  -I. -I. -I../../gcc-3.4.6/gcc -I../../gcc-3.4.6/gcc/. -I../../gcc-3.4.6/g\
cc/../include   -g0 -finhibit-size-directive -fno-inline-functions -fno-excepti\
ons -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer -f\
no-asynchronous-unwind-tables \
           -c ../../gcc-3.4.6/gcc/crtstuff.c -DCRT_BEGIN \
          -o crtbegin.o
In file included from /usr/include/stdio.h:27,
                 from ../../gcc-3.4.6/gcc/tsystem.h:79,
                 from ../../gcc-3.4.6/gcc/crtstuff.c:62:
/usr/include/features.h:374:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:398:23: gnu/stubs.h: No such file or directory
In file included from ../../gcc-3.4.6/gcc/tsystem.h:79,
                 from ../../gcc-3.4.6/gcc/crtstuff.c:62:
/usr/include/stdio.h:35:25: bits/types.h: No such file or directory
In file included from ../../gcc-3.4.6/gcc/tsystem.h:79,
                 from ../../gcc-3.4.6/gcc/crtstuff.c:62:
/usr/include/stdio.h:44: error: syntax error before "struct"
/usr/include/stdio.h:48: error: syntax error before "typedef"

Solution? Install gcc-4.8.2 first? 4.8.2 had a similar problem.

http://eli.thegreenplace.net/2014/01/16/building-gcc-4-8-from-source-on-ubunu-12-04 has instructions.

Solution? apt install gcc-multilib

Edit - History - Print - Recent Changes - Search
Page last modified on September 27, 2015, at 12:18 PM