Skip to content

Commit

Permalink
add Travis, fix regression issue caused by jolibrain#276
Browse files Browse the repository at this point in the history
  • Loading branch information
jsaksris committed Jun 28, 2017
1 parent 2e9da19 commit 277bd83
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 64 deletions.
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: cpp
compiler: gcc
sudo: required
dist: trusty

before_install:
# - sudo apt-mark hold postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6
# - sudo apt-get update && sudo apt-get upgrade -y
- sudo apt-get install build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev libopencv-dev libcppnetlib-dev libboost-dev libboost-iostreams-dev libcurlpp-dev libcurl4-openssl-dev protobuf-compiler libopenblas-dev libhdf5-dev libprotobuf-dev libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev
- pip install pyyaml

install:
- mkdir build
- cd build
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
- cmake -DBUILD_TESTS=ON ..
- make

before_script:
-
script:
-
notifications:
email:
on_success: always
on_failure: always
125 changes: 62 additions & 63 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ configure_file(
# dependency on Eigen for confusion matrix fast computation
if (USE_TF)
else()
find_package(Eigen3 REQUIRED)
include_directories("${EIGEN3_INCLUDE_DIR}")
include_directories("${EIGEN3_INCLUDE_DIR}")
find_package(PkgConfig)
pkg_search_module(Eigen3 REQUIRED eigen3)
endif()

set(eigen_archive_hash "50812b426b7c")

#include_directories("$ENV{HOME}/include")

set(EIGEN3_INCLUDE_DIR ${CMAKE_BINARY_DIR}/tensorflow/src/tensorflow/dbuild/external/eigen_archive/eigen-eigen-${eigen_archive_hash} ${CMAKE_BINARY_DIR}/tensorflow/src/tensorflow/dbuild/external/eigen_archive)
set(EIGEN3_INCLUDE_DIR ${CMAKE_BINARY_DIR}/tensorflow/src/tensorflow/dbuild/external/eigen_archive/eigen-eigen-${eigen_archive_hash} ${CMAKE_BINARY_DIR}/tensorflow/src/tensorflow/dbuild/external/eigen_archive /usr/include/eigen3)
include_directories("${EIGEN3_INCLUDE_DIR}")

# dependency on Boost
Expand Down Expand Up @@ -122,78 +121,78 @@ else()
if (CUDA_ARCH)
else()
if (NOT ${CUDA_VERSION} MATCHES "8.0")
set(CUDA_ARCH "-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52")
set(CUDA_ARCH "-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52")
else()
set(CUDA_ARCH "-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61")
set(CUDA_ARCH "-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61")
endif()
endif()
if (HAVE_CUDNN AND USE_CUDNN)
if (USE_TF)
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.gpu.cudnn Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # USE_TF
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.gpu.cudnn Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.gpu.cudnn Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # !USE_TF
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.gpu.cudnn Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
endif()
else() # HAVE_CUDNN
else() # !HAVE_CUDNN
if (USE_TF)
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.gpu Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # USE_TF
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.gpu Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && make CUDA_ARCH=${CUDA_ARCH} -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.gpu Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # !USE_TF && !HAVE_CUDNN
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.gpu Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
endif()
endif() # HAVE_CUDNN
else() # CUDA_FOUND
else() #!CUDA_FOUND
add_definitions(-DUSE_CAFFE_CPU_ONLY)
if (USE_TF)
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.cpu Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # USE_TF
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.cpu Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && ${CMAKE_COMMAND} -E env PATH=${CMAKE_BINARY_DIR}/protobuf/bin:$ENV{PATH} make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
else() # !USE_TF
ExternalProject_Add(
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
URL https://github.com/beniz/caffe/archive/master.tar.gz
CONFIGURE_COMMAND ln -sf Makefile.config.cpu Makefile.config && echo "OPENCV_VERSION:=${OPENCV_VERSION}" >> Makefile.config && make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
caffe_dd
PREFIX caffe_dd
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND wget https://github.com/beniz/caffe/archive/master.tar.gz && tar xfz master.tar.gz --strip-components=1 -C caffe_dd
CONFIGURE_COMMAND ln -sf Makefile.config.cpu Makefile.config && echo -e "OPENCV_VERSION:=${OPENCV_VERSION}\\nINCLUDE_DIRS += /usr/include:${INCLUDE_DIRS}" >> Makefile.config && make -j${N}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
endif()
endif()
if (CUDA_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function(deepdetect_select_nvcc_arch_flags out_variable)
endfunction()

################################################################################################
# Short command for cuda comnpilation
# Short command for cuda compilation
# Usage:
# deepdetect_cuda_compile(<objlist_variable> <cuda_files>)
macro(deepdetect_cuda_compile objlist_variable)
Expand Down

0 comments on commit 277bd83

Please sign in to comment.