Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Fix python support problems caused by building script errors. #391

Closed
wants to merge 1 commit into from
Closed

Fix python support problems caused by building script errors. #391

wants to merge 1 commit into from

Conversation

yangyanzhan
Copy link
Contributor

When trying to build caffe2 with python provided by homebrew, I find out there are some errors in the building scripts. The "get_python_cmake_flags.py" script is supposed to find out the correct python library and header file locations. However, due to these errors, this script does not function correctly. After building, caffe2 is linked against the default python library provided by Apple which causes a crash when trying to validate whether or not the installation is successful:

python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

The fix is as simple as follows:

  • Add "shell" so that command substitution could work under Makefile.

  • Add blank spaces between -D options so that they are treated as options not makefile targets.

  • Print the "flags" variable without the newline character so that they could be utilized by command substitution correctly.

@Yangqing
Copy link
Contributor

Thanks! cc @bwasti for a look, in the meantime I'll merge the PR.

@facebook-github-bot
Copy link
Contributor

@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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

Successfully merging this pull request may close these issues.

None yet

4 participants