06-17-2010 07:06 PM
I just want to use the profile-based optimization to optimize my programs.
I use the option "+I and +P" of cc like this:
-W b,-a +I +P
But in the link time, it says that:
cc: warning 401: +I/+Oprofile=collect and +P/+Oprofile=use are mutually exclusive, +I/+Oprofile=collect ignored.
Error : Could not open profile database flow.data. Check file permissions. (6375)
So could you some give some advices about this?
Thanks in advance!
Solved! Go to Solution.
06-17-2010 08:27 PM - edited 07-11-2011 08:34 AM
Is this for PA or Integrity?
You must first build by using +Oprofile=collect. Then you run the instrumented executable to collect the data in flow.data. Then you rebuild by using +Oprofile=use.
06-18-2010 04:12 AM - edited 07-11-2011 08:35 AM
>It seems that the +Oprofile=collect and +Oprofile=use is used in IA machine.
Yes and these simplified options were back ported to PA.
Anyway, use one of +I or +P at a time.
And I'm not sure why you are using an internal option -Wb,-a?
06-20-2010 11:14 PM
Because in my project there are some codes writen by assembly language.So i use the
-W d,-a option of cc.
But i have tried use "+I" or "+P" option to do the profile based optimization to the cc command, but it also has some problem about the permisson of flow.date.
06-21-2010 02:19 AM
> permisson of flow.date.
Believe it or not, sometimes showing an
actual command with its actual error message
can be more helpful than a vague description.
Or were you hoping to get help from some
psychic who already knows what "some problem
about the permisson of flow.date" means?
06-21-2010 02:22 AM - edited 07-11-2011 08:35 AM
>there are some codes written by assembly language. So I use the -W d,-a option.
(You had -Wb not -Wd. Also, you shouldn't have a space there.)
>I have tried use +I or +P option to do the profile based optimization to the cc command, but it also has some problem about the permission of flow.data.
You don't try "use +I OR +P option". You first do +I, then run your executable.
What step is failing?
Have you read the documentation?
In order to understand the PBO process, you should try a simple hello world program.
What directory are you in? What is the permission of flow.data?
Have you exported FLOW_DATA to point to your flow.data file?
06-21-2010 06:13 PM
Yeah, I should delete the space between the -W d.
Now "+I" is added to the cc compiler command.
The error is during to create a dynamic library from a static library.
The command is like this:
/usr/bin/ld +vnocompatwarnings -b -z +s -o libcrypto.sl.1 +h libcrypto.sl.1 -Fl libcrypto.a -ldld -lc
The error is like this:
Error at line 0 : File I/O error while reading dyn_lck.o()
dyn_lck.o is packed in the static library libcrypto.a
ar -t libcrypto.a |grep dyn_lck.o
So the error seems so strange to me.
06-21-2010 09:50 PM - edited 07-11-2011 08:36 AM
>Now +I is added to the cc compiler command.
What version of the C compiler are you using?
>The error is during to create a dynamic library from a static library.
(The proper HP-UX terminology is shared and archive libs.)
>ld -b +s -Fl libcrypto.a -ldld -lc
You shouldn't add -lc to shlibs, you should depend on the one on the executable.
You should also be using cc to link, not ld directly. It seems you are missing ld's -I option?
>ucomp: File I/O error while reading dyn_lck.o
Can you extract dyn_lck.o from libcrypto.a?
You may also want to try extracting all of the objects in the archive and then passing the objects directly to ld.
06-22-2010 07:02 AM - edited 07-11-2011 08:37 AM
>Yes I can extract all the ".o" file from the libcrypto.a.
>how can I use all the "*.o" to create a shared libcrypto?
The obvious, create a new directory and extract all of the objects. Then link all objects in that directory:
ar -xv path-to-lib/libcrypto.a
cc -b +I -Wl,+vnocompatwarnings -Wl,+s -o libcrypto.sl.1 -Wl,+h,libcrypto.sl.1 OBJS/*.o -ldld
If you still get an error on dyn_lck.o, try linking ONLY that object. If that gets an error, perhaps that file is corrupt?