Home >> Madeline 2.0 PDE Build Instructions
Madeline 2.0 PDE Build Instructions
Introduction
It is straight-forward and easy to build Madeline 2.0 PDE on a modern Linux system where most dependencies will already be satisfied. On other operating systems, be prepared to follow instructions carefully and to spend some time installing dependent libraries before building Madeline.
Madeline 2.0 PDE uses a new build system based on CMake. As many people are not yet familiar with CMake, we provide some instructions below.
Madeline 2.0 PDE additionally requires the presence of certain external libraries. Some of these external libraries are optional, and some are mandatory. These dependencies are also described below.
Build Tool Dependencies
Several build tools are required:
- Subversion is a source code management tool.
-
CMake is a superior replacement
for the
automake/autoconfbuild system tools. - Pkg-config is a tool used to find out where library packages are located on a system and which compiler options are required for linking to these libraries.
- DOxygen is used to build the Madeline API documentation - RECOMMENDED BUT OPTIONAL.
You will need Subversion to check out the latest development code for Madeline 2.0 PDE. Sometimes it is necessary to find a pre-built binary package as building subversion from source code can be tedious. Make sure that your version of subversion is compiled with SSL support included.
A command line for checking out the Madeline 2.0 source code from the Subversion repository on SourceForge looks like this:
svn co https://madeline2.svn.sourceforge.net/svnroot/madeline2 madeline2
CMake is a superior replacement for the automake/autoconf
build system used by many other Free/Libre Open Source (FLOSS) projects.
Newer distributions of Linux may have CMake present but
the version will most likely be too old. In particular, the
LASi library upon which
Madeline depends requires at least CMake
version 2.4-patch 6.
On most platforms you will have to build this from source code as the
package repository versions may also be too old.
Pkg-config is present on recent Linux distributions but is likely not present on operating systems like OS X.
Pkg-config itself may not be able to find installed packages
unless told specifically where to look. If you install Madeline
dependencies like FreeType2, Pango, and LASi
in a special directory like /opt/madeline, then be sure
to export the search path as follows:
export PKG_CONFIG_PATH=/opt/madeline/lib/pkgconfig:$PKG_CONFIG_PATH
To be safe in this case, you will probably also want to export
a search path for the linker too:
export LD_LIBRARY_PATH=/opt/madeline/lib:$LD_LIBRARY_PATH
Finally, DOxygen is used to build the Madeline API documentation. This is highly recommended but is technically optional.
Library Dependencies
Madeline 2.0 PDE depends on the following libraries. Most of these libraries will be already installed on Linux. However, if you are building Madeline on a non-Linux system, expect to spend some time downloading and building these from source code. On some platforms you may be able to install these from packages. However, installing from packages is not nearly as fool-proof as building from source code:
- libXML2. XML parser.
- Gettext localization and internationalization library.
- LASi Unicode PostScript library. - OPTIONAL
- MySQL++ provides integrated MySQL database support. - OPTIONAL
LibXML2 is an XML parser. It should be already installed on recent Linux systems.
Gettext allows Madeline to use message translation catalogues for localization in other languages.
(Currently Madeline only has "stub" message catalogues for a few languages -- French, Chinese, and Thai. Please email us at madelinesoftware@umich.edu if you are interested in localizing (translating) Madeline 2.0 PDE into another language.)
LASi is a Unicode Postscript library. Madeline uses LASi for internationalized text layout functionality. On the Cygwin Win32 and Mac OS X platforms, you may want to optionally compile Madeline without LASi. This option allows you to run Madeline 2.0 on Cygwin with reduced support for internationalization but no reduction in the ability to draw complex pedigrees. If you compile Madeline 2.0 without LASi, you will lose support for complex text layout (CTL) scripts such as Arabic and Devanagari. However you will still be able to print pedigree drawings containing many other extended-Latin and non-Latin Unicode scripts such as Japanese, Chinese, and even Thai in most cases. See the Cygwin and Mac OS X sections below for more details.
The LASi documentation describes how to build LASi in detail on the major platforms. Note that LASi itself depends on FontConfig, FreeType2, and Pango.
MySQL++ provides integrated support for opening and reading MySQL tables from within Madeline. This option will become more relevant in the future once the interactive interpreter has been incorporated into Madeline 2.0. At the time of writing (2007.04.03) this option is primarily only useful to developers.
*Nix Guru Instructions
# ASSUMING SOME PRE-REQUISITE LIBRARIES
# HAVE ALREADY BEEN INSTALLED
# IN THE NON-STANDARD /opt/madeline DIRECTORY:
export LD_LIBRARY_PATH=/opt/madeline/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/opt/madeline/lib/pkgconfig:$PKG_CONFIG_PATH
# THE FOLLOWING ARE MAINLY FOR A SMOOTH SVN EXPERIENCE:
export LANG=en_US.UTF-8 # Useful on OSX when using OSX's terminal especially
export TERM=vt100 # Useful when SVN doesn't recognize your terminal type (mlterm, konsole, etc.)
# FINALLY GET DOWN TO BUSINESS:
svn co https://madeline2.svn.sourceforge.net/svnroot/madeline2 madeline2
cd madeline2/madeline2/trunk
cmake -DCMAKE_INSTALL_PREFIX=/opt/madeline/ .
make
su -c "make install"
General Step-by-step Instructions
Once you have taken care of build tool and library dependencies, you can begin building Madeline:
Step 0: Download Code from SVN
You may obtain the latest version of the Madeline 2.0 development code from our Sourceforge project Subversion repository using a command such as the following:
svn co https://madeline2.svn.sourceforge.net/svnroot/madeline2 madeline2
If you checked the code out a few days or weeks ago, you may want to check for the latest code updates as follows:
svn update
If you want to know what has changed in the latest development version of the code, just look at the log file using the following command:
svn log | less
After you have checked out the code, change into the trunk
directory and run cmake as described below.
Step 1: Running CMake and Specifying Options
In the trunk directory, you can run cmake
minimalistally as follows:
cmake .
A fancier cmake command allows you to specify
exactly where to install Madeline and makes make display
the exact commands used in compiling each step (useful if you run into
problems):
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/prefix \ -DCMAKE_VERBOSE_MAKEFILE=ON /path/to/madeline/source/code >& cmake.out
Here is how you would turn off LASi support, turn on
MySQL++ support, and specify that Madeline be installed
in /opt/madeline:
cmake -DCMAKE_INSTALL_PREFIX=/opt/madeline/ -DWITH_LASi=off -DWITH_MYSQLPP_SUPPORT=on .
A more likely command for the Cygwin/Win32 environment would simpy be:
cmake -DWITH_LASi=off .
A curses-based interactive cmake configuration session might begin like this:
ccmake -DCMAKE_INSTALL_PREFIX=/opt/madeline/ .
Step 2: Running Make
If you have any problems with the local system's make program,
download and install GNU GMake.
make
Step 3: Installing the Executable and Documentation
This step usually requires super-user (administrative) rights. On Linux, the usual command is:
su -c "make install"
On some other platforms, it might be easier to first su
and then run make install:
~>
~> su
Password: *******
#> make install
#> exit
~>
Linux Instructions
Madeline is developed on Linux and the instructions above reflect what is required to build Madeline on modern Linux systems. At the current time there are no special notes regarding specific distributions.
Mac OS X Instructions
Please follow the detailed instructions for building LASi on OS X. Those instructions describe not only how to install LASi, a Madeline 2.0 dependency, but also required tools such as CMake and SVN, as well as other libraries also required by Madeline 2.0 such as libXML2.
Note especially that due to numerous problems with Fink, we currently do not recommend using Fink. Instead, we recommend building dependent libraries from source code as necessary as described in the LASi on OS X documentation.
Once you have installed LASi on OS X, installing Madeline 2.0 should proceed without difficulty. Be sure to set the PKG_CONFIG_PATH correctly so that CMake can find packages such as Pango which you may have built from source. For example:
rm CMakeCache.txt
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cmake .
If you encounter libintl errors at link time, edit the CMakeLists.txt file in the src directory and change the following line:
SET(requiredLibs)
... to the following:
SET(requiredLibs "-lintl")
If you encounter bus errors when running Madeline 2.0 on OS X recompile the program without LASi support:
rm CMakeCache.txt
cmake -DWITH_LASi=off .
make
su
password: *****
make install
exit
Other *Nix Systems
Building Madeline 2.0 on other *Nix systems generally follows the same pattern as for Linux. The main difference is that you may need to install a larger set of prerequisite dependencies than is required on Linux.
Madeline 2.0 is currently known to compile successfully on the following *Nix systems:
- OpenBSD 4.0 on Intel 32-bit hardware.
Cygwin on Win32 Instructions
Madeline 2.0 PDE can be built to run under Cygwin which is a Linux-like environment for Windows. The following instructions describe how to build Madeline 2.0 without the LASi internationalization dependencies using the -DWITH-LASi=off build-time configuration option:
1. Install Cygwin: Cygwin is available from: http://www.cygwin.com/.
1.1. You will need to install a complete set of development tools in order to build Madeline under Cygwin. From the Cygwin installer, be sure to select the [+] Devel tab. Make sure that the normal set of development tools such as GCC / G++, autoconf / automake, and GNU Make are all selected for installation.
1.2. In addition to these tools, also make sure that the following tools are also selected from [+] Devel tab for installation:
- make: The GNU version of make
- cmake: A cross platform build manager. Note: Version 2.4.6 is required.
- doxygen: A documentation system for C++, C, Java., etc. Required to build Madeline API documentation.
- libXML2-devel: XML C parser and toolkit (development)
- subversion: A version control system. Required in order to check Madeline out of the subversion repository.
1.3. Some additional items must be selected from other tabs. Whenever there is a choice between some required library and the "development" package of the same library, be sure to choose the "development" package. The "development" packages include the header files necessary for compilation. From the [+] Base tab, select:
- zlib: The zlib compression and decompression library
1.4. From the [+] Libs tab, select:
- openssl-devel: The OpenSSL development environment
- gettext: GNU Internationalization library and core utilities (PLUS LINK LIBS)
If you have not yet selected zlib and libXML2, these libraries may be duplicated for selection under the [+] Libs tab.
2. Create Symbolic links to DLLs: Due to some pecularities with the linker which are explained in exhaustive detail in http://sources.redhat.com/binutils/docs-2.17/ld/WIN32.html , you will need to create some symbolic links as follows for the z, ssl, and crypto libraries. Note that specific library version numbers may differ from the example shown below. Enter a Cygwin command shell and execute the following commands:
cd /
mv lib/libz.dll.a lib/libz.dll.a.original
ln -s bin/cygz.dll lib/libz.dll.a
mv lib/libssl.dll.a lib/libssl.dll.a.original
ln -s bin/cygssl-0.9.8.dll lib/libssl.dll.a
mv lib/libcrypto.dll.a lib/libcrypto.dll.a.original
ln -s bin/cygcrypto-0.9.8.dll lib/libcrypto.dll.a
(Note that these instructions provide you a way to revert back to the original dlls in case you make a mistake or something doesn't work correctly).
3. Patch Cygwin to support IPV6: This is required by the 3rd-party netxx library used by Madeline 2.0. Download the Cygwin IPV6 patches from http://win6.jp/Cygwin/index.html. The patch file is supplied in a ZIP package. You will need to unzip the package in such a way that the files in the zip package replace the original Cygwin files.
Finally, you will need to replace the original cygwin1.dll with the patched new-cygwin1.dll. For your conveninece, we provide the complete Cygwin IPV6 patch instructions here.
4. Run CMake and compile: LASi support is disabled using the following configuration command:
cmake -DWITH_LASi=off .
CMake will inform you if there are missing dependencies. If all library dependencies have been satisfied, continue with:
make
make install
If you encounter libintl errors at link time, edit the CMakeLists.txt file in the src directory and change the following line:
SET(requiredLibs)
... to the following:
SET(requiredLibs "-lintl")
In case of errors or changes to CMakeLists.txt, it's a good idea to remove the cache file and reconfigure from scratch as follows:
rm CMakeCache.txt
cmake -DWITH_LASi=off .
make
make install
*** End of document ***