Difference between revisions of "Building MapGuide on Ubuntu 8.10"

From OSGeo
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==NOTES==
 
==NOTES==
  
Those guidelines must be considered as "EXPERIMENTAL" or "it finally work" or "it was God will" work.
+
Those guidelines must be considered as "EXPERIMENTAL".
Most of it have been extracted from "Building MapGuide on Ubuntu 8.0.4" but some parts remains very special
+
Most of it have been extracted from "Building MapGuide on Ubuntu 8.0.4" but some parts are extremely special.
  
 +
For the moment, I'm stucked in the compiling Oem step.
  
The default directory used in these instructions is called /home/''administrator''.  This assumes that you create your primary user account with the name "''administrator''".  If you do not, mentally adjust where necessary.
+
Nevertheless I have three main advices to give :
Compiled successfully on 32 bit machine.
+
 
 +
1) Stay close to the svn version of the libraries
 +
 
 +
2) Prefer official releases to experimental
 +
 
 +
3) Install most of main libraries from official repositories (using aptitude)
  
 
==BASIC SETUP==
 
==BASIC SETUP==
  
Install a basic Ubuntu 8.10 (Intrepid Ibex).   
+
1) Install a basic Ubuntu 8.10 (Intrepid Ibex).   
  
I added the following lines to my /etc/apt/sources.list
+
2) I added the following lines to my /etc/apt/sources.list
  
deb http://les-ejk.cz/ubuntu intrepid multiverse  
+
deb http://les-ejk.cz/ubuntu intrepid multiverse  
deb-src http://les-ejk.cz/ubuntu intrepid multiverse  
+
deb-src http://les-ejk.cz/ubuntu intrepid multiverse  
  
 
...may help.
 
...may help.
Line 21: Line 27:
 
then  
 
then  
  
sudo apt-get update
+
sudo apt-get update
sudo apt-get upgrade
+
sudo apt-get upgrade
  
Once this is complete, you will have to add some extra packages to compile MapGuide.  Make sure that you get all of these packages; the line is really long:
+
3) Once this is complete, you will have to add some extra packages to compile MapGuide.  Make sure that you get all of these packages; the line is really long:
  
 
  sudo apt-get install build-essential bison flex automake1.7 automake1.9 libtool doxygen subversion libjpeg62-dev libpng12-dev libfreetype6-dev libexpat1-dev libxalan110-dev libxslt1-dev expat libcurl4-openssl-dev libasound2-Dev python2.5-dev sun-java6-jdk gcc-4.1 g++-4.1
 
  sudo apt-get install build-essential bison flex automake1.7 automake1.9 libtool doxygen subversion libjpeg62-dev libpng12-dev libfreetype6-dev libexpat1-dev libxalan110-dev libxslt1-dev expat libcurl4-openssl-dev libasound2-Dev python2.5-dev sun-java6-jdk gcc-4.1 g++-4.1
  
To avoid "bad fd number" errors, type the following in the terminal:
+
4) To avoid "bad fd number" errors, type the following in the terminal:
  
 
  sudo dpkg-reconfigure dash
 
  sudo dpkg-reconfigure dash
Line 34: Line 40:
 
and choose No at the prompt.  Be aware that this changes your default /bin/sh from dash back to bash.
 
and choose No at the prompt.  Be aware that this changes your default /bin/sh from dash back to bash.
  
Set the SUN Java to be the default Java installation:
+
5) Set the SUN Java to be the default Java installation: edit  /etc/environment file 
 +
 
 +
sudo emacs /etc/environment
 +
 +
(Add the following line)
 +
JAVA_HOME="/usr/lib/jvm/java-6-sun"
 +
 
 +
Ok, lets install FDO
 +
 
 +
==FDO INSTALL==
 +
 
 +
1) Download the FDO release 3.4.0 from svn inside of your current working directory
 +
 
 +
svn checkout http://svn.osgeo.org/fdo/tags/3.4.0  OpenSource_FDO
 +
 
 +
2) Enter inside of this directory and look for OpenSourceBuild_README.txt
  
Edit /etc/environment file  
+
  cd OpenSource_FDO
 +
  less OpenSourceBuild_README.txt
  
sudo emacs /etc/environment
+
3) Follow the instructions
(Add the following line)
 
JAVA_HOME="/usr/lib/jvm/java-6-sun"
 
  
 +
-----------------------------
 +
Linux Instructions
 +
-----------------------------
 +
 +
I. Build Instructions
  
==FDO INSTALL==
+
  1. cd [FDO OpenSource]
 +
 
 +
  2. Open and modify setenvironment.sh to specify the locations of the
 +
    Thirdparty SDK components and build tools. (Refer to the Build Notes
 +
    below)
  
In terminal type the following:
+
  3.  Source the setenvironment.sh script (bash or bourne compatible shells)
  
''(be prepared to wait a long time for this command to complete, the test data takes a while to download)
+
    ./setenvironment.sh
svn checkout http://svn.osgeo.org/fdo/tags/3.3.1/ fdo-3.3.1
 
  
''(type in your password after the following command if prompted. Note that this fdo-3.3.0, not fdo-3.3.1)''
+
  Note : I prefered to use my version of GDAL so I modified the file
sudo mkdir /usr/local/fdo-3.3.0
+
  export FDOGDAL=/usr/lib
  
''(if you are not logged in as ''administrator'', you change the userid below!)''
+
  4. ./build_thirdparty.sh
sudo chown ''administrator'' /usr/local/fdo-3.3.0
 
  
''(when compile, I got error "occi.h: No such file or directory". This is for provider KingOracle. Since I don't need it anyway, I just remove folder /home/''administrator''/fdo-3.3.1/Providers/KingOracle)
+
Note : seems to have some trouble here with gdal
  
cd fdo-3.3.1
+
  5. sudo ./build_linux.sh
  
source ./setenvironment.sh
 
  
In terminal, type the following to run the builds. Note, there will be no output from either command until completion as it is all being spooled to nohup.out. You can log into another terminal session and tail this file if you start getting antsy :-)
+
5) Once you have installed FDO, check the execute permissions on the shared libraries in
 +
/usr/local/fdo-3.4.0/lib.  
  
nohup ./build_thirdparty.sh 2>&1 | tee build_thirdparty.log
+
Some may have been installed without execute permission. To correct the permissions, run
  
  nohup ./build_linux.sh 2>&1 | tee build_linux.log
+
  chmod a+x *.so*
  
 
==APACHE / PHP INSTALL==
 
==APACHE / PHP INSTALL==
  
In Terminal type the following:
+
1) Extract the following tarball inside of your working directory
  
  cd ~
+
  => http://download.osgeo.org/mapguide/releases/2.0.2/mapguideaptinstaller-2.0.0.2.tar.gz
 +
=> Creates a directory named LinuxApt
  
''(you should now be in /home/''administrator'', or whatever your $HOME is)''
+
2) Enter the directory then launch: 
  
  svn checkout http://svn.osgeo.org/mapguide/tags/MAPGUIDE2.0.1/ mapguide-2.0.1
+
  sudo ./build_apt.sh
 +
<!> default options install Apache and Php in /usr/local/mapguideopensource/
  
  sudo mkdir /usr/local/mapguideopensource
+
  => Also cleans previous versions :)
  
''(replace ''administrator'' with your userid if necessary)''
+
3) In a Web browser go to http://127.0.0.1:8008/
  
sudo chown ''administrator'' /usr/local/mapguideopensource
+
=>Ok, It Works !
  
cd mapguide-2.0.1/Oem/LinuxApt
+
==BUILD OEM==
  
''(careful when copying and pasting this line, the - got changed into . for me)''
+
1) Download the last working version from svn (may take hours, more or less 120Mo)
  
  find . -name "*.gz" -exec tar xzf {} \;
+
  svn checkout http://svn.osgeo.org/mapguide/branches/2.0.x/MgDev/ mapguide-2.0.2
  
nohup ./build_apt.sh 2>&1 | tee ../../build_apt.log
+
2) Build OEM
  
==BUILD OEM==
+
First correct some mistakes to avoid compilation errors
 +
 
 +
cd mapguide-2.0.2/
 +
cd Oem
 +
 
 +
2.1) Update DWFTK7.1 using windows version of svn (prevents cpp errors in DWFTKT7.1)
 +
 
 +
rm -rf DWFTK7.1
 +
svn checkout http://svn.osgeo.org/mapguide/trunk/MgDev/Oem/DWFTK7.1 DWFTK7.1
 +
 
 +
 
 +
2.2) Edit build_setup file(prevents : "DWFCORE 1.0: Error build failed")
 +
 +
~/mapguide-2.0.2/Oem/DWFTK7.1/develop/global/build/gnu/dwfcore/build_setup
 +
 
 +
and remove option --force on the autoreconf line.
 +
do the same for dwftoolkit and dwfemap
 +
 
 +
2.3) Edit Makefile in SWIGEx tool (prevents : "SWIGEx 1.0: Error build failed" due to atomics.h:51)
 +
 
 +
~/mapguide-2.0.2/Oem/SWIGEx/Makefile
 +
 
 +
and remove flags and associated values -march et -mcpu on C and C++ compiler lines
 +
 
 +
2.4) Edit C++ following source files (prevents "BDBXML 2.3.10 Error build failed")
 +
 
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/include/dbxml/DbXml.hpp
  
Perform the following:
+
~/mapguide-2.0.2/Oem/dbxml-2.3.10/xqilla/include/xqilla/framework/StringPool.hpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/Buffer.cpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/IndexEntry.hpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/nodeStore/NsTypes.hpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml_dump/dbxml_dump.cpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml_load/dbxml_load.cpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/utils/load_container/LoadContainer.hpp
 +
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/build_unix/src/utils/shell/Environment.hpp
  
cd ~/mapguide-2.0.1/
 
  
nohup ./build_oem.sh 2>&1 | tee build_oem.log
+
and in the include section, add those two libraries
  
==BUILD MAPGUIDE==
+
#include <cstdlib>
 +
#include <cstring>
  
Go for the Heron:
+
2.5) Finally, go for the "big stuff". When inside of your chosen working directory, type
  
  aclocal
+
  cd mapguide-2.0.2
libtoolize --force
+
  ./build_oem.sh
automake --add-missing --copy
 
  autoconf
 
  
  ./configure --enable-optimized
+
  TypeInfoHelper.cpp: In static member function 'static std::string CppUnit::TypeInfoHelper::getClassName(const std::type_info&)':
 +
TypeInfoHelper.cpp:27: error: 'free' was not declared in this scope
 +
make[2]: *** [TypeInfoHelper.lo] Erreur 1
 +
make[2]: quittant le répertoire « /home/mperouma/Download/MapGuide_TAR/mapguide-2.0.0/Oem/CppUnit-1.9.14/src/cppunit »
 +
make[1]: *** [all-recursive] Erreur 1
 +
make[1]: quittant le répertoire « /home/mperouma/Download/MapGuide_TAR/mapguide-2.0.0/Oem/CppUnit-1.9.14/src »
 +
make: *** [all-recursive] Erreur 1
 +
CPPUNIT 1.9.14: Error build failed (0).................
  
''(If you get error "missing liblib_json.so", then apply patch from http://trac.osgeo.org/mapguide/ticket/347)
+
Error related to the previous ones, I'm still on it...
  
nohup make 2>&1 | tee make_mapguide.log
+
--[[User:Mperouma|Mperouma]] 17:11, 15 May 2009 (UTC)
 +
----
  
nohup make install 2>&1 | tee install_mapguide.log
+
==BUILD MAPGUIDE==
  
If you want to use webstudio, copy the files to the webserverextension folder:
+
Not Done yet ...
  
cp -fpR /home/''administrator''/mapguide-2.0.1/Web/src/webstudio /usr/local/mapguideopensource/webserverextensions/www/webstudio
+
--[[User:Mperouma|Mperouma]] 22:32, 14 May 2009 (UTC)
  
 
== STARTUP OPTIONS ==
 
== STARTUP OPTIONS ==

Latest revision as of 09:37, 18 May 2009

NOTES

Those guidelines must be considered as "EXPERIMENTAL". Most of it have been extracted from "Building MapGuide on Ubuntu 8.0.4" but some parts are extremely special.

For the moment, I'm stucked in the compiling Oem step.

Nevertheless I have three main advices to give :

1) Stay close to the svn version of the libraries

2) Prefer official releases to experimental

3) Install most of main libraries from official repositories (using aptitude)

BASIC SETUP

1) Install a basic Ubuntu 8.10 (Intrepid Ibex).

2) I added the following lines to my /etc/apt/sources.list

deb http://les-ejk.cz/ubuntu intrepid multiverse 
deb-src http://les-ejk.cz/ubuntu intrepid multiverse 

...may help.

then

sudo apt-get update
sudo apt-get upgrade

3) Once this is complete, you will have to add some extra packages to compile MapGuide. Make sure that you get all of these packages; the line is really long:

sudo apt-get install build-essential bison flex automake1.7 automake1.9 libtool doxygen subversion libjpeg62-dev libpng12-dev libfreetype6-dev libexpat1-dev libxalan110-dev libxslt1-dev expat libcurl4-openssl-dev libasound2-Dev python2.5-dev sun-java6-jdk gcc-4.1 g++-4.1

4) To avoid "bad fd number" errors, type the following in the terminal:

sudo dpkg-reconfigure dash

and choose No at the prompt. Be aware that this changes your default /bin/sh from dash back to bash.

5) Set the SUN Java to be the default Java installation: edit /etc/environment file

sudo emacs /etc/environment

(Add the following line) 
JAVA_HOME="/usr/lib/jvm/java-6-sun"

Ok, lets install FDO

FDO INSTALL

1) Download the FDO release 3.4.0 from svn inside of your current working directory

svn checkout http://svn.osgeo.org/fdo/tags/3.4.0  OpenSource_FDO

2) Enter inside of this directory and look for OpenSourceBuild_README.txt

cd OpenSource_FDO
less OpenSourceBuild_README.txt

3) Follow the instructions


Linux Instructions


I. Build Instructions

 1. cd [FDO OpenSource] 
 2. Open and modify setenvironment.sh to specify the locations of the 
    Thirdparty SDK components and build tools. (Refer to the Build Notes 
    below) 
 3.  Source the setenvironment.sh script (bash or bourne compatible shells) 
   ./setenvironment.sh 
 Note : I prefered to use my version of GDAL so I modified the file
 export FDOGDAL=/usr/lib
 4. ./build_thirdparty.sh 

Note : seems to have some trouble here with gdal

 5. sudo ./build_linux.sh 


5) Once you have installed FDO, check the execute permissions on the shared libraries in /usr/local/fdo-3.4.0/lib.

Some may have been installed without execute permission. To correct the permissions, run

chmod a+x *.so*

APACHE / PHP INSTALL

1) Extract the following tarball inside of your working directory

=> http://download.osgeo.org/mapguide/releases/2.0.2/mapguideaptinstaller-2.0.0.2.tar.gz
=> Creates a directory named LinuxApt

2) Enter the directory then launch:

sudo ./build_apt.sh
<!> default options install Apache and Php in /usr/local/mapguideopensource/
=> Also cleans previous versions :) 

3) In a Web browser go to http://127.0.0.1:8008/

=>Ok, It Works !

BUILD OEM

1) Download the last working version from svn (may take hours, more or less 120Mo)

svn checkout http://svn.osgeo.org/mapguide/branches/2.0.x/MgDev/ mapguide-2.0.2

2) Build OEM

First correct some mistakes to avoid compilation errors

cd mapguide-2.0.2/
cd Oem

2.1) Update DWFTK7.1 using windows version of svn (prevents cpp errors in DWFTKT7.1)

rm -rf DWFTK7.1
svn checkout http://svn.osgeo.org/mapguide/trunk/MgDev/Oem/DWFTK7.1 DWFTK7.1


2.2) Edit build_setup file(prevents : "DWFCORE 1.0: Error build failed")

~/mapguide-2.0.2/Oem/DWFTK7.1/develop/global/build/gnu/dwfcore/build_setup

and remove option --force on the autoreconf line. do the same for dwftoolkit and dwfemap

2.3) Edit Makefile in SWIGEx tool (prevents : "SWIGEx 1.0: Error build failed" due to atomics.h:51)

~/mapguide-2.0.2/Oem/SWIGEx/Makefile

and remove flags and associated values -march et -mcpu on C and C++ compiler lines

2.4) Edit C++ following source files (prevents "BDBXML 2.3.10 Error build failed")

~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/include/dbxml/DbXml.hpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/xqilla/include/xqilla/framework/StringPool.hpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/Buffer.cpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/IndexEntry.hpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml/nodeStore/NsTypes.hpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml_dump/dbxml_dump.cpp 
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/dbxml_load/dbxml_load.cpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/src/utils/load_container/LoadContainer.hpp
~/mapguide-2.0.2/Oem/dbxml-2.3.10/dbxml/build_unix/src/utils/shell/Environment.hpp


and in the include section, add those two libraries

#include <cstdlib>
#include <cstring>

2.5) Finally, go for the "big stuff". When inside of your chosen working directory, type

cd mapguide-2.0.2
./build_oem.sh
TypeInfoHelper.cpp: In static member function 'static std::string CppUnit::TypeInfoHelper::getClassName(const std::type_info&)':
TypeInfoHelper.cpp:27: error: 'free' was not declared in this scope
make[2]: *** [TypeInfoHelper.lo] Erreur 1
make[2]: quittant le répertoire « /home/mperouma/Download/MapGuide_TAR/mapguide-2.0.0/Oem/CppUnit-1.9.14/src/cppunit »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/mperouma/Download/MapGuide_TAR/mapguide-2.0.0/Oem/CppUnit-1.9.14/src »
make: *** [all-recursive] Erreur 1
CPPUNIT 1.9.14: Error build failed (0).................

Error related to the previous ones, I'm still on it...

--Mperouma 17:11, 15 May 2009 (UTC)


BUILD MAPGUIDE

Not Done yet ...

--Mperouma 22:32, 14 May 2009 (UTC)

STARTUP OPTIONS

While you're testing, it can be convenient to run services interactively, but eventually you'll want them to shut down / restart when you the computer is rebooted. This section gives you both options.

START SERVICES MANUALLY

Start Apache

sudo /usr/local/mapguideopensource/webserverextensions/apache2/bin/apachectl restart

Stop Apache

sudo /usr/local/mapguideopensource/webserverextensions/apache2/bin/apachectl stop

Start MapGuide

sudo /usr/local/mapguideopensource/server/bin/mgserverd.sh

Stop MapGuide

sudo pkill -f -u root "mgserver daemon"