Skip to content

Conversation

@anderspapitto
Copy link
Contributor

@anderspapitto anderspapitto commented Aug 14, 2018

delete build_caffe2.sh, replace with build_libtorch.py as suggested by peter (and copy-pasted from his draft PR). This ensures that all consumers of the torch CMake file go through as unified a path as possible.

In order to change the surrounding infrastructure as little as possible, I made some tweaks to enable build_pytorch_libs.sh to generate the test binaries relative to the current directory, rather than hardcoding to pytorch/build.

@anderspapitto anderspapitto force-pushed the cleanup-build branch 10 times, most recently from 5f5eb70 to d0bdaef Compare August 15, 2018 20:22
@anderspapitto anderspapitto changed the title [WIP/do not review] tmp Delete build_caffe2.sh, replace with build_libtorch.py Aug 15, 2018
as suggested by peter (and copy-pasted from his draft PR).  This
ensures that all consumers of the torch CMake file go through as
unified a path as possible.

In order to change the surrounding infrastructure as little as
possible, I made some tweaks to enable build_pytorch_libs.sh to
generate the test binaries relative to the current directory, rather
than hardcoding to pytorch/build.
@anderspapitto
Copy link
Contributor Author

@ezyang @goldsborough this is ready for your attention

Copy link
Contributor

@goldsborough goldsborough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

my_env["BUILD_TORCH"] = "ON"

if subprocess.call(build_libs_cmd + libs, env=my_env) != 0:
try:

This comment was marked as off-topic.

This comment was marked as off-topic.

build_libs_cmd = ['tools\\build_pytorch_libs.bat']
else:
build_libs_cmd = ['bash', 'tools/build_pytorch_libs.sh']
build_libs_cmd = ['bash', os.path.join('..', 'tools', 'build_pytorch_libs.sh')]

This comment was marked as off-topic.

This comment was marked as off-topic.

WERROR=1 VERBOSE=1 tools/cpp_build/build_caffe2.sh "$CPP_BUILD"
mkdir -p $CPP_BUILD/caffe2

BUILD_LIBTORCH_PY=$PWD/tools/build_libtorch.py

This comment was marked as off-topic.

This comment was marked as off-topic.

except OSError:
pass

kwargs = {'cwd': 'build'} if not IS_WINDOWS else {}

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like deleting files.

@anderspapitto
Copy link
Contributor Author

see also #10562 to track some related future improvements

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anderspapitto is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

WERROR=1 VERBOSE=1 tools/cpp_build/build_caffe2.sh "$PWD/../cpp-build"
BUILD_LIBTORCH_PY=$PWD/tools/build_libtorch.py
mkdir -p ../cpp-build/caffe2
pushd ../cpp-build/caffe2

This comment was marked as off-topic.

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants