C flags and headers in a C library

2007-05-01 Thread Joseph Wakeling
Hello, I'm a novice user of the GNU autotools trying to create the appropriate configuration for a small simulation library I'm writing, called Minga. >From web tutorials, and examining configure.ac and Makefile.am files in other free software projects, I've been able to put together something th

Re: C flags and headers in a C library

2007-05-03 Thread Joseph Wakeling
Noah Misch wrote: > Add a line like this to Makefile.am: > > AM_CFLAGS = $(MINGA_CFLAGS) > > or simply: > > AM_CFLAGS = -ansi -pedantic -Wall > > Note that it's usually unwise to add such flags unconditionally; many > compilers > do not support them. Thanks very much. I hadn't thought ab

Profiling a library built with libtool

2007-07-13 Thread Joseph Wakeling
I have a small library which is built using the GNU autotools. It also includes some executable programs which use the main library. I would like to profile the performance using gprof or another tool but have been having trouble working out how to do so. I tried simply adding -p to the CFLAGS b

Re: Profiling a library built with libtool

2007-07-13 Thread Joseph Wakeling
Benoit SIGOURE wrote: > The .la file is a piece of shell script that contains information useful > to libtool. > > Now the answer to your question is to ask libtool to run gprof (or gdb) > for you: > ./libtool --mode=execute gprof ./foo Ah! That explains much. Thank you. I still get results tha

Re: Profiling a library built with libtool

2007-07-13 Thread Joseph Wakeling
Bob Friesenhahn wrote: > It is important to know that profiling is based on both adding special > code to functions during compilation (influenced by CFLAGS), and use of > a special startup-module for linking. That means you should add -pg to > LDFLAGS as well. Profiling will be easiest to deal w

Re: Profiling a library built with libtool

2007-07-13 Thread Joseph Wakeling
Bob Friesenhahn wrote: > The profiling support might not be thread safe. While it may seem > counter-productive to program tuning, it is usually recommended to use > limited optimization, or no optimization at all. I have an option for my program to use no threads and the same results were produc

Re: Profiling a library built with libtool

2007-07-13 Thread Joseph Wakeling
Benoit SIGOURE wrote: > Hmm you are right, I didn't notice during my test that I also had zeros. > Build a static version of your project and it'll work. > > ./configure --disable-shared > make clean all CFLAGS='-pg -all-static' Ahh, brilliant! Thank you ever so much. The -all-static option gen