albertz / music-player-core

Music player core Python module
BSD 2-Clause "Simplified" License
74 stars 22 forks source link

Can't install inside virtualenv on OS X (boost/noncopyable.hpp not found) #1

Closed max-arnold closed 10 years ago

max-arnold commented 10 years ago
Installing collected packages: musicplayer
  Running setup.py install for musicplayer
    building 'musicplayer' extension
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -UNDEBUG -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Buffer.cpp -o build/temp.macosx-10.9-x86_64-2.7/Buffer.o --std=c++11
    In file included from Buffer.cpp:3:
    ./PyThreading.hpp:7:10: fatal error: 'boost/noncopyable.hpp' file not found
    #include <boost/noncopyable.hpp>
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
    Complete output from command /Users/user/.virtualenvs/testenv/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/testenv/build/musicplayer/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/y4/mx8yb7kd1gl26frnh7014dvm0000gp/T/pip-Kj6VyM-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/testenv/bin/../include/site/python2.7:
    running install

running build

running build_ext

building 'musicplayer' extension

creating build

creating build/temp.macosx-10.9-x86_64-2.7

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -UNDEBUG -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Buffer.cpp -o build/temp.macosx-10.9-x86_64-2.7/Buffer.o --std=c++11

In file included from Buffer.cpp:3:

./PyThreading.hpp:7:10: fatal error: 'boost/noncopyable.hpp' file not found

#include <boost/noncopyable.hpp>

         ^

1 error generated.

error: command '/usr/bin/clang' failed with exit status 1

Boost 1.55.0 was installed via macports:

% port contents boost | grep copyab
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
  /opt/local/include/boost/asio/detail/noncopyable.hpp
  /opt/local/include/boost/noncopyable.hpp
  /opt/local/include/boost/proto/detail/is_noncopyable.hpp
  /opt/local/share/doc/boost/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp
  /opt/local/share/doc/boost/libs/local_function/example/noncopyable_local_function.cpp
albertz commented 10 years ago

It seems as if /opt/local/include is not in your include-path. Try something like this:

export CFLAGS=-I/opt/local/include

I'm not sure what the right approach for this would be...

max-arnold commented 10 years ago

What about something similar to Pillow setup.py approach? https://github.com/python-imaging/Pillow/blob/master/setup.py

albertz commented 10 years ago

I added a few standard paths (including /opt/local). Can you try again?

max-arnold commented 10 years ago

Installed just fine. Thanks, Albert!