You need to add a -L<LIBPROFILERPATH> and most likely a  -Wl,--rpath -Wl,
<LIBPROFILERPATH>  arguments to the g++ invocation (replace
<LIBRPROFILERPATH> with the path)

To debug, just copy & paste the post compiler flag and try adding it.  Once
you have it working, you can also do it via -cxx-postarg command line
option to x10c++ to avoid having to manually invoke g++

--dave




From:   Konstantina Panagiotopoulou <kwno...@hotmail.com>
To:     Mailing list for users of the X10 programming language
            <x10-users@lists.sourceforge.net>,
Date:   10/28/2013 04:09 PM
Subject:        Re: [X10-users] Performance analysis tool



Hello Dave and all,

I tried what you suggested.. but..
I am using both mpi for the x10rt and the gpt library

My command line looks like this:

bin/x10c++ -x10rt mpi PATH_TO_SOURCE -o EXECUTABLE  -O -gpt

And this is the error I get.

x10c++: /usr/bin/ld: cannot find -lprofiler
     collect2: ld returned 1 exit status
x10c++: Non-zero return code: 1

I am guessing it could be because I have installed gperftools with prefix
and not in the default  location(due to limited permissions). From the
compiler's man page I cannot find something to specify the path to gperf
tools.

Finally this is the output from the postcompiler..I cannot really say there
is something wrong..but maybe you could have a look. The -lprofiler flag is
there though(???)

Executing post-compiler mpicxx
-I/home/kp167/Desktop/x10new/x10.dist/include
-I/home/kp167/Desktop/x10new/x10.dist/stdlib/include
-I/home/kp167/Desktop/x10new/x10.dist
 -I. -O2 -finline-functions -DNO_TRACING -Wno-long-long
-Wno-unused-parameter
-g -DHOMOGENEOUS -DX10_USE_BDWGC -pthread
-o /home/kp167/Desktop/x10new/x10.dist/gen GenBlock.cc UniverseC.cc Body.cc
myRandom.cc xxx_main_xxx.cc
 -L/home/kp167/Desktop/x10new/x10.dist/stdlib/lib -lx10 -lgc -lm -lpthread
-lrt -ldl
-L/home/kp167/Desktop/x10new/x10.dist/lib -lx10rt_mpi -lprofiler
-Wl,--rpath -Wl,/home/kp167/Desktop/x10new/x10.dist/stdlib/lib -Wl,--rpath
-Wl,/home/kp167/Desktop/x10new/x10.dist/lib -Wl,-export-dynamic

Regards,
Konstantina




2013/10/25 David P Grove <gro...@us.ibm.com>
  Konstantina Panagiotopoulou <kwno...@hotmail.com> wrote on 10/25/2013
  11:37:46 AM:




  >
  > Thank you both for your help. So I started with gperftools as David
  suggested.
  > But I'm having some problems since the manual refers to gcc mainly.
  >
  > So in my program I am compiling with :
  >
  > bin/x10c++ -gpt  -o myexecutable myprogram.x10
  >
  > But any pother gperf flag is not permitted. Say, I need the CPU
  > profiling. Then I need to link with -lprofiler.
  > How can I specify further options after the gpt flag?


  Hi,

  when you invoke x10c++ with -gpt, it automatically adds the -lprofiler
  argument to the g++ command it generates under the covers.  If
  libprofiler.so is in a standard place (eg /usr/lib) then there is nothing
  else to do.

  If you have gperf tools installed somewhere else, then you will need to
  fiddle with the g++ command.  The easiest way to experiment with this is
  to get x10c++ to print the g++ command it is using, and then manually
  adjust that until you get something that works.

  [dgrove@linchen myTests]$ x10c++ -gpt -report postcompile=5
  HelloWorld.x10
   Output files: {HelloWorld=[HelloWorld.h, HelloWorld.cc]}
  Executing post-compiler g++ -I/home/dgrove/x10-trunk/x10.dist/include
  -I/home/dgrove/x10-trunk/x10.dist/stdlib/include
  -I/home/dgrove/x10-trunk/myTests -I. -Wno-long-long -Wno-unused-parameter
  -g -DHOMOGENEOUS -DX10_USE_BDWGC -Wl,--no-as-needed -pthread
  HelloWorld.cc xxx_main_xxx.cc
  -L/home/dgrove/x10-trunk/x10.dist/stdlib/lib -lx10 -lgc -lm -lpthread
  -lrt -ldl -L/home/dgrove/x10-trunk/x10.dist/lib -lx10rt_sockets
  -Wl,--no-as-needed -lprofiler -Wl,--as-needed -Wl,--rpath
  -Wl,/home/dgrove/x10-trunk/x10.dist/stdlib/lib -Wl,--rpath
  -Wl,/home/dgrove/x10-trunk/x10.dist/lib -Wl,-export-dynamic


  --dave

  ------------------------------------------------------------------------------

  October Webinars: Code for Performance
  Free Intel webinars can help you accelerate application performance.
  Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
  from
  the latest Intel processors and coprocessors. See abstracts and register
  >
  http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk

  _______________________________________________
  X10-users mailing list
  X10-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/x10-users

------------------------------------------------------------------------------

Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

<<inline: graycol.gif>>

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to