2 Replies Latest reply: Sep 26, 2012 6:46 PM by 929219 RSS

    compiling problem when using ansi c compiler on solaris 11

    929219
      Hello

      I'm using solaris 11 on sparc T4 server.

      I was trying to generate tpch benchmark data set on the server. I downloaded the tpch files from http://www.tpc.org/tpch/default.asp website. There's a makefile that is used to compile the data generation program. In the makefile, there's a line that specifies which compiler to use. After searching the web, I think it might be "cc" on solaris. so I installed oracle solaris studio 12.3, gcc-3, gcc-45 and set the environment variable:

      export PATH=$ORACLE_HOME/bin:$ORACLE_BASE/oracle_solaris_studio/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin:$PATH
      export MANPATH=$ORACLE_BASE/oracle_solaris_studio/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/man:$MANPATH


      -bash-4.1$ which cc
      /export/home/oracle/oracle_solaris_studio/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin/cc


      when I run $make, I got the following error. Do you know what the problem might be? Am I using the correct compiler?
      Thank you very much. I appreciate any help.

      -bash-4.1$ make
      cc -g -DDBNAME=\"dss\" -DSUN -DORACLE -DTPCH -DRNG_TEST -D_FILE_OFFSET_BITS=64 -c build.c
      "build.c", line 35: cannot find include file: <stdio.h>
      "build.c", line 36: cannot find include file: <string.h>
      "build.c", line 38: cannot find include file: <sys/types.h>
      "build.c", line 41: cannot find include file: <unistd.h>
      "/usr/include/iso/math_iso.h", line 13: cannot find include file: <sys/feature_tests.h>
      "/usr/include/iso/math_c99.h", line 12: cannot find include file: <sys/feature_tests.h>
      "/usr/include/floatingpoint.h", line 39: cannot find include file: <stdio_tag.h>
      "/usr/include/floatingpoint.h", line 45: syntax error before or at: FILE
      "/usr/include/floatingpoint.h", line 164: syntax error before or at: FILE
      "dss.h", line 84: cannot find include file: <stdio.h>
      "dss.h", line 85: cannot find include file: <stdlib.h>
      "dss.h", line 210: warning: old-style declaration or incorrect type for: FILE
      "dss.h", line 210: syntax error before or at: *
      "dss.h", line 210: warning: old-style declaration or incorrect type for: tbl_open
      "dss.h", line 471: syntax error before or at: FILE
      "dss.h", line 471: warning: undefined or missing type for: FILE
      "dss.h", line 471: warning: undefined or missing type for: void
      "dss.h", line 471: warning: undefined or missing type for: int
      "dss.h", line 471: warning: undefined or missing type for: int
      "build.c", line 89: warning: implicit function declaration: sprintf
      "build.c", line 115: warning: implicit function declaration: strlen
      "build.c", line 160: undefined symbol: NULL
      "build.c", line 160: warning: improper pointer/integer combination: op "="
      "build.c", line 160: non-constant initializer: op "NAME"
      "build.c", line 172: warning: improper pointer/integer combination: op "=="
      "build.c", line 189: warning: implicit function declaration: strcpy
      "build.c", line 348: warning: implicit function declaration: memcpy
      "build.c", line 368: undefined symbol: NULL
      "build.c", line 368: warning: improper pointer/integer combination: op "="
      "build.c", line 368: non-constant initializer: op "NAME"
      cc: acomp failed for build.c
      *** Error code 2
      make: Fatal error: Command failed for target `build.o'
        • 1. Re: compiling problem when using ansi c compiler on solaris 11
          User171873
          Confirm that the pkg:/system/header package exists on the system (pkg list pkg:/system/header). If not you should install it (pkg install pkg:/system/header). This package contains many of the system header files. Your compiler errors suggest that cc isn't finding these files.
          • 2. Re: compiling problem when using ansi c compiler on solaris 11
            929219
            Thank you very much for your reply.
            system/header is not installed on the server, but when I tried to install it , I got an error that said there was a conflict. How should I solve this?


            -bash-4.1$ sudo pkg install system/header
            Creating Plan /
            pkg install: No matching version of system/header can be installed:
            Reject: pkg://solaris/system/header@0.5.11,5.11-0.175.0.0.0.2.1:20111019T073158Z
            Reason: This version is excluded by installed incorporation pkg://solaris/consolidation/osnet/osnet-incorpn@0.5.11,5.11-0.175.0.4.0.5.1:20120206T225911Z

            -bash-4.1$ sudo pkg install pkg:/system/header
            Creating Plan /
            pkg install: No matching version of system/header can be installed:
            Reject: pkg://solaris/system/header@0.5.11,5.11-0.175.0.0.0.2.1:20111019T073158Z
            Reason: This version is excluded by installed incorporation pkg://solaris/consolidation/osnet/osnet-incorpn@0.5.11,5.11-0.175.0.4.0.5.1:20120206T225911Z