|
|
|
HOWTO: Compile and Build |
PDF
|
| Print |
|
|
This document explains the openQRM build-system and how to use it. It describes the system's general workings, requirements, usage and what needs to be done to create an openQRM installation-package/release. 1. How to build openQRM from source
- You need to install a few packages to round out the build environment.
- Redhat: rpm -ivh the gcc compiler rpm and the rpms for the packages listed for Centos.
- Centos: yum install gcc gcc-c++ kernel-devel kudzu MAKEDEV zlib-devel bison flex pciutils-devel db4-devel
- Gentoo: emerge gcc gcc-c++ kernel-devel kudzu kudzu-del MAKEDEV zlib-devel bison flex pciutils-devel db4-devel
- Debian: apt-get gcc libdb4.3 libdb4.3-dev rpm pciutils pciutils-dev bison bzip2 iproute linux-kernel-headers linux-kernel-devel zlib1g-dev portmap alien
- Install the kudzu library (requires kernel-header files to be installed)
- Redhat: rpm -ivh <kernel source rpm>
- Centos: already done, see above
- Debian: already done, see above
- Gentoo: already done, see above
- Install the MAKEDEV package which makes it easier to create and maintain the files in the /dev directory.
- RedHat: install the MAKEDEV rpm
- For Mandriva: install the 'makedev' package and then run:
- echo "/sbin/makedev /dev $@" > /dev/MAKEDEV
- Debian: use alien to convert redhat rpm it to a tarball then build and install. Use the following commands:
- cd /tmp
- wget -nd ftp://ftp.redhat.com/pub/redhat/linux/enterprise/3/en/os/i386/SRPMS/MAKEDEV-3.3.8-1.src.rpm
- alien --to-tgz MAKEDEV-3.3.8-1.src.rpm
- tar -xvzf MAKEDEV-3.3.8-1.tar.gz
- cd MAKEDEV-3.3.8/
- make
- make install
- zlib-devel needs to be installed
- Redhat: rpm -ivh zlib-devel
- Bison needs to be installed
- Redhat: rpm -ivh bison.rpm
- Flex needs to be installed
- Redhat: rpm -ivh flex.rpm
- pciutils-devel needs to be installed.
- Redhat: rpm -ivh pciutils-devel.rpm
- Java JDK 1.5.x needs to be installed. openQRM needs the JDK and *NOT* the JRE.
- For Intel x86 architecture:
- Point your browser to Sun's jdk 1.5.x, accept the agreement and download the file to your local directory.
- Make sure that in /usr there is no existing java folder or java symbolic link. Install the JDK. This example uses "jdk-1_5_0_07" as the version number.
cp jdk-1_5_0_07-linux-i586-rpm.bin /usr cd /usr chmod +x jdk-1_5_0_07-linux-i586-rpm.bin ./jdk-1_5_0_07-linux-i586-rpm.bin ln -s jdk1.5.0_07 java
- For Debian/Ubuntu/Kubuntu on pSeries
- Point your browser to IBM's Java site jdk 1.5.x
- Go to the "IBM SDK for 32-bit iSeries/pSeries"
- Download ibm-java2-jre-50-linux-ppc.tgz . Registration Required.
- Run the following commands:
tar zxvf ibm-java2-jre-50-linux-ppc.tgz mkdir /usr/java mv ibm-java2-ppc-50/ /usr/java/ chown -R root:root /usr/java/ibm-java2-ppc-50/ ln -fs /usr/java/ibm-java2-ppc-50/jre/bin/java /usr/bin/java ln -fs /usr/java/ibm-java2-ppc-50/jre/bin/javaw /usr/bin/javaw java -version
If you get an error from "java --version" like "Error loading: libstdc++.so.5: cannot open shared object file: No such file or directory" then run "sudo apt-get install libstdc++5". This will install the missing library. Set the environment variable export JAVA_HOME=/usr/java
- exit your current root shell and start a new one to take advantage of the new JAVA and MAVEN env vars.
- Download the source packages from the openQRM Sourceforge Project Page .
- Untar the sources to your build directory
- tar -xvzf openqrm-2.2-3-src.tgz -C /tmp
- cd /tmp/openqrm-2.2-3/
- mkdir packages
- copy the SJP tarball in your home directory to /tmp/openqrm-2.2-3/packages/
- cd src
- make realclean
- make
- make inst
- cd ../out/
- ls -l
You will have something like "openQRM-08-25-2005-11-09-04.tgz." in the out directory. The OpenQRM installation can be started from this directory or it can be packaged by "make tgz" to ship to another system for installation there.
If build fails with error: `yytext_ptr' undeclared, edit the file /var/tmp/qrm/build/modutils/modutils-2.4.27/genksyms/lex.c and comment out the line - #undef yytext_ptr and run make again. Congratulations! You should now proceed to the QuickStart section for instructions on installing and using openQRM.
2. Source Build MechanismThe openQRM build-system is based on simple/static Makefiles which are called recursively through the source directory structure. Each source directory needs to provide a Makefile with at least the following make-targets "all," "install," "clean" and "realclean." Make target specifications :
- "all" -> Compile all sources through the help of the openQRM setup-functions (described below in "Generic components build").
- "install" -> Copy resulting files to the output-directory.
- "clean" -> Clean the components source-tree.
- "realclean" -> Clean the components source-tree and cache directory.
3. Third-party component buildComponent builds are configured by build-config files e.g. .conf. A build-function is called from the directory-Makefile with .conf as parameter (the Makefile additional configures eventual pre/post/configure/make options).
The build-functions take care of the following :
- Check if component is configured as "source," "binary" or "userctl." For now, we assume using the "source" package mode for the openQRM build system. (Note: the installation uses the same mechanism but is "binary" mode by default.)
"source" -> Compile from sources. "binary" -> Use a binary (e.g. rpm) package if possible (if not build from sources). "userctl" -> Use the users-binary if possible (if not build from sources).
- Check if a compilation is needed or if the output-binaries are already in the build-cache. If a build is needed, continue.
- Check if a download is needed or if the source package is already in the source-cache. If a download is needed, then download the sources for the component from either the project web site or from our support web site to the source-cache dir (by default /var/cache/qrm/src/ ).
- Unpack the sources in the build-cache dir (by default /var/tmp/qrm/build/).
- Configure the sources and eventually run a preliminary phase if configured.
- Compile the sources with optional given make-parameters.
- Eventually run a post-phase if configured.
- Put all output binaries/files in the build-cache.
4. Known Issues During a build, if you get a 'file not found' error when trying to download a third-party tarball, it may be that the build system is trying to download an older version of that package. Determine the current version and edit the .conf file referenced in the above third-party component build section. For example: edit the src/plugins/dhcpd/build/dhcpd.conf and bump the version number.
Please be aware that the build may fail on Linux distributions/versions which are not listed in the "Requirements -> Tested distributions" section. If you noticed this misbehavior on the Linux-distribution/version you are using, please report it to the development team with detailed information about :
- your Linux-distribution + version
- which component failed
- why it failed
- give line-numbers if possible
- add debugging output and eventual error messages
5. Tested distributions- Redhat 7.3
- Redhat 9
- Redhat Advanced Server 3
- Fedora Core 4
- Debian 3.1r1a
- Centos 4.3
|
|