Skip to content

Commit

Permalink
Changes without protoc conditions (#6142)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjh5 authored and ezyang committed Apr 3, 2018
1 parent 80cf134 commit 4375dfd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 4 additions & 3 deletions cmake/ProtoBuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions conda/caffe2/cuda/conda_build_config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion conda/caffe2/cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ requirements:
- numpy
- opencv
- python
- protobuf {{ protobuf }}
- six
# other packages here
run:
Expand Down
6 changes: 0 additions & 6 deletions conda/caffe2/no_cuda/conda_build_config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion conda/caffe2/no_cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ requirements:
- mkl-include
- numpy
- opencv
- protobuf
- python
- six
# other packages here
Expand Down
38 changes: 4 additions & 34 deletions scripts/build_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4375dfd

Please sign in to comment.