alonho / pytrace

pytrace is a fast python tracer. it records function calls, arguments and return values. can be used for debugging and profiling.
Other
447 stars 21 forks source link

Doesn't compile (OSX 10.8 x64, Ubuntu 12.04 x64) #2

Closed nickpresta closed 12 years ago

nickpresta commented 12 years ago
$ brew install protobuf-c
==> Installing protobuf-c dependency: protobuf
==> Downloading http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/protobuf/2.4.1 --with-zlib
==> make
==> make install
==> Caveats
Editor support and examples have been installed to:
  /usr/local/Cellar/protobuf/2.4.1/share/doc/protobuf/protobuf
==> Summary
/usr/local/Cellar/protobuf/2.4.1: 62 files, 5.7M, built in 27 seconds
==> Installing protobuf-c
==> Downloading http://protobuf-c.googlecode.com/files/protobuf-c-0.15.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/protobuf-c/0.15
==> make install
/usr/local/Cellar/protobuf-c/0.15: 11 files, 372K, built in 11 seconds
$ sudo pip install ptrace
Password:
Downloading/unpacking ptrace
  Downloading ptrace-1.0.1.tar.gz
  Running setup.py egg_info for package ptrace
Installing collected packages: ptrace
  Running setup.py install for ptrace
    clang: warning: argument unused during compilation: '-mno-fused-madd'
    In file included from ptracemodule.c:35:
    /usr/include/sys/ptrace.h:94:38: error: unknown type name 'caddr_t'
    int     ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
                                             ^
    ptracemodule.c:63:19: error: use of undeclared identifier 'PTRACE_TRACEME'
      result = ptrace(PTRACE_TRACEME, 0, 0, 0);
                      ^
    ptracemodule.c:98:15: error: use of undeclared identifier 'PTRACE_PEEKTEXT'
      return peek(PTRACE_PEEKTEXT, self, args);
                  ^
    ptracemodule.c:108:15: error: use of undeclared identifier 'PTRACE_PEEKDATA'
      return peek(PTRACE_PEEKDATA, self, args);
                  ^
    ptracemodule.c:118:15: error: use of undeclared identifier 'PTRACE_PEEKUSER'
      return peek(PTRACE_PEEKUSER, self, args);
                  ^
    ptracemodule.c:149:15: error: use of undeclared identifier 'PTRACE_POKETEXT'
      return poke(PTRACE_POKETEXT, self, args);
                  ^
    ptracemodule.c:159:15: error: use of undeclared identifier 'PTRACE_POKEDATA'
      return poke(PTRACE_POKEDATA, self, args);
                  ^
    ptracemodule.c:169:15: error: use of undeclared identifier 'PTRACE_POKEUSER'
      return poke(PTRACE_POKEUSER, self, args);
                  ^
    ptracemodule.c:199:18: error: use of undeclared identifier 'PTRACE_CONT'
      return proceed(PTRACE_CONT, self, args);
                     ^
    ptracemodule.c:209:18: error: use of undeclared identifier 'PTRACE_SYSCALL'
      return proceed(PTRACE_SYSCALL, self, args);
                     ^
    ptracemodule.c:219:18: error: use of undeclared identifier 'PTRACE_SINGLESTEP'
      return proceed(PTRACE_SINGLESTEP, self, args);
                     ^
    ptracemodule.c:229:18: error: use of undeclared identifier 'PTRACE_DETACH'
      return proceed(PTRACE_DETACH, self, args);
                     ^
    ptracemodule.c:258:16: error: use of undeclared identifier 'PTRACE_KILL'
      return thump(PTRACE_KILL, self, args);
                   ^
    ptracemodule.c:268:16: error: use of undeclared identifier 'PTRACE_ATTACH'
      return thump(PTRACE_ATTACH, self, args);
                   ^
    14 errors generated.
    building 'ptrace' extension
    clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ptracemodule.c -o build/temp.macosx-10.8-intel-2.7/ptracemodule.o -Wall
    Traceback (most recent call last):
      File "", line 1, in 
      File "/Users/nickp/build/ptrace/setup.py", line 7, in 
        paver.tasks.main()
      File "paver-minilib.zip/paver/tasks.py", line 621, in main
      File "paver-minilib.zip/paver/tasks.py", line 604, in _launch_pavement
      File "paver-minilib.zip/paver/tasks.py", line 569, in _process_commands
      File "paver-minilib.zip/paver/setuputils.py", line 146, in __call__
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/install.py", line 56, in run
        return _install.run(self)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 573, in run
        self.run_command('build')
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/build_ext.py", line 46, in run
        _build_ext.run(self)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 449, in build_extensions
        self.build_extension(ext)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/build_ext.py", line 175, in build_extension
        _build_ext.build_extension(self,ext)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 499, in build_extension
        depends=ext.depends)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.py", line 624, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.py", line 180, in _compile
        raise CompileError, msg
    distutils.errors.CompileError: command 'clang' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/nickp/build/ptrace/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-sMczn2-record/install-record.txt:
    clang: warning: argument unused during compilation: '-mno-fused-madd'

In file included from ptracemodule.c:35:

/usr/include/sys/ptrace.h:94:38: error: unknown type name 'caddr_t'

int     ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);

                                         ^

ptracemodule.c:63:19: error: use of undeclared identifier 'PTRACE_TRACEME'

  result = ptrace(PTRACE_TRACEME, 0, 0, 0);

                  ^

ptracemodule.c:98:15: error: use of undeclared identifier 'PTRACE_PEEKTEXT'

  return peek(PTRACE_PEEKTEXT, self, args);

              ^

ptracemodule.c:108:15: error: use of undeclared identifier 'PTRACE_PEEKDATA'

  return peek(PTRACE_PEEKDATA, self, args);

              ^

ptracemodule.c:118:15: error: use of undeclared identifier 'PTRACE_PEEKUSER'

  return peek(PTRACE_PEEKUSER, self, args);

              ^

ptracemodule.c:149:15: error: use of undeclared identifier 'PTRACE_POKETEXT'

  return poke(PTRACE_POKETEXT, self, args);

              ^

ptracemodule.c:159:15: error: use of undeclared identifier 'PTRACE_POKEDATA'

  return poke(PTRACE_POKEDATA, self, args);

              ^

ptracemodule.c:169:15: error: use of undeclared identifier 'PTRACE_POKEUSER'

  return poke(PTRACE_POKEUSER, self, args);

              ^

ptracemodule.c:199:18: error: use of undeclared identifier 'PTRACE_CONT'

  return proceed(PTRACE_CONT, self, args);

                 ^

ptracemodule.c:209:18: error: use of undeclared identifier 'PTRACE_SYSCALL'

  return proceed(PTRACE_SYSCALL, self, args);

                 ^

ptracemodule.c:219:18: error: use of undeclared identifier 'PTRACE_SINGLESTEP'

  return proceed(PTRACE_SINGLESTEP, self, args);

                 ^

ptracemodule.c:229:18: error: use of undeclared identifier 'PTRACE_DETACH'

  return proceed(PTRACE_DETACH, self, args);

                 ^

ptracemodule.c:258:16: error: use of undeclared identifier 'PTRACE_KILL'

  return thump(PTRACE_KILL, self, args);

               ^

ptracemodule.c:268:16: error: use of undeclared identifier 'PTRACE_ATTACH'

  return thump(PTRACE_ATTACH, self, args);

               ^

14 errors generated.

running install

running build

running build_ext

building 'ptrace' extension

creating build

creating build/temp.macosx-10.8-intel-2.7

clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ptracemodule.c -o build/temp.macosx-10.8-intel-2.7/ptracemodule.o -Wall

Traceback (most recent call last):

  File "", line 1, in 

  File "/Users/nickp/build/ptrace/setup.py", line 7, in 

    paver.tasks.main()

  File "paver-minilib.zip/paver/tasks.py", line 621, in main

  File "paver-minilib.zip/paver/tasks.py", line 604, in _launch_pavement

  File "paver-minilib.zip/paver/tasks.py", line 569, in _process_commands

  File "paver-minilib.zip/paver/setuputils.py", line 146, in __call__

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/install.py", line 56, in run

    return _install.run(self)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 573, in run

    self.run_command('build')

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run

    self.run_command(cmd_name)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/build_ext.py", line 46, in run

    _build_ext.run(self)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 340, in run

    self.build_extensions()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 449, in build_extensions

    self.build_extension(ext)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/build_ext.py", line 175, in build_extension

    _build_ext.build_extension(self,ext)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 499, in build_extension

    depends=ext.depends)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.py", line 624, in compile

    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.py", line 180, in _compile

    raise CompileError, msg

distutils.errors.CompileError: command 'clang' failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/nickp/build/ptrace/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-sMczn2-record/install-record.txt failed with error code 1 in /Users/nickp/build/ptrace
Storing complete log in /Users/nickp/Library/Logs/pip.log
$ clang --version
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.0.0
Thread model: posix
smilliken commented 12 years ago

Also doesn't compile on Ubuntu 12.04 x64.

$ easy_install pytrace
Searching for pytrace
Reading http://pypi.python.org/simple/pytrace/
Reading https://github.com/alonho/pytrace
Best match: pytrace 0.1.5
Downloading http://pypi.python.org/packages/source/p/pytrace/pytrace-0.1.5.tar.gz#md5=c248a19866af16314a55d9a7a6fc385a
Processing pytrace-0.1.5.tar.gz
Running pytrace-0.1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ybhMs8/pytrace-0.1.5/egg-dist-tmp-pwYUP0
In file included from /usr/include/python2.7/Python.h:8:0,
                 from ext/trace.c:2:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
In file included from ext/serial.h:4:0,
                 from ext/trace.c:4:
ext/record_pb.h:6:42: fatal error: google/protobuf-c/protobuf-c.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
$ pip install pytrace

[...snip...]

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Iext -I/opt/local/include -I/usr/include/python2.7 -c ext/trace.c -o build/temp.linux-x86_64-2.7/ext/trace.o -O0

In file included from /usr/include/python2.7/Python.h:8:0,

                 from ext/trace.c:2:

/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]

/usr/include/features.h:215:0: note: this is the location of the previous definition

In file included from ext/serial.h:4:0,

                 from ext/trace.c:4:

ext/record_pb.h:6:42: fatal error: google/protobuf-c/protobuf-c.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1
nickpresta commented 12 years ago

@smilliken Did you run sudo apt-get install libsqlite3-dev libprotobuf-c0-dev?

alonho commented 12 years ago

@NickPresta you pip installed ptrace and not pytrace