Operating System - HP-UX
1836961 Members
2569 Online
110112 Solutions
New Discussion

Re: compiling problem when using cxperf

 
SOLVED
Go to solution
wangshan_1
Occasional Advisor

compiling problem when using cxperf

hi,
has anyone used the tool "cxperf"? I used it
as in the doc:
"c89 main.c /opt/cxperf/lib/cxperfmon.ia64.a -Wl, -u, __cxperfStubs +DD64"
but failed with message:
"__cxperfStubs": No such file or directory
fatal error
could anyone help?
-Wangshan
You can lose anything but freedom
5 REPLIES 5
Olav Baadsvik
Esteemed Contributor

Re: compiling problem when using cxperf

I have not seen the doc you mention, but
the syntax you have seems to be wrong.

Giving the option -Wl to the compiler says
that you want to pass options to the linker.
In this case -u
According to the man-page for ld -u, xxx
is not the correct syntax.
Try -u xxx
where xxx is the name of the symbol you
want to "undefine"

Olav
Steve Steel
Honored Contributor

Re: compiling problem when using cxperf

Hi

Going on the statement further in the document

In the example above, bsort.c is linked with the MPI library and the
CXperf runtime components. The symbol _cxperfStubs is presented to
the linker as undefined. The symbol, _cxperfStubs, links the CXperf
runtime entry points. The resulting file is bsort.ia64.

Olav appears to be correct

It is certainly worth trying.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
wangshan_1
Occasional Advisor

Re: compiling problem when using cxperf

Thanks, Olav & Steve,
Now the compiling is ok. But the cxperf running still has issues:

# c89 main.c /opt/cxperf/lib/cxperfmon.ia64.a
-u __cxperfStubs +DD64
# cxperf a.out
(CXperf) select all
(CXperf) collect cpu
(CXperf) run
ERROR : 9001 : Exec of a.out process fails, aborting ...
ERROR : 9001 : CXperf RTC::errexit: entry - _synthPid = 23547
exec: Permission denied
(CXperf)

the main.c is very simple:
main(){
printf("hello\n");
}

-Wangshan
You can lose anything but freedom
Steve Steel
Honored Contributor
Solution

Re: compiling problem when using cxperf

Hi
You probably need to be root and are not. You have no execute permission

Look at

export ST_CXPERF_RTC=/opt/cxperf/lbin/rtc.ia64

Can your user access this

Or Try like this

The example below displays a sample wrapper script.
#!/bin/sh
PATH=$PATH:/opt/cxperf/bin
export ST_CXPERF_RTC=/opt/cxperf/lbin/rtc.ia64
export ST_CXPERF_SYNTH=/opt/cxperf/lbin/synth.ia64
/opt/cxperf/bin/cxperf.ia64 ./bsort.ia64 <select routine all
collect cpu wall_clock events
set events EXECUTION_1
set pdf bsort.$$.cxp
run
quit
EOF
In the example above, the MPI application bsort.ia64 is run by
CXperf.
If CXperf is installed at the standard location /opt/cxperf, the
exported shell variables in the example are not necessary.
When possible, use a script file. When using a script file, the CXperf
invocation appears as followed:
/opt/cxperf/bin/cxperf.ia64 ./bsort.ia64 -x cxperf
-ScriptName
The file cxperfScriptName contains the content below:
(CXperf) select routine all
(CXperf) collect cpu wall_clock events
(CXperf) set events EXECUTION_1
(CXperf) set pdf bsort.$$
(CXperf) run
(CXperf) quit


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
wangshan_1
Occasional Advisor

Re: compiling problem when using cxperf

your suggestions are very helpful, thanks, Steve!
I found that in stead of using "cxperf a.out"
, "cxperf ./a.out" will work.
-Wangshan
You can lose anything but freedom