Advertisement
andrei_popovici

Untitled

Aug 6th, 2019
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 5.31 KB | None | 0 0
  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. # uncomment to disable IO dependencies and corresponding data layers
  11. # USE_OPENCV := 0
  12. # USE_LEVELDB := 0
  13. # USE_LMDB := 0
  14. # This code is taken from https://github.com/sh1r0/caffe-android-lib
  15. # USE_HDF5 := 0
  16.  
  17. # uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
  18. #   You should not set this flag if you will be reading LMDBs with any
  19. #   possibility of simultaneous read and write
  20. # ALLOW_LMDB_NOLOCK := 1
  21.  
  22. # Uncomment if you're using OpenCV 3
  23. OPENCV_VERSION := 3
  24. # INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/Cellar/opencv3/4.1.0_2/include
  25. # LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/Cellar/opencv3/4.1.0_2/lib
  26. INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/opt/opencv@3/include
  27. LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/opt/opencv@3/lib
  28.  
  29. # To customize your choice of compiler, uncomment and set the following.
  30. # N.B. the default for Linux is g++ and the default for OSX is clang++
  31. # CUSTOM_CXX := g++
  32. CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
  33. NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) -std=c++11
  34. LINKFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
  35.  
  36. # CUDA directory contains bin/ and lib/ directories that we need.
  37. CUDA_DIR := /usr/local/cuda
  38. # On Ubuntu 14.04, if cuda tools are installed via
  39. # "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
  40. # CUDA_DIR := /usr
  41.  
  42. # CUDA architecture setting: going with all of them.
  43. # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
  44. # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
  45. # For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
  46. CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
  47.         -gencode arch=compute_20,code=sm_21 \
  48.         -gencode arch=compute_30,code=sm_30 \
  49.         -gencode arch=compute_35,code=sm_35 \
  50.         -gencode arch=compute_50,code=sm_50 \
  51.         -gencode arch=compute_52,code=sm_52 \
  52.         -gencode arch=compute_60,code=sm_60 \
  53.         -gencode arch=compute_61,code=sm_61 \
  54.         -gencode arch=compute_61,code=compute_61
  55.  
  56. # BLAS choice:
  57. # atlas for ATLAS (default)
  58. # mkl for MKL
  59. # open for OpenBlas
  60. BLAS := open
  61. # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
  62. # Leave commented to accept the defaults for your choice of BLAS
  63. # (which should work)!
  64. # BLAS_INCLUDE := /path/to/your/blas
  65. # BLAS_LIB := /path/to/your/blas
  66.  
  67. # Homebrew puts openblas in a directory that is not on the standard search path
  68. BLAS_INCLUDE := $(shell brew --prefix openblas)/include
  69. BLAS_LIB := $(shell brew --prefix openblas)/lib
  70.  
  71. # This is required only if you will compile the matlab interface.
  72. # MATLAB directory should contain the mex binary in /bin.
  73. # MATLAB_DIR := /usr/local
  74. # MATLAB_DIR := /Applications/MATLAB_R2012b.app
  75.  
  76. # NOTE: this is required only if you will compile the python interface.
  77. # We need to be able to find Python.h and numpy/arrayobject.h.
  78. PYTHON_INCLUDE := /usr/include/python2.7 \
  79.         /usr/lib/python2.7/dist-packages/numpy/core/include
  80. # Anaconda Python distribution is quite popular. Include path:
  81. # Verify anaconda location, sometimes it's in root.
  82. # ANACONDA_HOME := $(HOME)/anaconda
  83. # PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
  84.         # $(ANACONDA_HOME)/include/python2.7 \
  85.         # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include
  86.  
  87. # Uncomment to use Python 3 (default is Python 2)
  88. # PYTHON_LIBRARIES := boost_python3 python3.5m
  89. # PYTHON_INCLUDE := /usr/include/python3.5m \
  90. #                 /usr/lib/python3.5/dist-packages/numpy/core/include
  91.  
  92. # We need to be able to find libpythonX.X.so or .dylib.
  93. PYTHON_LIB := /usr/lib
  94. # PYTHON_LIB := $(ANACONDA_HOME)/lib
  95.  
  96. # Homebrew installs numpy in a non standard path (keg only)
  97. # PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
  98. # PYTHON_LIB += $(shell brew --prefix numpy)/lib
  99.  
  100. # Uncomment to support layers written in Python (will link against Python libs)
  101. # WITH_PYTHON_LAYER := 1
  102.  
  103. # Whatever else you find you need goes here.
  104. INCLUDE_DIRS += $(PYTHON_INCLUDE) /usr/local/include
  105. LIBRARY_DIRS += $(PYTHON_LIB) /usr/local/lib /usr/lib
  106.  
  107. # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
  108. INCLUDE_DIRS += $(shell brew --prefix)/include
  109. LIBRARY_DIRS += $(shell brew --prefix)/lib
  110.  
  111. # NCCL acceleration switch (uncomment to build with NCCL)
  112. # https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
  113. # USE_NCCL := 1
  114.  
  115. # Uncomment to use `pkg-config` to specify OpenCV library paths.
  116. # (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
  117. # USE_PKG_CONFIG := 1
  118.  
  119. # N.B. both build and distribute dirs are cleared on `make clean`
  120. BUILD_DIR := build
  121. DISTRIBUTE_DIR := distribute
  122.  
  123. # Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
  124. # DEBUG := 1
  125.  
  126. # The ID of the GPU that 'make runtest' will use to run unit tests.
  127. TEST_GPUID := 0
  128.  
  129. # enable pretty build (comment to see full commands)
  130. Q ?= @
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement