Problem about PCH

I’ve tried to use PCH feature of pgCC, and get trouble:

luoyi@wslab$ pgCC -c --create_pch cppall.Ppch cppall.cc
“cppall.cc”: creating precompiled header file “cppall.Ppch”
luoyi@wslab$ pgCC --use_pch cppall.Ppch main.cc
Command-line error: invalid option: --use_dir <<---- why I use ‘–use_pch’ and pgCC complain about ‘–use_dir’?

1 catastrophic error detected in this compilation.
Compilation terminated.
luoyi@wslab$ ls -1sh
total 16M
15M cppall.Ppch
4.0K cppall.cc
4.0K cppall.h
4.0K cppall.o
976K main*
4.0K main.cc
4.0K pch_demo.sh*

Hi luoyi,

Looks like there is a typo in the PGI configuration file “cpprc” located in your installation’s bin directory.

switch --use_pch$dir is
        help(Use precompiled headers from directory)
        helpgroup(language)
        append(CPP1ARGS=--use_dir $dir);  <-- should be --use_pch not --use_dir

I have created a technical problem report (TPR#4010) and we should be able get this corrected in the next release. Please feel free to update your local copy of cpprc with this correction. Thank you for pointing this out!

-Mat

where is the ‘–create_pch’ help msg ?

luoyi@skyking:~/icc$ pgCC --version

pgCC 7.0-2 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
luoyi@skyking:~/icc$ pgCC -flags |grep pch
Reading rcfile /home/luoyi/pgi/linux86/7.0-2/bin/.pgcpprc
–pch Do automatic precompiled header processing
–pch_dir Set precompiled header directory
–pch_mem Specify memory to be used for PCH processing
–[no_]pch_messages Enable PCH messages
–use_pch Use precompiled headers from directory
-M[no]depchk Check dependence relations for vector or parallel code
luoyi@skyking:~/icc$

I can see it in 6.x release

Hi luoyi,

Nothing has changed in regards to this help message between 6.x and 7.0.

%pgCC -V

pgCC 6.1-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
% pgCC -help --create_pch
Reading rcfile /usr/pgi/linux86-64/6.1-5/bin/.pgCCrc
–create_pch Create precompiled header file in directory
% pgCC -flags | grep pch
Reading rcfile /usr/pgi/linux86-64/6.1-5/bin/.pgCCrc
–pch Do automatic precompiled header processing
–pch_dir Set precompiled header directory
–pch_mem Specify memory to be used for PCH processing
–[no_]pch_messages Enable PCH messages
–use_pch Use precompiled headers from directory
-M[no]depchk Check dependence relations for vector or parallel code

% pgCC -V

pgCC 7.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
% pgCC -help --create_pch
Reading rcfile /usr/pgi/linux86-64/7.0-2/bin/.pgcpprc
–create_pch Create precompiled header file in directory
% pgCC -flags | grep pch
Reading rcfile /usr/pgi/linux86-64/7.0-2/bin/.pgcpprc
–pch Do automatic precompiled header processing
–pch_dir Set precompiled header directory
–pch_mem Specify memory to be used for PCH processing
–[no_]pch_messages Enable PCH messages
–use_pch Use precompiled headers from directory
-M[no]depchk Check dependence relations for vector or parallel code

  • Mat

maybe you should add a help entry about --create_pch in the output of pgCC --help