Skip to content

Commit 809b36e

Browse files
committed
First Commit
1 parent 70751f5 commit 809b36e

File tree

646 files changed

+138217
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

646 files changed

+138217
-53
lines changed

.Doxyfile

+2,335
Large diffs are not rendered by default.

.gitattributes

+60-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,63 @@
1-
# Auto detect text files and perform LF normalization
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
24
* text=auto
35

4-
# Custom for Visual Studio
5-
*.cs diff=csharp
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
614

7-
# Standard to msysgit
8-
*.doc diff=astextplain
9-
*.DOC diff=astextplain
10-
*.docx diff=astextplain
11-
*.DOCX diff=astextplain
12-
*.dot diff=astextplain
13-
*.DOT diff=astextplain
14-
*.pdf diff=astextplain
15-
*.PDF diff=astextplain
16-
*.rtf diff=astextplain
17-
*.RTF diff=astextplain
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

+95-39
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,103 @@
1-
# Windows image file caches
2-
Thumbs.db
3-
ehthumbs.db
1+
## General
42

5-
# Folder config file
6-
Desktop.ini
3+
# Compiled Object files
4+
*.slo
5+
*.lo
6+
*.o
7+
*.cuo
78

8-
# Recycle Bin used on file shares
9-
$RECYCLE.BIN/
9+
# Compiled Dynamic libraries
10+
*.so
11+
*.dylib
1012

11-
# Windows Installer files
12-
*.cab
13-
*.msi
14-
*.msm
15-
*.msp
13+
# Compiled Static libraries
14+
*.lai
15+
*.la
16+
*.a
1617

17-
# Windows shortcuts
18-
*.lnk
18+
# Compiled protocol buffers
19+
*.pb.h
20+
*.pb.cc
21+
*_pb2.py
1922

20-
# =========================
21-
# Operating System Files
22-
# =========================
23+
# Compiled python
24+
*.pyc
2325

24-
# OSX
25-
# =========================
26+
# Compiled MATLAB
27+
*.mex*
2628

29+
# IPython notebook checkpoints
30+
.ipynb_checkpoints
31+
32+
# Editor temporaries
33+
*.swp
34+
*~
35+
36+
# Sublime Text settings
37+
*.sublime-workspace
38+
*.sublime-project
39+
40+
# Eclipse Project settings
41+
*.*project
42+
.settings
43+
44+
# QtCreator files
45+
*.user
46+
47+
# PyCharm files
48+
.idea
49+
50+
# OSX dir files
2751
.DS_Store
28-
.AppleDouble
29-
.LSOverride
30-
31-
# Thumbnails
32-
._*
33-
34-
# Files that might appear in the root of a volume
35-
.DocumentRevisions-V100
36-
.fseventsd
37-
.Spotlight-V100
38-
.TemporaryItems
39-
.Trashes
40-
.VolumeIcon.icns
41-
42-
# Directories potentially created on remote AFP share
43-
.AppleDB
44-
.AppleDesktop
45-
Network Trash Folder
46-
Temporary Items
47-
.apdisk
52+
53+
## Caffe
54+
55+
# User's build configuration
56+
Makefile.config
57+
58+
# Data and models are either
59+
# 1. reference, and not casually committed
60+
# 2. custom, and live on their own unless they're deliberated contributed
61+
data/*
62+
models/*
63+
*.caffemodel
64+
*.caffemodel.h5
65+
*.solverstate
66+
*.solverstate.h5
67+
*.binaryproto
68+
*leveldb
69+
*lmdb
70+
71+
# build, distribute, and bins (+ python proto bindings)
72+
build
73+
.build_debug/*
74+
.build_release/*
75+
distribute/*
76+
*.testbin
77+
*.bin
78+
python/caffe/proto/
79+
cmake_build
80+
.cmake_build
81+
82+
# Generated documentation
83+
docs/_site
84+
docs/gathered
85+
_site
86+
doxygen
87+
docs/dev
88+
89+
# LevelDB files
90+
*.sst
91+
*.ldb
92+
LOCK
93+
LOG*
94+
CURRENT
95+
MANIFEST-*
96+
97+
#Visual Studio files
98+
*.user
99+
*.suo
100+
*.sdf
101+
*.opensdf
102+
*.pdb
103+
#*.props

.travis.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Use a build matrix to do two builds in parallel:
2+
# one using CMake, and one using make.
3+
env:
4+
matrix:
5+
- WITH_CUDA=false WITH_CMAKE=false WITH_IO=true
6+
- WITH_CUDA=false WITH_CMAKE=true WITH_IO=true PYTHON_VERSION=3
7+
- WITH_CUDA=true WITH_CMAKE=false WITH_IO=true
8+
- WITH_CUDA=true WITH_CMAKE=true WITH_IO=true
9+
- WITH_CUDA=false WITH_CMAKE=false WITH_IO=false
10+
- WITH_CUDA=false WITH_CMAKE=true WITH_IO=false PYTHON_VERSION=3
11+
12+
language: cpp
13+
14+
# Cache Ubuntu apt packages.
15+
cache:
16+
apt: true
17+
directories:
18+
- /home/travis/miniconda
19+
- /home/travis/miniconda2
20+
- /home/travis/miniconda3
21+
22+
compiler: gcc
23+
24+
before_install:
25+
- export NUM_THREADS=4
26+
- export SCRIPTS=./scripts/travis
27+
- export CONDA_DIR="/home/travis/miniconda$PYTHON_VERSION"
28+
29+
install:
30+
- sudo -E $SCRIPTS/travis_install.sh
31+
32+
before_script:
33+
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/cuda/lib64:$CONDA_DIR/lib
34+
- export PATH=$CONDA_DIR/bin:$PATH
35+
- if ! $WITH_CMAKE; then $SCRIPTS/travis_setup_makefile_config.sh; fi
36+
37+
script: $SCRIPTS/travis_build_and_test.sh
38+
39+
notifications:
40+
# Emails are sent to the committer's git-configured email address by default,
41+
# but only if they have access to the repository. To enable Travis on your
42+
# public fork of Caffe, just go to travis-ci.org and flip the switch on for
43+
# your Caffe fork. To configure your git email address, use:
44+
# git config --global user.email me@example.com
45+
email:
46+
on_success: always
47+
on_failure: always
48+
49+
# IRC notifications disabled by default.
50+
# Uncomment next 5 lines to send notifications to chat.freenode.net#caffe
51+
# irc:
52+
# channels:
53+
# - "chat.freenode.net#caffe"
54+
# template:
55+
# - "%{repository}/%{branch} (%{commit} - %{author}): %{message}"

CMakeLists.txt

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
cmake_minimum_required(VERSION 2.8.7)
2+
if(POLICY CMP0046)
3+
cmake_policy(SET CMP0046 NEW)
4+
endif()
5+
if(POLICY CMP0054)
6+
cmake_policy(SET CMP0054 NEW)
7+
endif()
8+
9+
# ---[ Caffe project
10+
project(Caffe C CXX)
11+
12+
# ---[ Caffe version
13+
set(CAFFE_TARGET_VERSION "1.0.0-rc3")
14+
set(CAFFE_TARGET_SOVERSION "1.0.0-rc3")
15+
add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION})
16+
17+
# ---[ Using cmake scripts and modules
18+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
19+
20+
include(ExternalProject)
21+
22+
include(cmake/Utils.cmake)
23+
include(cmake/Targets.cmake)
24+
include(cmake/Misc.cmake)
25+
include(cmake/Summary.cmake)
26+
include(cmake/ConfigGen.cmake)
27+
28+
# ---[ Options
29+
caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA
30+
caffe_option(USE_CUDNN "Build Caffe with cuDNN library support" ON IF NOT CPU_ONLY)
31+
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
32+
caffe_option(BUILD_python "Build Python wrapper" ON)
33+
set(python_version "2" CACHE STRING "Specify which Python version to use")
34+
caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
35+
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
36+
caffe_option(BUILD_python_layer "Build the Caffe Python layer" ON)
37+
caffe_option(USE_OPENCV "Build with OpenCV support" ON)
38+
caffe_option(USE_LEVELDB "Build with levelDB" ON)
39+
caffe_option(USE_LMDB "Build with lmdb" ON)
40+
caffe_option(ALLOW_LMDB_NOLOCK "Allow MDB_NOLOCK when reading LMDB files (only if necessary)" OFF)
41+
42+
# ---[ Dependencies
43+
include(cmake/Dependencies.cmake)
44+
45+
# ---[ Flags
46+
if(UNIX OR APPLE)
47+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")
48+
endif()
49+
50+
caffe_set_caffe_link()
51+
52+
if(USE_libstdcpp)
53+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
54+
message("-- Warning: forcing libstdc++ (controlled by USE_libstdcpp option in cmake)")
55+
endif()
56+
57+
add_definitions(-DGTEST_USE_OWN_TR1_TUPLE)
58+
59+
# ---[ Warnings
60+
caffe_warnings_disable(CMAKE_CXX_FLAGS -Wno-sign-compare -Wno-uninitialized)
61+
62+
# ---[ Config generation
63+
configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_config.h")
64+
65+
# ---[ Includes
66+
set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
67+
include_directories(${Caffe_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
68+
include_directories(BEFORE src) # This is needed for gtest.
69+
70+
# ---[ Subdirectories
71+
add_subdirectory(src/gtest)
72+
add_subdirectory(src/caffe)
73+
add_subdirectory(tools)
74+
add_subdirectory(examples)
75+
add_subdirectory(python)
76+
add_subdirectory(matlab)
77+
add_subdirectory(docs)
78+
79+
# ---[ Linter target
80+
add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)
81+
82+
# ---[ pytest target
83+
if(BUILD_python)
84+
add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
85+
add_dependencies(pytest pycaffe)
86+
endif()
87+
88+
# ---[ Configuration summary
89+
caffe_print_configuration_summary()
90+
91+
# ---[ Export configs generation
92+
caffe_generate_export_configs()

0 commit comments

Comments
 (0)