|
| 1 | +## Refer to http://caffe.berkeleyvision.org/installation.html |
| 2 | +# Contributions simplifying and improving our build system are welcome! |
| 3 | + |
| 4 | +# cuDNN acceleration switch (uncomment to build with cuDNN). |
| 5 | +# USE_CUDNN := 1 |
| 6 | + |
| 7 | +# CPU-only switch (uncomment to build without GPU support). |
| 8 | +CPU_ONLY := 1 |
| 9 | + |
| 10 | +# Enable ACL (ARM Compute Library) |
| 11 | +USE_ACL :=1 |
| 12 | + |
| 13 | +USE_PROFILING := 0 |
| 14 | + |
| 15 | +ifeq ($(USE_ACL), 1) |
| 16 | + ifeq ($(ACL_ROOT),) |
| 17 | + $(error ACL_ROOT does not specified. use "export ACL_ROOT='path of acl soure code'") |
| 18 | + endif |
| 19 | + |
| 20 | +ACL_INCS :=$(ACL_ROOT)/include |
| 21 | +ACL_INCS +=$(ACL_ROOT) |
| 22 | +ACL_LIBS_DIR :=$(ACL_ROOT)/build |
| 23 | +ACL_LIBS_DIR +=$(ACL_ROOT)/build/arm_compute |
| 24 | +ACL_LIBS :=arm_compute OpenCL |
| 25 | +endif |
| 26 | + |
| 27 | +# uncomment to disable IO dependencies and corresponding data layers |
| 28 | +# USE_OPENCV := 0 |
| 29 | +# USE_LEVELDB := 0 |
| 30 | +# USE_LMDB := 0 |
| 31 | + |
| 32 | +# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary) |
| 33 | +# You should not set this flag if you will be reading LMDBs with any |
| 34 | +# possibility of simultaneous read and write |
| 35 | +# ALLOW_LMDB_NOLOCK := 1 |
| 36 | + |
| 37 | +# Uncomment if you're using OpenCV 3 |
| 38 | +# OPENCV_VERSION := 3 |
| 39 | + |
| 40 | +# To customize your choice of compiler, uncomment and set the following. |
| 41 | +# N.B. the default for Linux is g++ and the default for OSX is clang++ |
| 42 | +# CUSTOM_CXX := g++ |
| 43 | +#CUSTOM_CXX := aarch64-linux-gnu-g++ |
| 44 | +#os :=linux |
| 45 | +#arch :=arm64-v8a |
| 46 | + |
| 47 | +# CUDA directory contains bin/ and lib/ directories that we need. |
| 48 | +CUDA_DIR := /usr/local/cuda |
| 49 | +# On Ubuntu 14.04, if cuda tools are installed via |
| 50 | +# "sudo apt-get install nvidia-cuda-toolkit" then use this instead: |
| 51 | +# CUDA_DIR := /usr |
| 52 | + |
| 53 | +# CUDA architecture setting: going with all of them. |
| 54 | +# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. |
| 55 | +# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. |
| 56 | +CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ |
| 57 | + -gencode arch=compute_20,code=sm_21 \ |
| 58 | + -gencode arch=compute_30,code=sm_30 \ |
| 59 | + -gencode arch=compute_35,code=sm_35 \ |
| 60 | + -gencode arch=compute_50,code=sm_50 \ |
| 61 | + -gencode arch=compute_52,code=sm_52 \ |
| 62 | + -gencode arch=compute_60,code=sm_60 \ |
| 63 | + -gencode arch=compute_61,code=sm_61 \ |
| 64 | + -gencode arch=compute_61,code=compute_61 |
| 65 | + |
| 66 | +# BLAS choice: |
| 67 | +# atlas for ATLAS (default) |
| 68 | +# mkl for MKL |
| 69 | +# open for OpenBlas |
| 70 | +#BLAS := atlas |
| 71 | +BLAS := open |
| 72 | +# Custom (MKL/ATLAS/OpenBLAS) include and lib directories. |
| 73 | +# Leave commented to accept the defaults for your choice of BLAS |
| 74 | +# (which should work)! |
| 75 | +# BLAS_INCLUDE := /path/to/your/blas |
| 76 | +# BLAS_LIB := /path/to/your/blas |
| 77 | + |
| 78 | +# Homebrew puts openblas in a directory that is not on the standard search path |
| 79 | +# BLAS_INCLUDE := $(shell brew --prefix openblas)/include |
| 80 | +# BLAS_LIB := $(shell brew --prefix openblas)/lib |
| 81 | + |
| 82 | +# This is required only if you will compile the matlab interface. |
| 83 | +# MATLAB directory should contain the mex binary in /bin. |
| 84 | +# MATLAB_DIR := /usr/local |
| 85 | +# MATLAB_DIR := /Applications/MATLAB_R2012b.app |
| 86 | + |
| 87 | +# NOTE: this is required only if you will compile the python interface. |
| 88 | +# We need to be able to find Python.h and numpy/arrayobject.h. |
| 89 | +PYTHON_INCLUDE := /usr/include/python2.7 \ |
| 90 | + /usr/lib/python2.7/dist-packages/numpy/core/include |
| 91 | +# Anaconda Python distribution is quite popular. Include path: |
| 92 | +# Verify anaconda location, sometimes it's in root. |
| 93 | +# ANACONDA_HOME := $(HOME)/anaconda |
| 94 | +# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \ |
| 95 | + # $(ANACONDA_HOME)/include/python2.7 \ |
| 96 | + # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include |
| 97 | + |
| 98 | +# Uncomment to use Python 3 (default is Python 2) |
| 99 | +# PYTHON_LIBRARIES := boost_python3 python3.5m |
| 100 | +# PYTHON_INCLUDE := /usr/include/python3.5m \ |
| 101 | +# /usr/lib/python3.5/dist-packages/numpy/core/include |
| 102 | + |
| 103 | +# We need to be able to find libpythonX.X.so or .dylib. |
| 104 | +PYTHON_LIB := /usr/lib |
| 105 | +# PYTHON_LIB := $(ANACONDA_HOME)/lib |
| 106 | + |
| 107 | +# Homebrew installs numpy in a non standard path (keg only) |
| 108 | +# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include |
| 109 | +# PYTHON_LIB += $(shell brew --prefix numpy)/lib |
| 110 | + |
| 111 | +# Uncomment to support layers written in Python (will link against Python libs) |
| 112 | +# WITH_PYTHON_LAYER := 1 |
| 113 | + |
| 114 | +# Whatever else you find you need goes here. |
| 115 | +INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include |
| 116 | +LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib |
| 117 | + |
| 118 | +# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies |
| 119 | +# INCLUDE_DIRS += $(shell brew --prefix)/include |
| 120 | +# LIBRARY_DIRS += $(shell brew --prefix)/lib |
| 121 | + |
| 122 | +# NCCL acceleration switch (uncomment to build with NCCL) |
| 123 | +# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0) |
| 124 | +# USE_NCCL := 1 |
| 125 | + |
| 126 | +# Uncomment to use `pkg-config` to specify OpenCV library paths. |
| 127 | +# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.) |
| 128 | +# USE_PKG_CONFIG := 1 |
| 129 | + |
| 130 | +# N.B. both build and distribute dirs are cleared on `make clean` |
| 131 | +BUILD_DIR := build |
| 132 | +DISTRIBUTE_DIR := distribute |
| 133 | + |
| 134 | +#HDF5 |
| 135 | +USE_HDF5 := 1 |
| 136 | +HDF5_INCLUDE_DIRS := /usr/include/hdf5/serial |
| 137 | +HDF5_LIBRARY_DIRS := /usr/lib/aarch64-linux-gnu/hdf5/serial |
| 138 | +HDF5_LIBRARIES :=hdf5_hl hdf5 |
| 139 | + |
| 140 | +# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171 |
| 141 | +# DEBUG := 1 |
| 142 | + |
| 143 | +# The ID of the GPU that 'make runtest' will use to run unit tests. |
| 144 | +TEST_GPUID := 0 |
| 145 | + |
| 146 | +# enable pretty build (comment to see full commands) |
| 147 | +Q ?= @ |
0 commit comments