Ticket #53980: caffe_rc5_update.patch

File caffe_rc5_update.patch, 9.8 KB (added by JacksonIsaac (Jackson Isaac), 7 years ago)
  • math/caffe/Portfile

    diff --git a/math/caffe/Portfile b/math/caffe/Portfile
    index 75bc3473..bf579f74 100644
    a b  
    22
    33PortSystem          1.0
    44PortGroup           github 1.0
     5PortGroup           active_variants 1.1
    56
    6 github.setup        BVLC caffe 6d92d8fcfe0eea9495ffbc326256ec5b70c3eed1
    7 version             20150717
    8 revision            5
     7github.setup        BVLC caffe rc5
    98categories          math science
    109maintainers         nomaintainer
    1110
    1211description         a fast framework for deep learning
    13 long_description    ${description}
     12long_description    Caffe is a deep learning framework made with expression, \
     13                    speed, and modularity in mind. It is developed by the Berkeley \
     14                    Vision and Learning Center (BVLC) and community contributors.
    1415
    1516homepage            http://caffe.berkeleyvision.org/
    1617platforms           darwin
    1718license             BSD
    1819
    19 checksums           rmd160  12d7cddfe2b38f5b1a1b1675c457a7a958bff127 \
    20                     sha256  07caf1bf1bfebe1a331e2ee61b4b3cccd415b3bd7da641ab8cb5373aabd5d612
     20checksums           rmd160  6efd33cc20a94196c5d7dfa6e3fd5f78c347ac5f \
     21                    sha256  e02769c6794d9eccb4bd40f3e0437cd8c7d8971866b8b2eea59254c4ada5b540
    2122
    2223depends_lib-append  port:google-glog \
    2324                    port:gflags \
    depends_run-append port:wget 
    3536patchfiles          patch-Makefile.diff \
    3637                    patch-Makefile.config.diff
    3738
     39require_active_variants opencv python27
     40
    3841post-extract {
    3942    copy ${worksrcpath}/Makefile.config.example ${worksrcpath}/Makefile.config
    4043}
    variant cudnn description {Use cuDNN} { 
    9699}
    97100
    98101variant openblas description {Use OpenBLAS} {
    99     depends_lib-append port:OpenBLAS
     102    depends_lib-append port:OpenBLAS-devel
    100103    patchfiles-append  patch-openblas.diff
    101104}
    102105
  • math/caffe/files/patch-Makefile.config.diff

    diff --git a/math/caffe/files/patch-Makefile.config.diff b/math/caffe/files/patch-Makefile.config.diff
    index 91e1fa97..e323fb72 100644
    a b  
    1 --- Makefile.config.orig        2015-06-05 04:14:43.000000000 +0900
    2 +++ Makefile.config     2015-06-10 01:05:10.000000000 +0900
    3 @@ -48,8 +48,9 @@
     1--- Makefile.config.orig        2017-04-12 23:58:43.000000000 +0530
     2+++ Makefile.config     2017-04-12 23:59:45.000000000 +0530
     3@@ -65,8 +65,9 @@
    44 
    55 # NOTE: this is required only if you will compile the python interface.
    66 # We need to be able to find Python.h and numpy/arrayobject.h.
     
    1212 # Anaconda Python distribution is quite popular. Include path:
    1313 # Verify anaconda location, sometimes it's in root.
    1414 # ANACONDA_HOME := $(HOME)/anaconda
    15 @@ -58,7 +59,7 @@
    16                 # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
     15@@ -80,7 +81,7 @@
     16 #                 /usr/lib/python3.5/dist-packages/numpy/core/include
    1717 
    1818 # We need to be able to find libpythonX.X.so or .dylib.
    1919-PYTHON_LIB := /usr/lib
     
    2121 # PYTHON_LIB := $(ANACONDA_HOME)/lib
    2222 
    2323 # Homebrew installs numpy in a non standard path (keg only)
    24 @@ -69,8 +70,8 @@
     24@@ -91,8 +92,8 @@
    2525 # WITH_PYTHON_LAYER := 1
    2626 
    2727 # Whatever else you find you need goes here.
  • math/caffe/files/patch-Makefile.diff

    diff --git a/math/caffe/files/patch-Makefile.diff b/math/caffe/files/patch-Makefile.diff
    index 08c1560a..90108fd2 100644
    a b  
    1 --- Makefile.orig       2015-06-24 06:48:24.000000000 +0900
    2 +++ Makefile    2015-06-27 18:51:14.000000000 +0900
    3 @@ -170,9 +170,9 @@
     1--- Makefile.orig       2017-04-13 00:04:34.000000000 +0530
     2+++ Makefile    2017-04-13 20:17:58.000000000 +0530
     3@@ -178,7 +178,7 @@
    44        LIBRARIES := cudart cublas curand
    55 endif
    6  LIBRARIES += glog gflags protobuf leveldb snappy \
    7 -       lmdb boost_system hdf5_hl hdf5 m \
    8 -       opencv_core opencv_highgui opencv_imgproc
    9 -PYTHON_LIBRARIES := boost_python python2.7
    10 +       lmdb boost_system-mt hdf5_hl hdf5 m \
    11 +       opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
    12 +PYTHON_LIBRARIES := boost_python-mt python2.7
     6 
     7-LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
     8+LIBRARIES += glog gflags protobuf boost_system-mt boost_filesystem-mt m hdf5_hl hdf5
     9 
     10 # handle IO dependencies
     11 USE_LEVELDB ?= 1
     12@@ -199,7 +199,7 @@
     13        endif
     14 
     15 endif
     16-PYTHON_LIBRARIES ?= boost_python python2.7
     17+PYTHON_LIBRARIES ?= boost_python-mt python2.7
    1318 WARNINGS := -Wall -Wno-sign-compare
    1419 
    1520 ##############################
    16 @@ -240,7 +240,7 @@
     21@@ -270,7 +270,7 @@
    1722 # clang++ instead of g++
    1823 # libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0
    1924 ifeq ($(OSX), 1)
    2025-       CXX := /usr/bin/clang++
    2126+       CXX ?= /usr/bin/clang++
    2227        ifneq ($(CPU_ONLY), 1)
    23                 CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release \d' | grep -o '\d')
    24                 ifeq ($(shell echo $(CUDA_VERSION) \< 7.0 | bc), 1)
    25 @@ -349,7 +349,7 @@
     28                CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release [0-9.]*' | tr -d '[a-z ]')
     29                ifeq ($(shell echo | awk '{exit $(CUDA_VERSION) < 7.0;}'), 1)
     30@@ -411,7 +411,7 @@
    2631 
    2732 # Complete build flags.
    2833 COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
     
    3136 NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
    3237 # mex may invoke an older gcc that is too liberal with -Wuninitalized
    3338 MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized
    34 @@ -554,7 +554,7 @@
     39@@ -619,7 +619,7 @@
    3540 # Target for extension-less symlinks to tool binaries with extension '*.bin'.
    3641 $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
    3742        @ $(RM) $@
    38 -       @ ln -s $(abspath $<) $@
     43-       @ ln -s $(notdir $<) $@
    3944+       @ cd $(TOOL_BUILD_DIR); ln -s $(notdir $<) $(notdir $@)
    4045 
    4146 $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME)
  • math/caffe/files/patch-cpu-only.diff

    diff --git a/math/caffe/files/patch-cpu-only.diff b/math/caffe/files/patch-cpu-only.diff
    index a7b49d28..9c38d37e 100644
    a b  
    1 --- Makefile.config.orig        2014-12-18 01:12:23.000000000 +0900
    2 +++ Makefile.config     2014-12-20 16:03:45.000000000 +0900
    3 @@ -5,26 +5,26 @@
     1--- Makefile.config.orig        2017-04-12 22:51:59.000000000 +0530
     2+++ Makefile.config     2017-04-12 22:55:24.000000000 +0530
     3@@ -5,7 +5,7 @@
    44 # USE_CUDNN := 1
    55 
    66 # CPU-only switch (uncomment to build without GPU support).
    77-# CPU_ONLY := 1
    88+CPU_ONLY := 1
    99 
    10  # To customize your choice of compiler, uncomment and set the following.
    11  # N.B. the default for Linux is g++ and the default for OSX is clang++
     10 # uncomment to disable IO dependencies and corresponding data layers
     11 # USE_OPENCV := 0
     12@@ -25,7 +25,7 @@
    1213 # CUSTOM_CXX := g++
    1314 
    1415 # CUDA directory contains bin/ and lib/ directories that we need.
     
    1718 # On Ubuntu 14.04, if cuda tools are installed via
    1819 # "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
    1920 # CUDA_DIR := /usr
    20  
     21@@ -33,15 +33,15 @@
    2122 # CUDA architecture setting: going with all of them.
    22  # For CUDA < 6.0, comment the *_50 lines for compatibility.
     23 # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
     24 # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
    2325-CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
    2426-               -gencode arch=compute_20,code=sm_21 \
    2527-               -gencode arch=compute_30,code=sm_30 \
    2628-               -gencode arch=compute_35,code=sm_35 \
    2729-               -gencode arch=compute_50,code=sm_50 \
    28 -               -gencode arch=compute_50,code=compute_50
     30-               -gencode arch=compute_52,code=sm_52 \
     31-               -gencode arch=compute_60,code=sm_60 \
     32-               -gencode arch=compute_61,code=sm_61 \
     33-               -gencode arch=compute_61,code=compute_61
    2934+# CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
    3035+#              -gencode arch=compute_20,code=sm_21 \
    3136+#              -gencode arch=compute_30,code=sm_30 \
    3237+#              -gencode arch=compute_35,code=sm_35 \
    3338+#              -gencode arch=compute_50,code=sm_50 \
    34 +#              -gencode arch=compute_50,code=compute_50
     39+#              -gencode arch=compute_52,code=sm_52 \
     40+#              -gencode arch=compute_60,code=sm_60 \
     41+#              -gencode arch=compute_61,code=sm_61 \
     42+#              -gencode arch=compute_61,code=compute_61
    3543 
    3644 # BLAS choice:
    3745 # atlas for ATLAS (default)
  • math/caffe/files/patch-cudnn.diff

    diff --git a/math/caffe/files/patch-cudnn.diff b/math/caffe/files/patch-cudnn.diff
    index 04ad9054..0165ded3 100644
    a b  
    1 --- Makefile.config.orig        2015-02-22 14:13:41.000000000 +0900
    2 +++ Makefile.config     2015-02-22 14:15:21.000000000 +0900
     1--- Makefile.config.orig        2017-04-12 22:51:59.000000000 +0530
     2+++ Makefile.config     2017-04-12 22:56:38.000000000 +0530
    33@@ -2,7 +2,7 @@
    44 # Contributions simplifying and improving our build system are welcome!
    55 
  • math/caffe/files/patch-openblas.diff

    diff --git a/math/caffe/files/patch-openblas.diff b/math/caffe/files/patch-openblas.diff
    index cc204cd6..8cd417de 100644
    a b  
    1 --- Makefile.config.orig        2014-12-20 01:46:25.000000000 +0900
    2 +++ Makefile.config     2014-12-21 19:00:59.000000000 +0900
    3 @@ -30,7 +30,7 @@
     1--- Makefile.config.orig        2017-04-12 22:51:59.000000000 +0530
     2+++ Makefile.config     2017-04-12 22:57:49.000000000 +0530
     3@@ -47,7 +47,7 @@
    44 # atlas for ATLAS (default)
    55 # mkl for MKL
    66 # open for OpenBlas
     
    99 # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
    1010 # Leave commented to accept the defaults for your choice of BLAS
    1111 # (which should work)!
    12 --- include/caffe/util/mkl_alternate.hpp.orig   2014-12-18 01:12:23.000000000 +0900
    13 +++ include/caffe/util/mkl_alternate.hpp        2014-12-21 18:59:58.000000000 +0900
    14 @@ -8,7 +8,7 @@
    15  #else  // If use MKL, simply include the MKL header
    16  
     12--- include/caffe/util/mkl_alternate.hpp.orig   2017-04-12 22:58:08.000000000 +0530
     13+++ include/caffe/util/mkl_alternate.hpp        2017-04-12 22:58:39.000000000 +0530
     14@@ -11,7 +11,7 @@
     15 #include <Accelerate/Accelerate.h>
     16 #else
    1717 extern "C" {
    1818-#include <cblas.h>
    1919+#include <cblas_openblas.h>
    2020 }
    21  #include <math.h>
     21 #endif  // USE_ACCELERATE
    2222