BAPS Linux Setup STEPS - Overview

advertisement
BAPS Linux Setup
STEPS - Overview
1. Download BAPS framework
2. Down LEDA Free version from from http://www.algorithmic-solutions.info/free/d5.php
 This is a precompiled library compiled with gcc 4.1.2, on fedora 8.
3. Modify makefiles
4. If BAPS is not runnable, install gcc 4.1.2 and recompile
 There is a slim possibility that leda pre-compiled library doesn’t work with all libstdc++
versions. With gcc 4.7.2 it didn’t. (Not very sure if it was due to some other reason)
 gcc 4.1.2 on Fedora worked
 gcc 4.6.3 on Ubuntu worked
STEPS in Detail
Executing below commands in blue in sequence.
This assumes your gcc by default compiles in 32 bit. (If not, you may need to add -m32 to CCFLAGS
in makefiles)
STEP 1: Download BAPS
wget http://www.comp.nus.edu.sg/~cs5234/2013/project/bap-framework.zip
unzip bap-framework.zip
STEP 2: Download LEDA free version
cd BAPS/
#This is 32 bit version. You may need to download other versions if you compile in 64 bit or need
multithreading.
wget http://www.algorithmic-solutions.info/free/Packages/LEDA-6.3-free-fedora-core-8-g++4.1.2.tar.gz
tar xvzf LEDA-6.3-free-fedora-core-8-g++-4.1.2.tar.gz
# Remove shared lib, so we always link to static lib
rm LEDA-6.3-free-fedora-core-8-g++-4.1.2/libleda.so
STEP 3: Modify make files

Do following in all above makefiles
Makefile
src/makefile
packing/BP/makefile
partitioning/TV/makefile

Replace variables in all above makefiles (if present)
Current:
CC = /usr/sfw/bin/g++
CCFLAGS = -O2
LFLAGS = /home/rsch/leda6/6.0
LROOT=/home/rsch/leda6/6.0
AR = ar rvs
New
CC = g++
CCFLAGS = -ggdb
(and -m32 if default compilation is 64 bit)
LFLAGS = $(BAPHOME)/LEDA-6.3-free-fedora-core-8-g++-4.1.2
LROOT = $(BAPHOME)/LEDA-6.3-free-fedora-core-8-g++-4.1.2
AR = ar cr

Only in “Makefile”
 Replace “dmake” with “make”
 Add following two libs in green. (If linker can’t find then add “/usr/lib” to LFLAGS)
LIBS = -lSolver -lBP -lTV -lBAPS -lleda -lX11 –lm

Add following line in green to the file “BAPS/include/def.h”, (this #def conflicts with a linux
native #def)
// Infinity Value
#undef INFINITY
const int INFINITY = 1000000;

Then compile and run
exec bash
export BAPHOME=`pwd`
export BAPTMP=$BAPHOME/tmp
make
bin/BAPS proj-d001-01.prj
STEP 4:
This may not be essential, but just for information these are the steps to install gcc 4.1.2 on Fedora.
Other linux platforms would require very similar steps. (e.g. on Ubuntu replace yum with apt-get).
Execute following as root.
yum remove g++
yum remove gcc
yum remove libgomp
yum remove cpp
wget http://www.algorithmic-solutions.info/free/Packages/LEDA-6.3-free-fedora-core-8-g++-4.1.2mt.tar.gz
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/P
ackages/gcc-4.1.2-33.i386.rpm
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Fedora/i386/os/Packa
ges/gcc-c++-4.1.2-33.i386.rpm
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/P
ackages/libgomp-4.1.2-33.i386.rpm
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/P
ackages/cpp-4.1.2-33.i386.rpm
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/P
ackages/libstdc++-devel-4.1.2-33.i386.rpm
wget
ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/P
ackages/libstdc++-4.1.2-33.i386.rpm
yum localinstall ./cpp-4.1.2-33.i386.rpm
yum localinstall ./libgomp-4.1.2-33.i386.rpm
yum localinstall ./gcc-4.1.2-33.i386.rpm
rpm -ivh --force ./libstdc++-4.1.2-33.i386.rpm
rpm -ivh --force ./libstdc++-devel-4.1.2-33.i386.rpm
yum localinstall ./gcc-c++-4.1.2-33.i386.rpm
Related documents
Download