Re: problem of pofile based optimization (295 Views)
Reply
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 1 of 12 (295 Views)
Accepted Solution

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
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,879
Registered: ‎03-06-2006
Message 2 of 12 (295 Views)

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.

Please use plain text.
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 3 of 12 (295 Views)

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!
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,879
Registered: ‎03-06-2006
Message 4 of 12 (295 Views)

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?

Please use plain text.
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 5 of 12 (295 Views)

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!

Please use plain text.
Honored Contributor
Steven Schweda
Posts: 9,079
Registered: ‎02-23-2005
Message 6 of 12 (295 Views)

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?
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,879
Registered: ‎03-06-2006
Message 7 of 12 (295 Views)

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?

Please use plain text.
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 8 of 12 (295 Views)

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.

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,879
Registered: ‎03-06-2006
Message 9 of 12 (295 Views)

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.

Please use plain text.
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 10 of 12 (295 Views)

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!
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,879
Registered: ‎03-06-2006
Message 11 of 12 (295 Views)

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?

Please use plain text.
Frequent Advisor
yangk
Posts: 76
Registered: ‎01-12-2009
Message 12 of 12 (295 Views)

Re: problem of pofile based optimization

Hi Dennis,

thank you for your help.
I will try your methods
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation