In order to use unixODBC Manager, the binary of the software must be created according to the platform. This chapter describes the necessary parts for each step. It is assumed that the compiler uses the native compiler, and in the case of gcc/g++, there are no options to pay attention to, so there will be no explanation. (However, when creating 32/64bit, the compile option must be used carefully.)
Downloading unixODBC Manager
- Download from the following web address http://www.unixodbc.org -> Click Download on the left side of the screen -> Click Download button to download the source.
The downloaded unixODBC is a compressed file in the following format.
unixODBC-2.3.2.tar.gz |
---|
Installation unixODBC Manager
To install unixODBC, perform the following process.
1. Decompressing the source
Decompress the source in the appropriate path.
2. Setting environment variables for compilation
Check the bit of the odbc driver to be used.
Based on the identified bits, it is necessary to determine which bit of 32/64bit unixODBC Manager is to be compiled. Please note that ul32/ul64 included in the odbc driver file name does not mean the file bit of the odbc driver.
ul32 means that the driver is using SQLLEN=4byte(32bit), and ul64 means that the driver is using SQLLEN=8byte(64bit).
The bit-type of the file is classified according to ELF 64-bit and ELF 32-bit in the execution result of the above command.
Setting the size of SQLLEN and SQLULEN type
If BUILD_LEGACY_64_BIT_MODE=1 is set as above, SQLLEN is compiled to use 32bit (4byte) size.
SQLLEN / SQLULEN type size must be used as 32bit
Selecting uniodbc compilation bit type
it can selectively compile unixodbc to 32bit or 64bit with the compilation environment variable. It is compiled as 64bit by default in 64bit OS. To compile unixodbc with 32bit program in 64bit OS, set as follows.
Environment variables to be set for each platform are as follows.
Variable | AIX | HP | SUN |
---|---|---|---|
64bit compile | OBJECT_MODE=64 in the environment variable | Add "+DD64 -DBUILD_REAL_64_BIT_MODE" to CFLAGS. | Set "/usr/lib/64" and "/usr/ucblib/sparv9" in LD_LIBRARY_PATH_64. |
CC | /usr/vac/bin/xlc | /opt/aCC/bin/aCC | /opt/SUNWspro/bin/cc |
CFLAGS LDFLAGS | -q64 (64bit) | +DD64 (64bit) | -xarch=v9 (64bit) |
CXX | /usr/vacpp/bin/xlC_r | /opt/aCC/bin/aCC | /opt/SUNWspro/bin/CC |
LD |
|
| /opt/SUNWspro/bin/CC |
In the case of the compiler, the path can be changed depending on the path installed by the user, so the user must check the path installed in the target device.
The options of CFLGAS and LDFLAGS are also specified differently according to the 32/64bit compilation option. (ELF class error may occur)
Example of a compilation environment variable to compile unixodbc to 32bit on Linux 64bit OS
After declaring as above and going with the subsequent compilation process, unixodbc with a SQLLEN size of 4 bytes (32 bits) and an executable file bit number of 32 bits is compiled.
3. Configuration process for the 'make' process
Perform the configuration. Here, the directory to be installed and some options required for the make process are set.
In the configuration stage, all environments for compiling are checked, so if an error occurs, necessary binaries must be installed directly.
The directory where unixODBC is installed is installed in the path set as the prefix argument value. For example, if prefix=/home/unixODBC, unixODBC is finally installed in /home/unixODBC after install operation.
4. Compiling
perform make
In the case of AIX, it may be estimated that there may be errors in compilation depending on the patch level of the operating system.
Perform make install
When performing make is finished, the binary files completed with compilation are installed in the installation directory by executing make install. Since it is installed in the prefix directory specified in the configuration step, you must have access rights to the directory in advance.
Check for the normal installation
The dltest file is located under the bin in the directory where unixODBC is installed. If unixODBC Manager is normally installed as above, dltest for the ODBC driver for Unix provided by ALTIBASE should run normally.