oaken-source / graprof

a profiling and trace analysis tool - see the website for downloads and additional information
http://graprof.grapentin.org
GNU General Public License v3.0
13 stars 1 forks source link

Fails to compile on OSX 10.9 #13

Open ellmo opened 10 years ago

ellmo commented 10 years ago

ellmo@ellmo~/Downloads/graprof-0.7$ ./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/Users/ellmo/Downloads/graprof-0.7/scripts/missing: Unknown '--is-lightweight' option
Try '/Users/ellmo/Downloads/graprof-0.7/scripts/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... scripts/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -ll
checking whether yytext is a pointer... yes
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin13.0.0 file names to x86_64-apple-darwin13.0.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin13.0.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin13.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libgraprof/Makefile
config.status: creating graprof/Makefile
config.status: creating docs/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

ellmo@ellmo~/Downloads/graprof-0.7$ make

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in libgraprof
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT libgraprof.lo -MD -MP -MF .deps/libgraprof.Tpo -c -o libgraprof.lo libgraprof.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT libgraprof.lo -MD -MP -MF .deps/libgraprof.Tpo -c libgraprof.c  -fno-common -DPIC -o .libs/libgraprof.o
libgraprof.c:84:9: warning: 'MD5_Init' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
        MD5_Init(&c);
        ^
/usr/include/openssl/md5.h:113:5: note: 'MD5_Init' declared here
int MD5_Init(MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
libgraprof.c:90:11: warning: 'MD5_Update' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
          MD5_Update(&c, buf, n);
          ^
/usr/include/openssl/md5.h:114:5: note: 'MD5_Update' declared here
int MD5_Update(MD5_CTX *c, const void *data, size_t len) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
libgraprof.c:91:9: warning: 'MD5_Final' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
        MD5_Final(md5, &c);
        ^
/usr/include/openssl/md5.h:115:5: note: 'MD5_Final' declared here
int MD5_Final(unsigned char *md, MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
3 warnings generated.
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT libgraprof.lo -MD -MP -MF .deps/libgraprof.Tpo -c libgraprof.c -o libgraprof.o >/dev/null 2>&1
mv -f .deps/libgraprof.Tpo .deps/libgraprof.Plo
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT instrument.lo -MD -MP -MF .deps/instrument.Tpo -c -o instrument.lo instrument.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT instrument.lo -MD -MP -MF .deps/instrument.Tpo -c instrument.c  -fno-common -DPIC -o .libs/instrument.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT instrument.lo -MD -MP -MF .deps/instrument.Tpo -c instrument.c -o instrument.o >/dev/null 2>&1
mv -f .deps/instrument.Tpo .deps/instrument.Plo
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT mallhooks.lo -MD -MP -MF .deps/mallhooks.Tpo -c -o mallhooks.lo mallhooks.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT mallhooks.lo -MD -MP -MF .deps/mallhooks.Tpo -c mallhooks.c  -fno-common -DPIC -o .libs/mallhooks.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT mallhooks.lo -MD -MP -MF .deps/mallhooks.Tpo -c mallhooks.c -o mallhooks.o >/dev/null 2>&1
mv -f .deps/mallhooks.Tpo .deps/mallhooks.Plo
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT highrestimer.lo -MD -MP -MF .deps/highrestimer.Tpo -c -o highrestimer.lo highrestimer.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT highrestimer.lo -MD -MP -MF .deps/highrestimer.Tpo -c highrestimer.c  -fno-common -DPIC -o .libs/highrestimer.o
highrestimer.c:36:13: warning: implicit declaration of function 'clock_gettime' is invalid in C99
      [-Wimplicit-function-declaration]
  int res = clock_gettime(HIGHRESTIMER_CLOCK, &highrestimer_ts);
            ^
highrestimer.c:36:27: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
  int res = clock_gettime(HIGHRESTIMER_CLOCK, &highrestimer_ts);
                          ^
highrestimer.c:30:28: note: expanded from macro 'HIGHRESTIMER_CLOCK'
#define HIGHRESTIMER_CLOCK CLOCK_MONOTONIC_RAW
                           ^
highrestimer.c:49:17: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
  clock_gettime(HIGHRESTIMER_CLOCK, &tmp_ts);
                ^
highrestimer.c:30:28: note: expanded from macro 'HIGHRESTIMER_CLOCK'
#define HIGHRESTIMER_CLOCK CLOCK_MONOTONIC_RAW
                           ^
1 warning and 2 errors generated.
make[2]: *** [highrestimer.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
oaken-source commented 10 years ago

Hey, thanks for reporting this! It seems that Mac OSX does not include the clock_gettime function, as specified by POSIX.1-2001.

I will look into this, but I can't promise that I will get it working anytime soon, especially since I don't have a Mac. What I can do though, is implementing something that may work in a dedicated branch, but then I would need your help with the testing. Would you do that?

Thanks, Andy

ellmo commented 10 years ago

Since Valgrind doesn't work on OSX 10.8 and 10.9 I'm quite interested in getting an alternate C profiler (and trust me, a lot of OSX owners are too) so I'd like to help. I just have to clarify I'm no low-level programmer (I just started learning C from http://c.learncodethehardway.org/book/), so I may not be able to give you all the feedback you require.

To sum up: I'll be watching for a OSX dedicated branch and will report back to you with results.

oaken-source commented 10 years ago

Hi again, I hope I made some progress in this matter. Could you check out branch OSX-compatibility, and run

./autogen.sh ./configure CFLAGS="-Wall -Wextra" make

and pastebin the resulting output to me?

Thanks, Andy