Step by step to compile casample in linux
1 . Go to /sdk/samplecode/unix
/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix
So that casample.c is accessible like this
[sterin@sterin-lap unix]$ ls -l ../casample/unix/casample.c
-rwxr-xr-x. 1 sterin sterin 51753 May 26 2012 ../casample/unix/casample.c
It contains below files :
-rwxr-xr-x. 1 sterin sterin 6820 Jul 17 2012 configure
-rwxr-xr-x. 1 sterin sterin 1760 Mar 26 12:21 makefile
-rwxr-xr-x. 1 sterin sterin 4354 Jul 1 2010 README
2. Now export
export TECHINCLUDE=/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/common/
export TECHLIB=/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/
export SOURCE_APP_MAKE=/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix/
export PATH=$PATH:/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix/:.
make exsimple _plat=x86-64
Make sure that all the path end with "/"
3. make casample
Error I had :
A. [sterin@sterin-lap unix]$ make casample
make: /bin/ksh: Command not found
make: *** [casample] Error 127
it is due to it is using /ksh , that was not available . After editing makefile . Error resolved
B.
make casample
/bin/sh: line 2: /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unixconfigure: No such file or directory
make: *** [casample] Error 127
[sterin@sterin-lap unix]$ export PATH=$PATH:/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix/:.
[sterin@sterin-lap unix]$ export SOURCE_APP_MAKE=/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix/
C.
[sterin@sterin-lap unix]$ make casample
Building for OS: Linux 3.6.7-4.fc16.x86_64
make[1]: Entering directory `/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix'
rm -f ../casample/unix/Linux3.6.7-4.fc16.x86_64/casample /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/casample
gcc -o ../casample/unix/Linux3.6.7-4.fc16.x86_64/casample ../casample/unix/casample.c -I/usr/local/include -I/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/common -m64 -w -D_LINUX64_SOURCE -DUNIX_64 -L/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo -L/usr/local/lib -lm -lsc_da -lsc_ca -DUNIX -Wl,-rpath-link,/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo,-rpath,'$ORIGIN'
/usr/bin/ld: warning: libstdc++.so.5, needed by /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/libsc_da.so, not found (try using -rpath or -rpath-link)
cp /opt/app/oit/lib/libstdc++.so.5 /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/
make casample
Building for OS: Linux 3.6.7-4.fc16.x86_64
make[1]: Entering directory `/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix'
rm -f ../casample/unix/Linux3.6.7-4.fc16.x86_64/casample /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/casample
gcc -o ../casample/unix/Linux3.6.7-4.fc16.x86_64/casample ../casample/unix/casample.c -I/usr/local/include -I/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/common -m64 -w -D_LINUX64_SOURCE -DUNIX_64 -L/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo -L/usr/local/lib -lm -lsc_da -lsc_ca -DUNIX -Wl,-rpath-link,/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo,-rpath,'$ORIGIN'
cp -f ../casample/unix/Linux3.6.7-4.fc16.x86_64/casample /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo/casample
Binary 'casample' has been placed in /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/demo and ../casample/unix/Linux3.6.7-4.fc16.x86_64/
make[1]: Leaving directory `/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix'
After the compilation
[sterin@sterin-lap unix]$ ls -l /opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/unix
total 28
-rwxr-xr-x. 1 sterin sterin 6820 Jul 17 2012 configure
drwxrwxr-x. 2 sterin sterin 4096 Mar 26 12:20 Linux3.6.7-4.fc16.x86_64
-rwxr-xr-x. 1 sterin sterin 1760 Mar 26 12:21 makefile
-rw-rw-r--. 1 sterin sterin 802 Mar 26 12:24 makefile.Linux3.6.7-4.fc16.x86_64
-rwxr-xr-x. 1 sterin sterin 4354 Jul 1 2010 README
sterin@sterin-lap unix]$ cd ../casample/unix/Linux3.6.7-4.fc16.x86_64/
[sterin@sterin-lap Linux3.6.7-4.fc16.x86_64]$ pwd
/opt/app/oit/840/ca-8-4-0-linux-x86-64/sdk/samplecode/casample/unix/Linux3.6.7-4.fc16.x86_64
[sterin@sterin-lap Linux3.6.7-4.fc16.x86_64]$ ls -l
total 20
-rwxrwxr-x. 1 sterin sterin 16878 Mar 26 12:24 casample
Copy other files from sdk/demo folder to work
No comments:
Post a Comment