Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

problem of pofile based optimization

SOLVED
Go to Solution
Frequent Advisor

problem of pofile based optimization

Dear All,

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.
ucomp :
Error : Could not open profile database flow.data. Check file permissions. (6375)

So could you some give some advices about this?

Thanks in advance!

Kevin
11 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: problem of profile based optimization

[ Edited ]

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.

Frequent Advisor

Re: problem of pofile based optimization

Hi,

My machine is PA 11.31 OS.

It seems that the +Oprofile=collect and +Oprofile=use is used in IA machine.

Thanks!
Acclaimed Contributor Acclaimed Contributor

Re: problem of profile based optimization

[ Edited ]

>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?

Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

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.

Thanks!

Honored Contributor Honored Contributor

Re: problem of pofile based optimization

> but it also has some problem about the
> 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?
Acclaimed Contributor Acclaimed Contributor

Re: problem of profile based optimization

[ Edited ]

>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?
http://docs.hp.com/en/7763/5991-4871/summ_opt.html#RN.CVT.NN418
http://docs.hp.com/en/14672/Help/options.htm#opt+capsI

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?

Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

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:
ucomp :
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
dyn_lck.o

So the error seems so strange to me.

Acclaimed Contributor Acclaimed Contributor

Re: problem of profile based optimization

[ Edited ]

>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.

Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

Yes i can extract all the ".o" file from
the libcrypto.a.

how can i use all the "*.o" to create a
dynamic libcrypto?

Thanks!
Acclaimed Contributor Acclaimed Contributor

Re: problem of profile based optimization

[ Edited ]

>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:
mkdir OBJS
cd OBJS
ar -xv path-to-lib/libcrypto.a
cd -
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?

Highlighted
Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

thank you for your help.
I will try your methods