Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
1344d1b
Fix Draw Net Problem #1709
jsupancic Feb 12, 2015
02c99fb
Fix `draw` to support new protobuf format
tnarihi Feb 17, 2015
a12e30c
Merge pull request #1884 from tnarihi/fix-python-draw
shelhamer Feb 17, 2015
82551ad
reshape DATA + IMAGE_DATA for inputs of varying dimension
shelhamer Oct 17, 2014
d3b2010
test reshaping DATA and IMAGE_DATA
shelhamer Feb 6, 2015
0b30aab
Merge pull request #1313 from shelhamer/reshape-data-layer
shelhamer Feb 17, 2015
32bf5c7
ignore qtcreator files
Dec 20, 2014
9358247
improve CMake build
Dec 17, 2014
a12dcba
opencv 3.0 compilation (replace #1714)
Jan 18, 2015
c0ae656
[travis] proper cmake params
Jan 18, 2015
aea5dd6
cmake 2.8.7. support
Feb 1, 2015
c5a6a8c
Merge pull request #1667 from Nerei/feature/cmake_well_done
shelhamer Feb 17, 2015
4ba3dfb
[docs] note new CMake build
shelhamer Feb 17, 2015
2f5af3f
Merge pull request #1878 from philkr/encoded
shelhamer Feb 17, 2015
79bc864
[docs] README dispatch
shelhamer Feb 17, 2015
87b6335
dynamic linking
shelhamer Feb 7, 2015
e4b7ceb
only dynamically link the tests
shelhamer Feb 7, 2015
3c629b1
[docs] include caffeine favicon for site
shelhamer Sep 20, 2014
eb764bb
[docs] Caffe is by the BVLC, created by Yangqing, and brewed by Evan
shelhamer Feb 17, 2015
4e69bc9
[docs] groom index and zoo for highlights
shelhamer Feb 17, 2015
3ff0ddf
Merge pull request #1842 from shelhamer/dynamic-linking
shelhamer Feb 17, 2015
d6df2e0
[pycaffe] enable numpy API deprecation warnings
longjon Jan 6, 2015
c2fe27b
[pycaffe] strike down wrappers, momentarily gut all functionality
longjon Jan 5, 2015
798a65b
[pycaffe] expose global ("Caffe::") functions
longjon Jan 8, 2015
74a584c
[pycaffe] re-expose Net
longjon Jan 6, 2015
8a510f7
[pycaffe] re-expose Blob
longjon Jan 6, 2015
2660977
[pycaffe] re-expose Layer
longjon Jan 6, 2015
86646f7
[pycaffe] re-expose SGDSolver, and expose other solvers
longjon Jan 6, 2015
965df8f
LayerRegistry uses shared_ptr instead of raw pointers
longjon Feb 17, 2015
d94f107
[pycaffe] allow Layer to be extended from Python
longjon Jan 8, 2015
da044c9
[pytest] test that get_solver runs
longjon Jan 7, 2015
3c94d96
[pytest] basic test of Python layer
longjon Jan 8, 2015
55e5aa2
add WITH_PYTHON_LAYER build option to include Python layer
longjon Jan 10, 2015
590d396
except PythonLayer from layer factory test
shelhamer Feb 14, 2015
0396f9f
[travis] enable Python layer for testing
longjon Jan 10, 2015
9b38744
switch to V2 proto definitions for pytest
shelhamer Feb 10, 2015
9c44810
[docs] update and split installation
shelhamer Feb 17, 2015
ca29af0
[docs] explain one true branch and dev workflow
shelhamer Feb 17, 2015
91289b3
[make] link libcaffe.so before dependencies
longjon Feb 17, 2015
dfbc2dc
Merge pull request #1887 from shelhamer/docs
shelhamer Feb 17, 2015
5e64f5a
Merge pull request #1703 from longjon/pyreformation
shelhamer Feb 17, 2015
6eb0931
give phase to Net and Layer
shelhamer Jan 23, 2015
02be9d7
pass phase to transformer through layer
shelhamer Jan 23, 2015
ab0cc51
no phase for the solver to orchestrate
shelhamer Jan 23, 2015
6def482
construct Net from file and phase
shelhamer Jan 24, 2015
fe8fe5f
tools make net with phase
shelhamer Jan 24, 2015
d2934ae
[pycaffe] give phase to Net
shelhamer Jan 26, 2015
bb8b5d6
[matcaffe] give phase to Net
shelhamer Jan 26, 2015
0254c14
Merge pull request #1790 from shelhamer/net-phase
shelhamer Feb 17, 2015
d9825e4
[pycaffe] fix bug in Python layer setup
longjon Feb 17, 2015
3077191
comment fix: Decaf -> Caffe
longjon Feb 18, 2015
d1238e1
Changing CMAKE_SOURCE/BINARY_DIR to PROJECT_SOURCE/BINARY_DIR
philkr Feb 18, 2015
cb6b09b
[pycaffe] import newline cleanup
shelhamer Feb 19, 2015
74f171b
[pycaffe] take pre-processing from Net and give to Transformer
shelhamer Feb 19, 2015
26c16bf
[pycaffe] switch examples to Transformer
shelhamer Feb 19, 2015
c66847b
Merge pull request #1902 from shelhamer/py-stopgap
shelhamer Feb 19, 2015
650b944
Merge pull request #1899 from philkr/project_source_dir
shelhamer Feb 19, 2015
a1c160b
relax MemoryData transform check to warning
shelhamer Feb 19, 2015
a724e58
Merge pull request #1907 from shelhamer/memory-warn-transform
shelhamer Feb 19, 2015
6f4bdd8
Revert "Merge pull request #1878 from philkr/encoded"
shelhamer Feb 19, 2015
06ceaf4
[docs] add gitter chat badge
shelhamer Feb 20, 2015
ccd8374
Repeal revert of #1878
shelhamer Feb 20, 2015
9114424
Merge pull request #1910 from philkr/encoded
shelhamer Feb 20, 2015
5c81243
[build] fix rpath for examples
shelhamer Feb 20, 2015
2d155ab
[docs] send API link to class list
shelhamer Jan 29, 2015
7867ead
[docs] add check mode hint to CPU-only mode error
shelhamer Jan 29, 2015
5d15ed7
Brief explanation of SLICE layer's attributes
boechat107 Jan 30, 2015
079e416
Correct 'epochs' to 'iterations'
bamos Feb 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
# IPython notebook checkpoints
.ipynb_checkpoints

# CMake generated files
*.gen.cmake

# Editor temporaries
*.swp
*~
Expand All @@ -44,6 +41,9 @@
*.*project
.settings

# QtCreator files
*.user

# OSX dir files
.DS_Store

Expand Down Expand Up @@ -71,6 +71,8 @@ distribute/*
*.testbin
*.bin
python/caffe/proto/
cmake_build
.cmake_build

# Generated documentation
docs/_site
Expand Down
214 changes: 51 additions & 163 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,177 +1,65 @@
cmake_minimum_required(VERSION 2.8.8)
project( Caffe )

### Build Options ##########################################################################

option(CPU_ONLY "Build Caffe without GPU support" OFF)
option(BUILD_PYTHON "Build Python wrapper" OFF)
option(BUILD_MATLAB "Build Matlab wrapper" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_SHARED_LIBS "Build SHARED libs if ON and STATIC otherwise" OFF)

if(NOT BLAS)
set(BLAS atlas)
cmake_minimum_required(VERSION 2.8.7)

# ---[ Caffe project
project(Caffe C CXX)

# ---[ Using cmake scripts and modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)

include(cmake/Utils.cmake)
include(cmake/Targets.cmake)
include(cmake/Misc.cmake)
include(cmake/Summary.cmake)
include(cmake/ConfigGen.cmake)

# ---[ Options
caffe_option(CPU_ONLY "Build Caffe wihtout CUDA support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF NOT CPU_ONLY)
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
caffe_option(BUILD_python "Build Python wrapper" ON)
caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)

# ---[ Dependencies
include(cmake/Dependencies.cmake)

# ---[ Flags
if(UNIX OR APLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")
endif()

if(NOT CUDA_TEST_DEVICE)
set(CUDA_TEST_DEVICE -1)
if(USE_libstdcpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
message("-- Warning: forcing libstdc++ (controlled by USE_libstdcpp option in cmake)")
endif()

# Install Prefix
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install path" FORCE )
endif()

### Configuration ###########################################################################
# Compiler Flags
set(CMAKE_CXX_COMPILER_FLAGS ${CMAKE_CXX_COMPILER_FLAGS} -Wall)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fPIC) # set global flags
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # set debug flags
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) # set release flags

# Link Flags
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # clang++
set(CAFFE_STATIC_LINK -Wl,-force_load $(STATIC_NAME))
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # g++
set(CAFFE_STATIC_LINK -Wl,--whole-archive caffe -Wl,--no-whole-archive)
endif()

# Global Definitions
if(CPU_ONLY)
add_definitions(-DCPU_ONLY)
endif()

# Include Directories
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include)
include_directories(${${PROJECT_NAME}_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/src)

# CMake Scripts dir
set(CMAKE_SCRIPT_DIR ${CMAKE_SOURCE_DIR}/CMakeScripts)

# CMake module path for custom module finding
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SCRIPT_DIR})

### Dependencies ##########################################################################

# Boost
find_package(Boost 1.46 COMPONENTS system thread REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

# CUDA
if(NOT CPU_ONLY)
find_package(CUDA 5.5 REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
-gencode arch=compute_20,code=sm_20
-gencode arch=compute_20,code=sm_21
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
)

# https://github.com/ComputationalRadiationPhysics/picongpu/blob/master/src/picongpu/CMakeLists.txt
# work-arounds
if(Boost_VERSION EQUAL 105500)
# see https://svn.boost.org/trac/boost/ticket/9392
message(STATUS "Boost: Applying noinline work around")
# avoid warning for CMake >= 2.8.12
set(CUDA_NVCC_FLAGS
"${CUDA_NVCC_FLAGS} \"-DBOOST_NOINLINE=__attribute__((noinline))\" ")
endif(Boost_VERSION EQUAL 105500)
endif()

# Threads
find_package(Threads REQUIRED)

# Google-glog
find_package(Glog REQUIRED)
include_directories(${GLOG_INCLUDE_DIRS})

# Google-gflags
find_package(GFlags REQUIRED)
include_directories(${GFLAGS_INCLUDE_DIRS})
add_definitions(-DGTEST_USE_OWN_TR1_TUPLE)

# BLAS
if(BLAS STREQUAL "atlas")
# ---[ Warnings
caffe_warnings_disable(CMAKE_CXX_FLAGS -Wno-sign-compare -Wno-uninitialized)

find_package(Atlas REQUIRED)
include_directories(${Atlas_INCLUDE_DIR})
set(BLAS_LIBRARIES ${Atlas_LIBRARIES})
# ---[ Config generation
configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_config.h")

elseif(BLAS STREQUAL "open")

find_package(OpenBLAS REQUIRED)
include_directories(${OpenBLAS_INCLUDE_DIR})
set(BLAS_LIBRARIES ${OpenBLAS_LIB})

elseif(BLAS STREQUAL "mkl")

find_package(MKL REQUIRED)
include_directories(${MKL_INCLUDE_DIR})
set(BLAS_LIBRARIES ${MKL_LIBRARIES})

endif()

# HDF5
find_package(HDF5 COMPONENTS HL REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS})

# LevelDB
find_package(LevelDB REQUIRED)
include_directories(${LEVELDB_INCLUDE})
if(LEVELDB_FOUND)
find_package(Snappy REQUIRED)
include_directories(${SNAPPY_INCLUDE_DIR})
set(LEVELDB_LIBS
${LEVELDB_LIBS}
${SNAPPY_LIBS}
)
endif()

# LMDB
find_package(LMDB REQUIRED)
include_directories(${LMDB_INCLUDE_DIR})

# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

### Subdirectories ##########################################################################
# ---[ Includes
set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
include_directories(${Caffe_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
include_directories(BEFORE src) # This is needed for gtest.

# ---[ Subdirectories
add_subdirectory(src/gtest)
add_subdirectory(src/caffe)
add_subdirectory(tools)
add_subdirectory(examples)
add_subdirectory(python)
add_subdirectory(matlab)
add_subdirectory(docs)

if(BUILD_EXAMPLES)
message(STATUS "Examples enabled")
add_subdirectory(examples)
endif()

if(BUILD_PYTHON)
message(STATUS "Python enabled")
add_subdirectory(python)
endif()

if(BUILD_MATLAB)
message(STATUS "Matlab enabled")
add_subdirectory(matlab)
endif()

### Lint Target Setup ##########################################################################

set(LINT_TARGET lint)
set(LINT_SCRIPT ${CMAKE_SCRIPT_DIR}/lint.cmake)
add_custom_target(
${LINT_TARGET}
COMMAND ${CMAKE_COMMAND} -P ${LINT_SCRIPT}
)

### Install #################################################################################

# Install Includes
file(GLOB folders ${${PROJECT_NAME}_INCLUDE_DIRS}/*)
install(DIRECTORY ${folders} DESTINATION include)
# ---[ Linter target
add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)

# ---[ Configuration summary
caffe_print_configuration_summary()

# ---[ Export configs generation
caffe_generate_export_configs()
28 changes: 0 additions & 28 deletions CMakeScripts/FindLMDB.cmake

This file was deleted.

37 changes: 0 additions & 37 deletions CMakeScripts/FindLevelDB.cmake

This file was deleted.

Loading