mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Changes without protoc conditions (#6142)
This commit is contained in:
parent
80cf134aff
commit
4375dfd0b2
7 changed files with 9 additions and 52 deletions
|
|
@ -26,7 +26,7 @@ set(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO ON)
|
|||
include(CMakeDependentOption)
|
||||
option(BUILD_BINARY "Build C++ binaries" ON)
|
||||
option(BUILD_DOCS "Build documentation" OFF)
|
||||
option(BUILD_CUSTOM_PROTOBUF "Build and use Caffe2's own protobuf under third_party" OFF)
|
||||
option(BUILD_CUSTOM_PROTOBUF "Build and use Caffe2's own protobuf under third_party" ON)
|
||||
option(BUILD_PYTHON "Build Python binaries" ON)
|
||||
option(BUILD_SHARED_LIBS "Build libcaffe2.so" ON)
|
||||
cmake_dependent_option(
|
||||
|
|
|
|||
|
|
@ -104,11 +104,12 @@ if ((NOT TARGET protobuf::libprotobuf) AND (NOT TARGET protobuf::libprotobuf-lit
|
|||
# "Please set the proper paths so that I can find protobuf correctly.")
|
||||
endif()
|
||||
|
||||
# Protobuf generated files use <> as inclusion path, so following normal
|
||||
# convention we will use SYSTEM inclusion path.
|
||||
# Protobuf generated files use <> as inclusion path, so maybe we should use
|
||||
# SYSTEM inclusion path. But we need these include dirs to be found before
|
||||
# other protobuf include dirs in Anaconda
|
||||
get_target_property(__tmp protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
|
||||
message(STATUS "Caffe2 protobuf include directory: " ${__tmp})
|
||||
include_directories(BEFORE SYSTEM ${__tmp})
|
||||
include_directories(BEFORE ${__tmp})
|
||||
|
||||
# If Protobuf_VERSION is known (true in most cases, false if we are building
|
||||
# local protobuf), then we will add a protobuf version check in
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
protobuf:
|
||||
- 3.5.1
|
||||
pin_run_as_build:
|
||||
protobuf:
|
||||
min_pin: x.x
|
||||
max_pin: x.x
|
||||
|
|
@ -24,7 +24,6 @@ requirements:
|
|||
- numpy
|
||||
- opencv
|
||||
- python
|
||||
- protobuf {{ protobuf }}
|
||||
- six
|
||||
# other packages here
|
||||
run:
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
protobuf:
|
||||
- 3.5.1
|
||||
pin_run_as_build:
|
||||
protobuf:
|
||||
min_pin: x.x
|
||||
max_pin: x.x
|
||||
|
|
@ -25,7 +25,6 @@ requirements:
|
|||
- mkl-include
|
||||
- numpy
|
||||
- opencv
|
||||
- protobuf
|
||||
- python
|
||||
- six
|
||||
# other packages here
|
||||
|
|
|
|||
|
|
@ -105,8 +105,10 @@ if [[ $GCC_USE_C11 -eq 0 ]]; then
|
|||
# gcc compatibility is not tracked by conda-forge, so we track it ourselves
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-gcc${GCC_VERSION:0:3}"
|
||||
fi
|
||||
if [[ $BUILD_ENVIRONMENT == *full* ]]; then
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-full"
|
||||
if [[ "$(uname)" != 'Darwin' ]]; then
|
||||
if [[ $BUILD_ENVIRONMENT == *full* ]]; then
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-full"
|
||||
fi
|
||||
fi
|
||||
portable_sed "s/name: caffe2.*\$/name: ${CAFFE2_PACKAGE_NAME}/" "${META_YAML}"
|
||||
|
||||
|
|
@ -147,41 +149,9 @@ if [[ "$(uname)" != 'Darwin' ]]; then
|
|||
add_package 'numpy' '>1.11'
|
||||
fi
|
||||
CONDA_BUILD_ARGS+=(" -c conda-forge")
|
||||
|
||||
else
|
||||
# gflags 2.2.1 is built against the new ABI but gflags 2.2.0 is not
|
||||
add_package 'gflags' '==2.2.1'
|
||||
|
||||
# opencv 3.3.1 requires protobuf 3.2.0 explicitly, so we use opencv 3.1.0
|
||||
# since protobuf 3.2.0 is not in conda
|
||||
add_package 'opencv' '==3.1.0'
|
||||
if [[ "$PYTHON_VERSION" == 3.* ]]; then
|
||||
# opencv 3.1.0 for python 3 requires numpy 1.12
|
||||
add_package 'numpy' '>1.11'
|
||||
fi
|
||||
|
||||
# These calls won't work since
|
||||
# - these package requirements can't be put in meta.yaml (no support yet)
|
||||
# - if they're put here then they won't be installed at test or install
|
||||
# time
|
||||
# glog 0.3.5=0 is built against old ABI, but 0.3.5=hf484d3e_1 is not
|
||||
#remove_package 'glog'
|
||||
#conda install -y 'glog=0.3.5=hf484d3e_1'
|
||||
|
||||
# leveldb=1.20 is built against old ABI, but 1.20=hf484d3e_1 is built
|
||||
# against the new one
|
||||
#remove_package 'leveldb'
|
||||
#conda install -y 'leveldb=1.20=hf484d3e_1'
|
||||
fi
|
||||
else
|
||||
# On macOS opencv 3.3.1 (there's only 3.3.1 and 2.4.8) requires protobuf
|
||||
# 3.4
|
||||
portable_sed "s/3.5.1/3.4.1/" "${CONDA_BUILD_CONFIG_YAML}"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
# Build Caffe2 with conda-build
|
||||
#
|
||||
# If --user and --token are set, then this will also upload the built package
|
||||
|
|
|
|||
Loading…
Reference in a new issue