Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

HP-UX - can't open /tmp/docBAAa27184

When compiling with both the -O and -g flags using HP's cc compiler you may see an error similar to the following:

    + cc -O -g -t p,/tools/nmake/hppa10/lu3.3/lib/cpp -I-D/tools/nmake/hppa1
    0/lu3.3/lib/probe/C/pp/B3A01E21.bincc -I- -D_TRACE_ -c hello.c
    cc: error 2151: Can't open "/tmp/docBAAa27184".
    make: *** exit code 1 making hello.o

The HP-UX cc compiler has some proprietary, nonstandard support for using both the -O and -g flags at the same time. As part of this support the compiler expects a temporary file to be created by the preprocessor. Since this is not a standard operation the nmake preprocessor does not know about it and does not create the expected temporary file, which causes this error from the compiler.

Recommendation

Since nmake cpp cannot support this feature we recommend using only one of the -O or -g flags or neither flag, but not both at the same time. This will eliminate the error.

The default Makerules initializes CCFLAGS=-O. If you set CCFLAGS+=-g you are will have this problem since += will add -g to the existing CCFLAGS. To use the -g flag set CCFLAGS=-g (not +=) to replace the default -O with your desired flag.

Work-around

It is possible to use this feature of the HP compiler with nmake for cases where both flags are really needed, for example to debug problems with the optimizer. There are two basic options.

  1. The first option is to build without nmake cpp by setting nativepp=1 in the makefile or on the nmake command line. Keep in mind that without nmake cpp you may not properly pick up include files in the viewpath. See the cpp faq for details.
  2. The second option is to force nmake to use ppcc. ppcc calls nmake cpp separately from the compiler to preprocess the code, then it passes the preprocessed code to the compiler. The compiler will do its work without really knowing the code was already preprocessed. Please note we have not extensively tested ppcc with the HP compiler so we suggest using doing this only when necessary. The use of ppcc is determined by variables set in the probe files. You may reset these variables in your local makefile to force ppcc to be used with the HP compiler. For example:
    .PROBEINIT : .myPROBE
    
    .myPROBE : .AFTER .MAKE
    	CC.ALTPP.FLAGS =
    	CC.DIALECT := $(CC.DIALECT:N!=DOTI)
    
    CCFLAGS = -O -g
    
    hello :: hello.c
    
    $ nmake
    + ppcc /tools/nmake/hppa10/lu3.2/lib/cpp cc -O -g -I-D/tools/nmake/hppa1
    0/lu3.2/lib/probe/C/pp/B3A01E21.bincc -I- -D_TRACE_ -c hello.c
    + ppcc /tools/nmake/hppa10/lu3.2/lib/cpp cc -O -g -o hello hello.o
    
    Rather than resetting these variables in the makefile you can also use the localprobe feature to create a local probe file which can be edited as necessary without impacting other users.
    1. to generate the local probe file run: nmake localprobe=vpath
    2. edit <vpath_root>/lib/probe/C/make/<probe_filename>
    3. change CC.ALTPP.FLAGS and CC.DIALECT to be set as shown above.
    4. to use the local probe file run: nmake localprobe=vpath
Last Update: Friday,12-Aug-2016 10:45:39 EDT