...
It is necessary to specify the following options to improve performance and specify the compile bit type.
Option | Option display | Description |
---|---|---|
Multithread program compile option | -mt | Need to specify when creating a program in multi-thread |
Instruction Set Architecture (ISA) | -xarch=amd64 | When compiling 64bit program on AMD cpu (X86) platform |
-xarch=sse2a | When compiling 32bit program on AMD cpu (X86) platform | |
-xarch=v9 | When compiling 64bit program on SUN sparc cpu platform | |
-xarch=v8plus | When compiling 32bit porgram on SUN sparc cpu platform | |
Performance option | -fast | Option for improving Runtime performance |
Note |
---|
By referring to the $ALTIBASE_HOME/install/altibase_env.mk file and $ALTIBASE_HOME/sample/APRE/Makefile, it can be referred to the optimized compile and link options when compiling APRE. |
Example of simple Makefile
The simplest Makefile that can compile APRE in SUN X86 cc environment is completed as follows. In addition, if there is an additional library referenced by the program, the library must additionally be described in Makefile. Depending on the platform type, the options for specifying the memory model (32bit/64bit) may vary, so refer to the compile option table described above and set it according to the platform type.
Panel |
---|
ALTI_INCLUDE=/altibase_home/include connect1.c:connect1.sc /altibase_home/bin/apre -t c connect1.sc /opt/SUNWspro/bin/cc $(LFLAGS) -o connect1 connect1.c -I$(ALTI_INCLUDE) -L$(ALTI_LIBRARY) $(LIBS) clean: rm *.c *.o |
Example of Makefile for 32bit compile
An example of APRE Makefile for SUN X86 cc specifying the 32bit compile option is as follows. Specify "-xarch=sse2a" as a compile coption, and specify the path where the 32bit APRE library is installed in the path referencing the Header file and library. In addition, APRE precompiler also specifeis the path to execute 32bit APRE.
Panel |
---|
ALTI_INCLUDE=/alticlient32/include LFLAGS= -fast -mt -xarch=sse2a -L/opt/SUNWspro/lib/amd64 -L/usr/lib/amd64 connect1.c:connect1.sc /alticlient32/bin/apre -t c connect1.sc /opt/SUNWspro/bin/cc $(LFLAGS) -o connect1 connect1.c -I$(ALTI_INCLUDE) -L$(ALTI_LIBRARY) $(LIBS) clean: rm *.c *.o |