Menu

Trouble Compiling

Help
Kyle
2013-09-20
2013-09-27
  • Kyle

    Kyle - 2013-09-20

    Greetings,

    I am running into some issues when trying to build ptpd.

    I have downloaded the latest using: svn checkout svn://svn.code.sf.net/p/ptpd/code/trunk ptpd-code. I am trying to build for OS X. Any help would be greatly appreciated. Here is the terminal output from the building process.

    > autoreconf -vi
    utoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal -I m4 autoreconf: configure.ac: tracing autoreconf: configure.ac: creating directory build-aux autoreconf: running: glibtoolize --copy glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,build-aux'.
    glibtoolize: copying file build-aux/ltmain.sh' glibtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'.
    glibtoolize: copying file m4/libtool.m4' glibtoolize: copying filem4/ltoptions.m4'
    glibtoolize: copying file m4/ltsugar.m4' glibtoolize: copying filem4/ltversion.m4'
    glibtoolize: copying file m4/lt~obsolete.m4' autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoheader autoreconf: running: automake --add-missing --copy --no-force configure.ac:29: installing 'build-aux/config.guess' configure.ac:29: installing 'build-aux/config.sub' configure.ac:18: installing 'build-aux/install-sh' configure.ac:18: installing 'build-aux/missing' src/Makefile.am: installing 'build-aux/depcomp' autoreconf: Leaving directory.'

    > ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... build-aux/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 for g++... g++
    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 g++ accepts -g... yes
    checking for style of include used by make... GNU
    checking dependency style of g++... gcc3
    checking for gawk... (cached) awk
    checking for gcc... gcc
    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 dependency style of gcc... gcc3
    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/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.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/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.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 ar... ar
    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/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.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 how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /Applications/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/ld) is GNU ld... no
    checking whether the g++ linker (/Applications/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fno-common -DPIC
    checking if g++ PIC flag -fno-common -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/Applications/Innsbruck/Xcode.app/Contents/Developer/Toolchains/OSX10.9.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 for net-snmp-config... /usr/bin/net-snmp-config
    checking if we want to try building SNMP support... yes
    checking net-snmp/net-snmp-config.h usability... yes
    checking net-snmp/net-snmp-config.h presence... yes
    checking for net-snmp/net-snmp-config.h... yes
    checking if we are building SNMP support... yes
    checking for pow in -lm... yes
    checking for clock_gettime in -lrt... no
    checking for pcap_inject in -lpcap... yes
    checking for ANSI C header files... (cached) yes
    checking arpa/inet.h usability... yes
    checking arpa/inet.h presence... yes
    checking for arpa/inet.h... yes
    checking fcntl.h usability... yes
    checking fcntl.h presence... yes
    checking for fcntl.h... yes
    checking limits.h usability... yes
    checking limits.h presence... yes
    checking for limits.h... yes
    checking netdb.h usability... yes
    checking netdb.h presence... yes
    checking for netdb.h... yes
    checking netinet/in.h usability... yes
    checking netinet/in.h presence... yes
    checking for netinet/in.h... yes
    checking netinet/ether.h usability... no
    checking netinet/ether.h presence... no
    checking for netinet/ether.h... no
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking sys/ioctl.h usability... yes
    checking sys/ioctl.h presence... yes
    checking for sys/ioctl.h... yes
    checking sys/param.h usability... yes
    checking sys/param.h presence... yes
    checking for sys/param.h... yes
    checking sys/socket.h usability... yes
    checking sys/socket.h presence... yes
    checking for sys/socket.h... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking syslog.h usability... yes
    checking syslog.h presence... yes
    checking for syslog.h... yes
    checking for unistd.h... (cached) yes
    checking glob.h usability... yes
    checking glob.h presence... yes
    checking for glob.h... yes
    checking sched.h usability... yes
    checking sched.h presence... yes
    checking for sched.h... yes
    checking utmp.h usability... yes
    checking utmp.h presence... yes
    checking for utmp.h... yes
    checking utmpx.h usability... yes
    checking utmpx.h presence... yes
    checking for utmpx.h... yes
    checking pcap/pcap.h usability... yes
    checking pcap/pcap.h presence... yes
    checking for pcap/pcap.h... yes
    checking pcap.h usability... yes
    checking pcap.h presence... yes
    checking for pcap.h... yes
    checking for an ANSI C-conforming const... yes
    checking for stdbool.h that conforms to C99... yes
    checking for _Bool... yes
    checking for int64_t... yes
    checking for size_t... yes
    checking for ssize_t... yes
    checking whether time.h and sys/time.h may both be included... yes
    checking for uint32_t... yes
    checking for uint64_t... yes
    checking for uint8_t... yes
    checking for working volatile... yes
    checking for struct timex.tick... no
    checking whether gcc needs -traditional... no
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking for working memcmp... yes
    checking sys/select.h usability... yes
    checking sys/select.h presence... yes
    checking for sys/select.h... yes
    checking for sys/socket.h... (cached) yes
    checking types of arguments for select... int,fd_set ,struct timeval
    checking return type of signal handlers... void
    checking for strftime... yes
    checking for vprintf... yes
    checking for _doprnt... no
    checking for clock_gettime... no
    checking for dup2... yes
    checking for ftruncate... yes
    checking for gettimeofday... yes
    checking for inet_ntoa... yes
    checking for memset... yes
    checking for pow... yes
    checking for select... yes
    checking for socket... yes
    checking for strchr... yes
    checking for strdup... yes
    checking for strerror... yes
    checking for strtol... yes
    checking for glob... yes
    checking for pututline... no
    checking for utmpxname... yes
    checking for updwtmpx... no
    checking for RUNTIME_DEBUG... no
    checking for ftruncate... yes
    checking for gettimeofday... yes
    checking for inet_ntoa... yes
    checking for memset... yes
    checking for pow... yes
    checking for select... yes
    checking for socket... yes
    checking for strchr... yes
    checking for strdup... yes
    checking for strerror... yes
    checking for strtol... yes
    checking for glob... yes
    checking for pututline... no
    checking for utmpxname... yes
    checking for updwtmpx... no
    checking for RUNTIME_DEBUG... no
    checking for (old-style) debug message level... no
    checking for daemon mode... yes
    checking for experimental options... no
    checking for realtime statistics support... no
    checking ntpd control / failover support... no
    checking for integer-based PI servo support... no
    checking for SIGUSR2 support... no
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating src/Makefile
    config.status: creating src/ptpd2.8
    config.status: creating src/ptpd2.conf.5
    config.status: creating src/ptpd2.conf.8
    config.status: creating config.h
    config.status: executing depfiles commands
    config.status: executing libtool commands

    > cd src
    > make
    gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -DBUILD=140.1 -DMACOSX_DEPLOYMENT_TARGET=10.9 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin13 -Ddarwin13=darwin13 -I/usr/local/include -DPTPD_SNMP -g -Os -pipe -g -O2 -MT arith.o -MD -MP -MF .deps/arith.Tpo -c -o arith.o arith.c
    mv -f .deps/arith.Tpo .deps/arith.Po
    gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -DBUILD=140.1 -DMACOSX_DEPLOYMENT_TARGET=10.9 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin13 -Ddarwin13=darwin13 -I/usr/local/include -DPTPD_SNMP -g -Os -pipe -g -O2 -MT bmc.o -MD -MP -MF .deps/bmc.Tpo -c -o bmc.o bmc.c
    mv -f .deps/bmc.Tpo .deps/bmc.Po
    gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -DBUILD=140.1 -DMACOSX_DEPLOYMENT_TARGET=10.9 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin13 -Ddarwin13=darwin13 -I/usr/local/include -DPTPD_SNMP -g -Os -pipe -g -O2 -MT msg.o -MD -MP -MF .deps/msg.Tpo -c -o msg.o test -f 'dep/msg.c' || echo './'dep/msg.c
    mv -f .deps/msg.Tpo .deps/msg.Po
    gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -DBUILD=140.1 -DMACOSX_DEPLOYMENT_TARGET=10.9 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin13 -Ddarwin13=darwin13 -I/usr/local/include -DPTPD_SNMP -g -Os -pipe -g -O2 -MT net.o -MD -MP -MF .deps/net.Tpo -c -o net.o test -f 'dep/net.c' || echo './'dep/net.c
    mv -f .deps/net.Tpo .deps/net.Po
    gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -DBUILD=140.1 -DMACOSX_DEPLOYMENT_TARGET=10.9 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin13 -Ddarwin13=darwin13 -I/usr/local/include -DPTPD_SNMP -g -Os -pipe -g -O2 -MT servo.o -MD -MP -MF .deps/servo.Tpo -c -o servo.o test -f 'dep/servo.c' || echo './'dep/servo.c
    dep/servo.c:502:3: warning: implicit declaration of function 'restoreDrift' is invalid in C99 [-Wimplicit-function-declaration]
    restoreDrift(ptpClock, rtOpts, TRUE);
    ^
    dep/servo.c:993:1: error: conflicting types for 'runPIservo'
    runPIservo(PIservo servo, const Integer32 input)
    ^
    ./dep/ptpd_dep.h:453:8: note: previous declaration is here
    double runPIservo(PIservo
    servo, const Integer32 input);
    ^
    1 warning and 1 error generated.
    make: *** [servo.o] Error 1

     
  • Wojciech Owczarek

    Kyle,

    We're already aware of this issue, thanks - a fix is underway.

    Regards
    Wojciech

     
    • Kyle

      Kyle - 2013-09-22

      Thanks for the prompt reply Wojciech!

      I am really interested in doing some timing measurements using ptpd using 2 OS X machines, so ptpd would be a great starting point. Out of curiosity, is there a ptpd version that would meet these needs in a more immediate fashion?

      Thanks,

      Kyle

       
    • Kyle

      Kyle - 2013-09-22

      (edit: double post)

       

      Last edit: Kyle 2013-09-22
  • Wojciech Owczarek

    Kyle,

    I have just committed a potential fix - give it a go; I would recommend current svn and then the next release when it's out.

    Regards
    Wojciech

     
  • Jan Breuer

    Jan Breuer - 2013-09-25

    There is something wrong in the compilation process on OSX and we should investigate it later.

    • Function runPIservo should never be used on OSX.
    • Why it tries to compile integer PI servo on line 993 while there is not defined PTPD_INTEGER_SERVO?

    I thing that this patch will not work.

    /* No support for double precision servo for Apple */
    
    #ifdef __APPLE__
    #ifndef PTPD_INTEGER_SERVO
    #define PTPD_INTEGER_SERVO
    #endif /* PTPD_INTEGER_SERVO */
    #endif /* APPLE */
    

    because this should be placed before any ptpd header file.
    It should be placed to dep/constants_dep.h where lies all other platform specific defines.

    Regards,
    Jan

     
  • Jan Breuer

    Jan Breuer - 2013-09-25

    Sorry for my last comment, I havent updated to latest SVN.

    I thing that removing that part should be better fix, because runPIservo is never used on APPLE platform. There is no need to redefine PTPD_INTEGER_SERVO.

    Regards,
    Jan

     
  • Wojciech Owczarek

    Jan,

    I will need to look into the code later, but runpiservo needs to be run on every OS because runpiservo will become a servo API call that will be the only way to execute a servo step.

    Anyhow, this should be OK for the release.

    Cheers
    Woj

     
  • Jan Breuer

    Jan Breuer - 2013-09-25

    Woj,

    you are right, this is the feature.

    But now, servo code is not used on platforms using coarse adjustment method (OSX). So, is there some reason for restricting something that is not used and defining PTPD_INTEGER_SERVO on APPLE?

    Coarse method - use adjTime - OSX
    Fine method - use adjFreq - Linux, FreeBSD

    Regards,
    Jan

     
  • Wojciech Owczarek

    We can think about a longer term solution after the release. Right now Harlan confirmed it builds on Apple.

     
  • Kyle

    Kyle - 2013-09-27

    Building fine on my machine!

    Thanks for your assistance and the code fixes.

    Best,
    Kyle

     

Log in to post a comment.