Skip to content

Commit

Permalink
update build scripts from ubuntu 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Apr 19, 2016
1 parent 696eead commit adcd562
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 58 deletions.
193 changes: 151 additions & 42 deletions BuildTools/ubuntu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ fi

read -p "Do you want to install pre-requisites (e.g. libreadline, zlib, libexpat, libcurl ...)?[y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy] ]]; then
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install libssl-dev libreadline6-dev zlib1g-dev libexpat1-dev dh-autoreconf libcurl4-gnutls-dev libgtk-3-dev libwebkit-dev mesa-common-dev freeglut3-dev libglu1-mesa-dev libgl1-mesa-dev libgtk2.0-dev
sudo apt-get install g++ libssl-dev libreadline6-dev zlib1g-dev libexpat1-dev dh-autoreconf libcurl4-gnutls-dev libgtk-3-dev libwebkit-dev mesa-common-dev freeglut3-dev libglu1-mesa-dev libgl1-mesa-dev libgtk2.0-dev
fi

unset ORACLE_HOME
Expand Down Expand Up @@ -63,17 +63,27 @@ install_library()
LIB_NAME=$1
LIB_URL=$2
LIB_CHECKER=$3
LIB_FILENAME=$(basename "$LIB_URL" ".tar")
echo $LIB_FILENAME
LIB_FILENAME=$(basename "$LIB_URL")
CONFIGURE_FLAGS=$4
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: $LIB_FILENAME"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"

cd $DOWNLOAD_HOME

if ! [ -f "$LIB_FILENAME" ] ; then
echo "$LIB_FILENAME not found. Downloading..."
curl -O $LIB_URL
else
echo "$LIB_FILENAME found. Download skipped."
fi

if ! [ -d "$LIB_NAME" ] ; then
echo "Directory $LIB_NAME not found. Expanding..."
tar -xf $LIB_FILENAME
else
echo "Directory $LIB_NAME found. File expansion skipped."
fi

if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
Expand All @@ -91,6 +101,10 @@ install_library()
#########################################################################
# install libiConv
#########################################################################
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: libiConv %"
echo "%%%%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME="libiconv-1.14"
LIB_URL="https://dl.dropboxusercontent.com/u/145979/geoda_libraries/libiconv-1.14.tar.gz"
Expand Down Expand Up @@ -120,10 +134,43 @@ install_library()
#########################################################################
# install cURL
#########################################################################
install_library curl-7.30.0 https://dl.dropboxusercontent.com/u/145979/geoda_libraries/curl-7.30.0.tar.gz libcurl.a

LIB_NAME=curl-7.46.0
LIB_CHECKER=libcurl.a
LIB_URL=https://dl.dropboxusercontent.com/u/145979/geoda_libraries/curl-7.46.0.zip
LIB_FILENAME=curl-7.46.0.zip
echo $LIB_NAME

cd $DOWNLOAD_HOME

if ! [ -d "$LIB_NAME" ] ; then
curl -O $LIB_URL
unzip $LIB_FILENAME
fi

if ! [ -d "$LIB_NAME" ]; then
tar -xf $LIB_FILENAME
fi

if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
cd $LIB_NAME
./configure --enable-ares=$PREFIX CC="$GDA_CC" CFLAGS="$GDA_CFLAGS" CXX="$GDA_CXX" CXXFLAGS="$GDA_CXXFLAGS" LDFLAGS="$GDA_LDFLAGS" --prefix=$PREFIX --without-librtmp
$MAKER
make install
fi

if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
echo "Error! Exit"
exit
fi

#########################################################################
# install Xerces
#########################################################################
echo ""
echo "%%%%%%%%%%%%%%%%%%%%"
echo "% Building: Xerces %"
echo "%%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME="xerces-c-3.1.1"
LIB_URL="https://dl.dropboxusercontent.com/u/145979/geoda_libraries/xerces-c-3.1.1.tar.gz"
Expand Down Expand Up @@ -186,22 +233,30 @@ install_library jpeg-8 https://dl.dropboxusercontent.com/u/145979/geoda_librarie
#########################################################################
# install libkml requires 1.3
#########################################################################
echo ""
echo "%%%%%%%%%%%%%%%%%%%%"
echo "% Building: libkml %"
echo "%%%%%%%%%%%%%%%%%%%%"
# libexpat,libcurl4-gnutls-dev
#install_library libkml-1.2.0 https://libkml.googlecode.com/files/libkml-1.2.0.tar.gz libkmlbase.a
{
LIB_NAME="libkml"
LIB_CHECKER="libkmlbase.a"
LIB_URL="https://dl.dropboxusercontent.com/u/145979/geoda_libraries/libkml-r680.tar.gz"
LIB_FILENAME="libkml-r680.tar.gz"
LIB_URL=https://dl.dropboxusercontent.com/u/145979/geoda_libraries/libkml-r680.tar.gz
LIB_FILENAME=libkml-r680.tar.gz
echo $LIB_NAME

cd $DOWNLOAD_HOME
if ! [ -d "$LIB_NAME" ] ; then
curl -O LIB_URL
curl -O $LIB_URL
fi

if ! [ -d "$LIB_NAME" ]; then
tar -xf $LIB_FILENAME
fi

if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
sudo apt-get install libexpat1-dev
cp -rf ../dep/"$LIB_NAME" .
cd $LIB_NAME
./autogen.sh
Expand Down Expand Up @@ -249,6 +304,10 @@ install_library jpeg-8 https://dl.dropboxusercontent.com/u/145979/geoda_librarie
#########################################################################
# install SpatiaLite
#########################################################################
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: Spatialite %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME=libspatialite-4.0.0
LIB_URL=https://dl.dropboxusercontent.com/u/145979/geoda_libraries/libspatialite-4.0.0.tar.gz
Expand Down Expand Up @@ -279,6 +338,10 @@ install_library jpeg-8 https://dl.dropboxusercontent.com/u/145979/geoda_librarie
# MySQL
#########################################################################
#cmake, curse
echo ""
echo "%%%%%%%%%%%%%%%%%%%"
echo "% Building: MySQL %"
echo "%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME=mysql-5.6.14
LIB_URL=https://dl.dropboxusercontent.com/u/145979/geoda_libraries/mysql-5.6.14.tar.gz
Expand Down Expand Up @@ -313,29 +376,38 @@ install_library jpeg-8 https://dl.dropboxusercontent.com/u/145979/geoda_librarie
#########################################################################
# install boost library
#########################################################################
echo "%%%%%%%%%%%%%%%%%%%%%%"
echo "% install Boost 1.57 %"
echo "%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: Boost 1.57 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME=boost_1_54_0
LIB_NAME=boost_1_57_0
LIB_URL=https://dl.dropboxusercontent.com/u/145979/geoda_libraries/boost_1_57_0.tar.gz
LIB_FILENAME=$(basename "$LIB_URL" ".tar")
LIB_FILENAME=boost_1_57_0.tar.gz
LIB_CHECKER=libboost_thread.a
echo $LIB_FILENAME

cd $DOWNLOAD_HOME
if ! [ -f "$LIB_FILENAME" ]; then
echo "$LIB_FILENAME not found. Downloading..."
curl -O $LIB_URL
else
echo "$LIB_FILENAME found. Skipping download."
fi

if ! [ -d "$LIB_NAME" ]; then
echo "Directory $LIB_NAME not found. Expanding archive."
tar -xf $LIB_FILENAME
else
echo "Directory $LIB_NAME found. Skipping expansion."
fi

if ! [ -f "$GEODA_HOME/temp/$LIB_NAME/stage/lib/$LIB_CHECKER" ] ; then
echo "$LIB_CHECKER not found. Building Boost..."
cd $PREFIX/include
rm boost
ln -s $DOWNLOAD_HOME/boost_1_54_0 boost
cd $DOWNLOAD_HOME/boost_1_54_0
ln -s $DOWNLOAD_HOME/boost_1_57_0 boost
cd $DOWNLOAD_HOME/boost_1_57_0
chmod +x bootstrap.sh
chmod +x tools/build/v2/engine/build.sh
./bootstrap.sh
Expand All @@ -344,17 +416,18 @@ echo "%%%%%%%%%%%%%%%%%%%%%%"
fi

if ! [ -f "$GEODA_HOME/temp/$LIB_NAME/stage/lib/$LIB_CHECKER" ] ; then
echo "Error! Exit"
echo "Error: Target library $LIB_CHECKER not found. Exiting build."
exit
fi
}

#########################################################################
# install JSON Spirit
#########################################################################
echo "%%%%%%%%%%%%%%%%%%%%%%%"
echo "% install JSON Spirit %"
echo "%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: JSON Spirit %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%"
LIB_NAME="json_spirit_v4.08"
LIB_URL="https://dl.dropboxusercontent.com/u/145979/geoda_libraries/json_spirit_v4.08.zip"
LIB_CHECKER="libjson_spirit.a"
Expand All @@ -364,6 +437,7 @@ echo $LIB_FILENAME
cd $DOWNLOAD_HOME

if ! [ -d "$LIB_NAME" ]; then
curl -o https://dl.dropboxusercontent.com/u/145979/geoda_libraries/json_spirit_v4.08.zip
unzip $LIB_FILENAME
fi

Expand Down Expand Up @@ -393,17 +467,18 @@ fi
#########################################################################
# install CLAPACK
#########################################################################
echo "%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% install CLAPACK 3.2.1 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: CLAPACK 3.2.1 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%"
{
CLAPACK_NAME="CLAPACK-3.2.1"
LIB_CHECKER="libf2c.a"
echo $CLAPACK_NAME

cd $DOWNLOAD_HOME
if ! [ -d "$CLAPACK_NAME" ]; then
curl -O http://www.netlib.org/clapack/clapack.tgz
curl -O https://dl.dropboxusercontent.com/u/145979/geoda_libraries/clapack.tgz
tar -xvf clapack.tgz
fi

Expand Down Expand Up @@ -433,16 +508,48 @@ echo "%%%%%%%%%%%%%%%%%%%%%%%%%"
fi
}

#########################################################################
# install json-c
#########################################################################
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: json-c "
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
{

LIB_NAME=json-c
LIB_CHECKER=libjson-c.a

if ! [ -d "$LIB_NAME" ] ; then
git clone https://github.com/json-c/json-c.git
fi


if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
cd $LIB_NAME
sh autogen.sh
./configure --prefix=$PREFIX
make
make install
fi

if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
echo "Error! Exit"
exit
fi
}

#########################################################################
# install GDAL/OGR
#########################################################################
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% install Custom GDAL/OGR 1.9.2 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building: Custom GDAL/OGR 1.9.2 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
{
LIB_NAME=gdal-1.9.2
LIB_URL=https://codeload.github.com/lixun910/gdal-1.9.2-work/zip/master
LIB_FILENAME=master
LIB_NAME=gdal
LIB_URL=https://codeload.github.com/lixun910/gdal/zip/GeoDa17Merge
LIB_FILENAME=GeoDa17Merge
LIB_CHECKER=libgdal.a
echo $LIB_FILENAME

Expand All @@ -451,19 +558,17 @@ echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
#svn co https://github.com/lixun910/gdal-1.9.2-work/trunk gdal-1.9.2
curl -k -O $LIB_URL
unzip $LIB_FILENAME
mv gdal-1.9.2-work-master gdal-1.9.2
mv gdal-GeoDa17Merge/gdal gdal
fi

cp -rf $GEODA_HOME/dep/$LIB_NAME .
if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
cd $LIB_NAME
chmod +x configure
chmod +x install-sh
./configure
#./configure --with-jpeg=internal --prefix=$PREFIX --with-freexl=$PREFIX --with-spatialite=$PREFIX --with-libiconv-prefix="-L/usr/lib" --with-sqlite3=$PREFIX --with-spatialite=$PREFIX/include --with-static-proj4=$PREFIX --with-curl=$PREFIX/bin/curl-config --with-geos=$PREFIX/bin/geos-config --with-libkml=$PREFIX --with-libkml-inc=$PREFIX/include --with-libkml-lib=$PREFIX/lib --with-xerces=$PREFIX --with-xerces-inc="$PREFIX/include" --with-xerces-lib="-L$PREFIX/lib -lxerces-c" --with-pg=$PREFIX/bin/pg_config --enable-debug --host=amd64-linux-gnu
#--with-mysql="$DOWNLOAD_HOME/mysql-5.6.13-osx10.6-x86/bin/mysql_config"
./configure
cp -rf $GEODA_HOME/dep/gdal-1.9.2/* .
cp $GEODA_HOME/dep/gdal-1.9.2/GDALmake.opt GDALmake.opt
cp GDALmake.opt GDALmake.opt
#make clean
$MAKER
make install
Expand All @@ -481,28 +586,31 @@ echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
#########################################################################
# install wxWidgets library
#########################################################################
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% install wxWidgets 3.0.2 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% Building wxWidgets 3.0.2 %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
#sudo apt-get install libgtk2.0-dev libglu1-mesa-dev libgl1-mesa-dev
{
LIB_NAME=wxWidgets-3.0.2
LIB_URL="https://dl.dropboxusercontent.com/u/145979/geoda_libraries/wxWidgets-3.0.2.tar.bz2"

LIB_FILENAME=$(basename "$LIB_URL" ".tar")
LIB_CHECKER=wx-config
echo $LIB_FILENAME

cd $DOWNLOAD_HOME
if ! [ -f "$LIB_FILENAME" ] ; then
curl -O $LIB_URL
curl -k -o $LIB_FILENAME $LIB_URL
fi

if ! [ -d "$LIB_NAME" ]; then
tar -xf $LIB_FILENAME
tar -xf $LIB_FILENAME
fi

if ! [ -f "$PREFIX/bin/$LIB_CHECKER" ] ; then
cd $LIB_NAME
cp -rf $GEODA_HOME/dep/$LIB_NAME/* .
chmod +x configure
chmod +x src/stc/gen_iface.py
./configure --with-gtk=2 --enable-ascii --disable-shared --disable-monolithic --with-opengl --enable-postscript --without-libtiff --disable-debug --enable-webview --prefix=$PREFIX
Expand All @@ -520,9 +628,10 @@ echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%"
#########################################################################
# build GeoDa
#########################################################################
echo "%%%%%%%%%%%%%%%"
echo "% build GeoDa %"
echo "%%%%%%%%%%%%%%%"
echo ""
echo "%%%%%%%%%%%%%%%%%%%"
echo "% Building: GeoDa %"
echo "%%%%%%%%%%%%%%%%%%%"
{
cd $GEODA_HOME
cp ../../GeoDamake.ubuntu32.opt ../../GeoDamake.opt
Expand Down
2 changes: 1 addition & 1 deletion BuildTools/ubuntu/build64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ./build.sh 8 1 (no debug)
#############################################################################
CPUS=2
NODEBUG=0
NODEBUG=1

if ! type "cmake" > /dev/null; then
echo "You need to install cmake to run this script."
Expand Down
Loading

0 comments on commit adcd562

Please sign in to comment.