Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is necessary to specify the following options to improve performance and specify the compile bit type.

 

OptionOption displayDescription
Multithread program compile option-mtNeed to specify when creating a program in multi-thread
Instruction Set Architecture (ISA)-xarch=amd64When compiling 64bit program on AMD cpu (X86) platform
-xarch=sse2aWhen compiling 32bit program on AMD cpu (X86) platform
-xarch=v9When compiling 64bit program on SUN sparc cpu platform
-xarch=v8plusWhen compiling 32bit porgram on SUN sparc cpu platform
Performance option-fastOption 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
ALTI_LIBRARY=/altibase_home/lib
LIBS=-lapre -lodbccli -lthread -lposix4 -ldl -lkvm -lkstat -lsocket -lnsl -lgen -lC -lCrun -ldemangle -lm
LFLAGS= -fast -mt -xarch=amd64 -L/opt/SUNWspro/lib/amd64 -L/usr/lib/amd64

connect1.c:connect1.sc

/altibase_home/bin/apre -t c connect1.sc

connect1:connect1.c

/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
ALTI_LIBRARY=/alticlient32/lib
LIBS=-lapre -lodbccli -lpthread -lrt -ldl -lkvm -lkstat -lsocket -lnsl -lgen -lm

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

connect1:connect1.c

/opt/SUNWspro/bin/cc $(LFLAGS) -o connect1 connect1.c -I$(ALTI_INCLUDE) -L$(ALTI_LIBRARY) $(LIBS)

clean:

rm *.c *.o