Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying include_dirs on OSX? #3

Open
recursify opened this issue Mar 6, 2013 · 2 comments
Open

Specifying include_dirs on OSX? #3

recursify opened this issue Mar 6, 2013 · 2 comments

Comments

@recursify
Copy link

I had to make the following change to setup.py in order to build/install imposm.parser on OSX.

    ext_modules=[
        Extension("imposm.parser.pbf.OSMPBF",
            ["imposm/parser/pbf/osm.cc", "imposm/parser/pbf/osm.pb.cc"], libraries=['protobuf'],
                  include_dirs=['/usr/local/include'] # Add include_dirs
        ),
    ],

Is there a way to explicitly tell imposm.parser where to look for the protobuf headers?

I first tried running python setup.py config -I/usr/local/include but that didn't seem to work.

My knowledge of setuptools is minimal, so I'm sorry if this is just a lack of understanding on my part.

@pelson
Copy link

pelson commented Mar 7, 2013

I believe setuptools only allows you to pass through the library and include path when you issue the build_ext command. Normally, you would do:

python setup.py build_ext -L<lib path> -I<include path>
python setup.py build

And all would be rosy. Unfortunately, because of the custom build command, I believe the C++ files being written by protoc mean that every time a setup.py build is done, the build_ext command is also run. This is contrary to standard distutils which can avoid the build_ext step in some situations (if it's already run, for example).

I believe to be genuinely customisable with a build path, the build_ext command will need to look at whether the generated files are out of date or not.

HTH

@soobrosa
Copy link

I second in on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants