How to Download CUBRID Source Code and Build it
As someone who has not used CUBRID before, you need to know how to get started. You are just starting a very enjoyable journey and we warmly welcome you to CUBRID and encourage you to read the following steps.
Requirements for the Building Process
Even though the following tutorial is based on the system currently being developed, which is CUBRID for Linux CentOS 5.x., on most operating systems you will be able to build CUBRID following the steps below.
Tools to Create a Makefile
- libtoolize (GNU libtool) 1.5.22
- aclocal (GNU automake) 1.9.6
- autoconf (GNU Autoconf) 2.59
- automake (GNU automake) 1.9.6
- GNU Make 3.81
Libraries and Tools to Build the CUBRID Source
- J2SDK : jdk1.5.0_15
- ANT : Apache Ant version 1.6.5 compiled on January 6 2007
- libncurses (or libncurses5)
- lzo : (included in external/lzo-2.03)
- PCRE : (included in external/pcre-7.6)
- GC : (included in external/gc6.7)
- libedit : (included in external/libedit-20070831-2.10)
- In the CUBRID source, it is recommended to use those included in external. Some systems are not compatible with the libraries included in CUBRID.
- Sun JAVA J2SDK may not be able to find the included header file jni.h jni_md.h. Then, copy the header file to the include directory of CUBRID. Even when SDK is set up correctly, it may not find the header file in some cases.
- Elfutils needs files other than nlist.h, and these files are installed in most operating systems by default. However, some operating systems do not have the files, so install them.
How to Download Source
Because CUBRID consists of more than 1000 files, it may take different time for source to be downloaded. It depends on your network connection if you checkout from the CUBRID SVN and Sourceforge.net Subversion (SVN) Repository.
To download the CUBRID source code, approximately 300 MB free space is required. Additionally around 200 MB free space is required, because many object files and executable files are created during the building process.
- Create a folder to store the source. The folder name must be in English without a space.
- Download the source code by running the SVN client. Run it at the prompt as shown below or use a GUI client such as TortoiseSVN.
How to Download the Released Source
Since the released source code is managed with the tag, anyone can download the most recent source code. The tag for a release version is shown below:
- Release version: CUBRID 2008 R2.0
- Tag name: 2008_R2.0
How to Build
The build process is different depending on the operating system platform, so you need to build according to your platform.
Building on Linux
It is assumed that the directory of the source is the cubrid_src in the user directory.
- Move to the directory where the source is stored.
- Execute autogen.sh.
- Execute the configure script.
- Build by using make.
- Install by using make install.
- Modify .bashrc to configure environment variables.
- Register the environment variables.
- Create a databases directory.
- When CUBRID is successfully built, test it by referring to the demo database.
[user@host] cd $HOME/cubrid_src
It specifies a directory to be installed. In order to build a debugging version, add the --enable-debug option. CUBRID 2008 R2.0 or higher supports 64-bit, so add the --enable-64bit option to build in a 64-bit environment.
[user@host] ./configure --prefix=$HOME/cubrid
If this configuration does not work properly, execute the following and then retry configure.
[user@host] libtoolize --copy --force
[user@host] make install
[user@host] vim ~/.bashrc
//For CUBRID 8.4.x and 8.2.x versions
//For CUBRID 9.1 or higher versions. Note: CUBRID_LANG is no longer used!
[user@host] source ~/.bashrc
[user@host] mkdir -p $CUBRID_DATABASES
Building on Windows
It is assumed that the path where the source is checked out is c:\cubrid.
- Run the "Visual Studio 2008 command Prompt."
- Move to the win folder under the trunk.
- Build by running devenv.exe. The build process is stored in the build.res.
- Copy the build files to the installation folder. The build files are located in C:\cubrid runkwin\install\Release.
- When the CUBRID build is successfully installed, test it by referring to the demo database.
C:> cd c:\cubrid runkwin
C:\cubrid runkwin> devenv.exe /rebuild
Release cubrid.sln /out .build.res
Note: When building CUBRID R2.0 or earlier, cygwin1.dll is required to run winpcctsantlr.exe and winpcctsdlg.exe. If they are not included in Windows, first, install cygwin before starting the build process. CUBRID R2.0 or higher does not use the antlr parser, so cygwin is not required.
Building on AIX
This guild document apply for the version of RB-8.4.4 and later.Build Steps
The best way is to run the script file of autobuild_aix.cmd which in source tree.Step1: Check out the source of CUBRID
cd $HOMEStep 2: Compile and install
Run autobuild_aix.cmd, it will compile and install CUBRID to $HOME/cubrid.
cd $HOME/trunk ./autobuild_aix.cmdCustomized Way
- Change the install path:
You can modify the prefix in the autobuild_aix.cmd.
OPTS="--prefix=your_cubrid_install_dir --enable-64bit --enable-debug"
- Compile 32 bits:
You can modify the OPTS to “--enable-32bit” in the autobuild_aix.cmd.
OPTS="--prefix=$HOME/cubrid --enable-32bit --enable-debug"
- Compile released version:
You can modify the OPTS, and just remove “--enable-debug” in the autobuild_aix.cmd.
OPTS="--prefix=$HOME/cubrid --enable-64bit "
- Error 1
gmake: *** No targets specified and no makefile found. Stop.You must run make, make install from the directory ofbuild in source tree.
- Error 2
ar: 0707-126 chared.o is not valid with the current object file mode. Use the -X option to specify the desired object mode.You must set following environment before make (for 32bit it is 32).