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

Supply Python vars to CMake automatically #412

Merged
merged 1 commit into from
Oct 11, 2014

Conversation

Rouslan
Copy link

@Rouslan Rouslan commented Oct 11, 2014

I have both Python 2.7 and 3.3 on my system. When I tried building this project to use in Python, it ended up linking with version 3 of the Python, despite having run setup.py from Python 2 (and despite it linking with the Python 2 Boost library).

It should use the same version of Python that setup.py was run with.

@suntzu86
Copy link
Contributor

automation++
Thanks @Rouslan! I should've done that from the start.

for posterity:
cmake gives precedence to the last "-D" option when there are repeats, e.g.,

cmake -D OPT1=0 -D OPT1=1 -D OPT1=2 ...

sets OPT1 to 2 (as long as no further instances of OPT1). In particular, if the user sets either of the MOE_PYTHON_* vars manually, the automatic choice will be overridden.

I'll push another short branch updating our docs/install instructions.

@suntzu86
Copy link
Contributor

Note: as long as you're in a virtualenv with the appropriate version of Python, this will work seamlessly.

suntzu86 added a commit that referenced this pull request Oct 11, 2014
Supply Python vars to CMake automatically
@suntzu86 suntzu86 merged commit 26ae969 into Yelp:master Oct 11, 2014
@Rouslan Rouslan deleted the get_python_vars_from_interpreter branch October 11, 2014 18:08
@Rouslan
Copy link
Author

Rouslan commented Oct 11, 2014

You're welcome.

I actually did run the setup from within virtualenv. It doesn't prevent CMake from finding a different version of Python.

@suntzu86
Copy link
Contributor

Sorry, I meant your change makes it work correctly now. Definitely broken
before. Reminder to myself to make that clear in the docs.

I've had cmake fail to find the wrong version too. I just set those vars
manually, so this is a welcome fix :)
On Oct 11, 2014 11:12 AM, "Rouslan Korneychuk" notifications@github.com
wrote:

You're welcome.

I actually did run the setup from within virtualenv. It doesn't prevent
CMake from finding a different version of Python.


Reply to this email directly or view it on GitHub
#412 (comment).

@Rouslan
Copy link
Author

Rouslan commented Oct 11, 2014

Ah, I see.

@sc932
Copy link
Contributor

sc932 commented Oct 12, 2014

Thanks @Rouslan!

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

Successfully merging this pull request may close these issues.

3 participants