ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在Solaris编译strmmon出现错误的解决过程

在Solaris编译strmmon出现错误的解决过程

原创 Linux操作系统 作者:jeffli73 时间:2010-08-01 18:26:42 0 删除 编辑
根据文档"Oracle Streams STRMMON Monitoring Utility [ID 290605.1]",STRMMON 是Oracle提供的监控Stream的一个工具,但Oracle只提供了C源文件,需要用户自行编译。
在Solaris平台编译,遇到了一些,现将解决过程记录一下



1.编译出现错误
$ make -f demo_rdbms.mk strmmon
/usr/ccs/bin/make -f /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk build EXE=strmmon BJS=strmmon.o
gcc -Xa  -xstrconst -dalign -xF    -xildoff -errtags=yes -v -xarch=v9 -xchip=ultra3  -W2,-AKNR_S -Wd,-xsafe=unboundsym  -Wc,-Qiselect-funcalign=32 -xcode=abs44  -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -xalias_level=weak  -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -K PIC -c -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/plsql/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/network/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/precomp/public strmmon.c
gcc: PIC: No such file or directory
Reading specs from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/specs
gcc: unrecognized option `-Xa'
gcc: unrecognized option `-K'
gcc version 2.7.2
gcc: language alias_level=weak not recognized
 /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/cpp -lang-c -v -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/plsql/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/network/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/precomp/public -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -Dsun -Dsparc -Dunix -D__svr4__ -D__SVR4 -D__GCC_NEW_VARARGS__ -D__sun__ -D__sparc__ -D__unix__ -D__svr4__ -D__SVR4 -D__GCC_NEW_VARARGS__ -D__sun -D__sparc -D__unix -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc) -W2,-AKNR_S -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32 -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -dalign -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 strmmon.c /var/tmp/ccQNaOsJ.i
GNU CPP version 2.7.2 (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo
 /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/public
 /opt/app/oracle/oracle/product/10.2.0/db_1/plsql/public
 /opt/app/oracle/oracle/product/10.2.0/db_1/network/public
 /opt/app/oracle/oracle/product/10.2.0/db_1/precomp/public
 /usr/local/include
 /usr/dist/local/share/tom/gnu/sparc-sun-solaris2.5/include
 /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include
 /usr/include
End of search list.
 /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/cc1 /var/tmp/ccQNaOsJ.i -quiet -dumpbase strmmon.c -dalign -W2,-AKNR_S -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32 -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -version -o /var/tmp/ccQNaOsJ.s
cc1: Invalid option `-W2,-AKNR_S'
cc1: Invalid option `-Wd,-xsafe=unboundsym'
cc1: Invalid option `-Wc,-Qiselect-funcalign=32'
cc1: Invalid option `-Wc,-Qgsched-trace_late=1'
cc1: Invalid option `-Wc,-Qgsched-T5'
GNU C version 2.7.2 (sparc) compiled by GNU C version 2.7.2.
In file included from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/time.h:90,
                 from /usr/include/sys/time.h:418,
                 from /usr/include/sys/select.h:23,
                 from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/types.h:278,
                 from /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo/oratypes.h:273,
                 from strmmon.c:354:
/usr/include/sys/siginfo.h:79: parse error before `pthread_attr_t'
/usr/include/sys/siginfo.h:79: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:81: parse error before `}'
In file included from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/time.h:90,
                 from /usr/include/sys/time.h:418,
                 from /usr/include/sys/select.h:23,
                 from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/types.h:278,
                 from /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo/oratypes.h:273,
                 from strmmon.c:354:
/usr/include/sys/siginfo.h:259: parse error before `ctid_t'
/usr/include/sys/siginfo.h:259: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:259: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:260: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:261: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:290: parse error before `int32_t'
/usr/include/sys/siginfo.h:290: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:291: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:292: parse error before `}'
/usr/include/sys/siginfo.h:292: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:294: parse error before `}'
/usr/include/sys/siginfo.h:294: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:390: parse error before `ctid_t'
/usr/include/sys/siginfo.h:390: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:390: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:391: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:392: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:398: conflicting types for `__fault'
/usr/include/sys/siginfo.h:267: previous declaration of `__fault'
/usr/include/sys/siginfo.h:404: conflicting types for `__file'
/usr/include/sys/siginfo.h:273: previous declaration of `__file'
/usr/include/sys/siginfo.h:420: conflicting types for `__prof'
/usr/include/sys/siginfo.h:287: previous declaration of `__prof'
/usr/include/sys/siginfo.h:423: parse error before `int32_t'
/usr/include/sys/siginfo.h:423: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:424: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:426: parse error before `}'
/usr/include/sys/siginfo.h:426: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:428: parse error before `}'
/usr/include/sys/siginfo.h:428: warning: data definition has no type or storage class
/usr/include/sys/siginfo.h:432: parse error before `k_siginfo_t'
/usr/include/sys/siginfo.h:432: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:437: parse error before `}'
/usr/include/sys/siginfo.h:437: warning: data definition has no type or storage class
In file included from /usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/signal.h:15,
                 from strmmon.c:384:
/usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/signal.h:124: conflicting types for `sigset_t'
/usr/include/sys/select.h:46: previous declaration of `sigset_t'
/usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/signal.h:152: parse error before `siginfo_t'
In file included from strmmon.c:384:
/usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/signal.h:89: parse error before `siginfo_t'
/usr/dist/local/share/tom/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/signal.h:90: parse error before `siginfo_t'
*** Error code 1
make: Fatal error: Command failed for target `strmmon.o'
Current working directory /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo
*** Error code 1
make: Fatal error: Command failed for target `strmmon'


2.确认C编译器
$ which cc
/usr/ucb/cc
$ ls -l /usr/ucb/cc
lrwxrwxrwx   1 root     root          23 Oct 13  2009 /usr/ucb/cc -> /usr/dist/local/exe/gcc
$

实际上用的是gcc

3.在 MOS(metalin)上查找相关资料,发现OCI示例与gcc不兼容,要求下载经过验证的Sun编译器

https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&id=%28%29%29,%28page=KBNavigator&id=%28bmDocID=1074808.6&viewingMode=1143&from=BOOKMARK&bmDocTitle=FATAL%20ERRORS%20WHEN%20TRYING%20TO%20MAKE%20THE%20OCI%20DEMO&bmDocDsrc=KB&bmDocType=PROBLEM%29%29

FATAL ERRORS WHEN TRYING TO MAKE THE OCI DEMO [ID 1074808.6]

Solution Explanation:
=====================

The OCI demoes are incompatible with GNU cc (gcc).  Install the certified Sun
compiler.

4.下载Sun编译器并根据文档进行安装,选择Option2,不需要root权限,但这种方式Sun不提供support

http://developers.sun.com/sunstudio/downloads/index.jsp

Option 2

Sun Studio 12 Update 1 Tarfile Installer Information

The Sun Studio 12 Update 1 tarfile installer download contains a self-extracting tarfile of an installed image of Sun Studio software, which you can expand in your directory of choice. The tarfile installer does not install any packages. You can use the tarfile installer if you do not have root access to your system, or if you need an alternative to the Package Installer.

Sun support is not available for this configuration nor can the software be updated with patches. Community support is available through the Sun Studio forums.

Downloading the Tarfiles and Installing the Sun Studio 12 Update 1 Software

   1. Download the Sun Studio 12 Update 1 tarfile installer download file into a temporary directory, such as /var/tmp.

   2. Unpack the download by typing:

      bzcat download_directory/download_file | /bin/tar -xf -
            

   3. Go to the directory where you want Sun Studio 12 Update 1 software to be installed:

      cd installation_directory

      If the installation directory contains a sunstudio12.1 subdirectory, move or delete this subdirectory.

   4. Review the software license agreement for Sun Studio 12 Update 1 software:

      path_to_installer/SunStudio12u1-os-platform-tar.sh --print-license
             

   5. Accept the license and install the software:

      path_to_installer/SunStudio12u1-os-platform-tar.sh --accept-license
             

Updating Your Path

Because the Sun Studio 12 Update 1 software product components and man pages are not installed into the system directories /usr/bin and /usr/share/man, you must change your PATH and MANPATH environment variables to enable use of the Sun Studio 12 Update 1 software.

On Solaris platforms, add the path /installation_directory/sunstudio12.1/bin to your PATH environment variable. On Linux platforms, add the path /installation_directory/sun/sunstudio12.1/bin to your PATH environment variable. If you have previous versions of Sun Studio, Sun ONE Studio, or Forte Developer software installed, add the path before the paths of the previous installations.

On Solaris platforms, add the path /installation_directory/sunstudio12.1/man to your MANPATH environment variable. On Linux platforms, add the path /installation_directory/sun/sunstudio12.1/man to your MANPATH environment variable.

Solaris 10 OS System Patches
The Sun Studio 12 Update 1 tarfile installer download also includes patches for Solaris 10 Operating System that are required for the proper operation of the Sun Studio software. To install these patches:

   1. Become superuser (root) by typing:

      su
      Password: root-password

   2. Install the patches:

      path_to_installer/install_patches.sh
           

Additional operating system patches are recommended to resolve specific issues that might or might not affect your use of the Sun Studio 12 Update 1 software. These patches are not included in the download. To install these patches, download them from SunSolve using the links in the following tables and follow the instructions in the README file included with the patch, which contains important information on risks and proper procedure.
Solaris OS on SPARC based systems
    Patch     Description     Reason to Install

Solaris 10 releases earlier than Solaris 10 08/07
   
127127
    SunOS 5.10: kernel patch     Required in order for compiler annotations (-xannotate=yes) to work


Solaris OS on x86 based systems
    Patch     Description     Reason to Install

Solaris 10 releases earlier than Solaris 10 08/07
   
127128
    SunOS 5.10_x86: kernel patch     Required in order for compiler annotations (-xannotate=yes) to work

Solaris 10 releases earlier than Solaris 10 10/08
   
137138
    SunOS 5.10_x86: kernel patch     Required on systems on which patch 127112 or 127128 has been installed in order to use the dbx debugger to debug applications that use signal handling.





5.C编译器安装成功后再进行编译,成功

$ cd ../demo
$ make -f demo_rdbms.mk strmmon
/usr/ccs/bin/make -f /opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk build EXE=strmmon BJS=strmmon.o
cc -Xa  -xstrconst -dalign -xF    -xildoff -errtags=yes -v -xarch=v9 -xchip=ultra3  -W2,-AKNR_S -Wd,-xsafe=unboundsym  -Wc,-Qiselect-funcalign=32 -xcode=abs44  -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -xalias_level=weak  -D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -K PIC -c -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/demo -I/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/plsql/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/network/public -I/opt/app/oracle/oracle/product/10.2.0/db_1/precomp/public strmmon.c
cc: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
cc  -xarch=v9 -L/opt/app/oracle/oracle/product/10.2.0/db_1/lib/ -L/opt/app/oracle/oracle/product/10.2.0/db_1/rdbms/lib/ -o strmmon strmmon.o -lclntsh   `cat /opt/app/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -R/opt/app/oracle/oracle/product/10.2.0/db_1/lib -laio  -lposix4 -lkstat -lm  -lthread -lpthread
cc: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
$ ls -l strmmon*
-rwxr-xr-x   1 oracle   dba       123984 Jul 22 03:52 strmmon
-rw-r--r--   1 oracle   dba       127845 Jul 15 03:06 strmmon.c
-rw-r--r--   1 oracle   dba      3495357 Jul 22 03:50 strmmon.c.combine
-rw-r--r--   1 oracle   dba      3223906 Jul 22 03:50 strmmon.c.cse
-rw-r--r--   1 oracle   dba      3223906 Jul 22 03:50 strmmon.c.cse2
-rw-r--r--   1 oracle   dba            0 Jul 22 03:50 strmmon.c.dbr
-rw-r--r--   1 oracle   dba      3811737 Jul 22 03:50 strmmon.c.flow
-rw-r--r--   1 oracle   dba      3584914 Jul 22 03:50 strmmon.c.greg
-rw-r--r--   1 oracle   dba      3223906 Jul 22 03:50 strmmon.c.jump
-rw-r--r--   1 oracle   dba      3522743 Jul 22 03:50 strmmon.c.jump2
-rw-r--r--   1 oracle   dba      3223906 Jul 22 03:50 strmmon.c.loop
-rw-r--r--   1 oracle   dba      3940204 Jul 22 03:50 strmmon.c.lreg
-rw-r--r--   1 oracle   dba      3182596 Jul 22 03:50 strmmon.c.rtl
-rw-r--r--   1 oracle   dba      3492729 Jul 22 03:50 strmmon.c.sched
-rw-r--r--   1 oracle   dba            0 Jul 22 03:50 strmmon.c.sched2
-rw-r--r--   1 oracle   dba        45922 Feb 10  2007 strmmon.htm
-rw-r--r--   1 oracle   dba         1256 Jul 15 03:04 strmmon.mk
-rw-r--r--   1 oracle   dba       258264 Jul 22 03:51 strmmon.o
-rw-r--r--   1 oracle   dba        31981 Jul 14 04:05 strmmon.zip


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13940/viewspace-669958/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-06-10

  • 博文量
    21
  • 访问量
    54023