diff --git a/math/caffe/Portfile b/math/caffe/Portfile
index 75bc3473..bf579f74 100644
a
|
b
|
|
2 | 2 | |
3 | 3 | PortSystem 1.0 |
4 | 4 | PortGroup github 1.0 |
| 5 | PortGroup active_variants 1.1 |
5 | 6 | |
6 | | github.setup BVLC caffe 6d92d8fcfe0eea9495ffbc326256ec5b70c3eed1 |
7 | | version 20150717 |
8 | | revision 5 |
| 7 | github.setup BVLC caffe rc5 |
9 | 8 | categories math science |
10 | 9 | maintainers nomaintainer |
11 | 10 | |
12 | 11 | description a fast framework for deep learning |
13 | | long_description ${description} |
| 12 | long_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. |
14 | 15 | |
15 | 16 | homepage http://caffe.berkeleyvision.org/ |
16 | 17 | platforms darwin |
17 | 18 | license BSD |
18 | 19 | |
19 | | checksums rmd160 12d7cddfe2b38f5b1a1b1675c457a7a958bff127 \ |
20 | | sha256 07caf1bf1bfebe1a331e2ee61b4b3cccd415b3bd7da641ab8cb5373aabd5d612 |
| 20 | checksums rmd160 6efd33cc20a94196c5d7dfa6e3fd5f78c347ac5f \ |
| 21 | sha256 e02769c6794d9eccb4bd40f3e0437cd8c7d8971866b8b2eea59254c4ada5b540 |
21 | 22 | |
22 | 23 | depends_lib-append port:google-glog \ |
23 | 24 | port:gflags \ |
… |
… |
depends_run-append port:wget |
35 | 36 | patchfiles patch-Makefile.diff \ |
36 | 37 | patch-Makefile.config.diff |
37 | 38 | |
| 39 | require_active_variants opencv python27 |
| 40 | |
38 | 41 | post-extract { |
39 | 42 | copy ${worksrcpath}/Makefile.config.example ${worksrcpath}/Makefile.config |
40 | 43 | } |
… |
… |
variant cudnn description {Use cuDNN} { |
96 | 99 | } |
97 | 100 | |
98 | 101 | variant openblas description {Use OpenBLAS} { |
99 | | depends_lib-append port:OpenBLAS |
| 102 | depends_lib-append port:OpenBLAS-devel |
100 | 103 | patchfiles-append patch-openblas.diff |
101 | 104 | } |
102 | 105 | |
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 @@ |
4 | 4 | |
5 | 5 | # NOTE: this is required only if you will compile the python interface. |
6 | 6 | # We need to be able to find Python.h and numpy/arrayobject.h. |
… |
… |
|
12 | 12 | # Anaconda Python distribution is quite popular. Include path: |
13 | 13 | # Verify anaconda location, sometimes it's in root. |
14 | 14 | # 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 |
17 | 17 | |
18 | 18 | # We need to be able to find libpythonX.X.so or .dylib. |
19 | 19 | -PYTHON_LIB := /usr/lib |
… |
… |
|
21 | 21 | # PYTHON_LIB := $(ANACONDA_HOME)/lib |
22 | 22 | |
23 | 23 | # Homebrew installs numpy in a non standard path (keg only) |
24 | | @@ -69,8 +70,8 @@ |
| 24 | @@ -91,8 +92,8 @@ |
25 | 25 | # WITH_PYTHON_LAYER := 1 |
26 | 26 | |
27 | 27 | # Whatever else you find you need goes here. |
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 @@ |
4 | 4 | LIBRARIES := cudart cublas curand |
5 | 5 | 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 |
13 | 18 | WARNINGS := -Wall -Wno-sign-compare |
14 | 19 | |
15 | 20 | ############################## |
16 | | @@ -240,7 +240,7 @@ |
| 21 | @@ -270,7 +270,7 @@ |
17 | 22 | # clang++ instead of g++ |
18 | 23 | # libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0 |
19 | 24 | ifeq ($(OSX), 1) |
20 | 25 | - CXX := /usr/bin/clang++ |
21 | 26 | + CXX ?= /usr/bin/clang++ |
22 | 27 | 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 @@ |
26 | 31 | |
27 | 32 | # Complete build flags. |
28 | 33 | COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir)) |
… |
… |
|
31 | 36 | NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) |
32 | 37 | # mex may invoke an older gcc that is too liberal with -Wuninitalized |
33 | 38 | MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized |
34 | | @@ -554,7 +554,7 @@ |
| 39 | @@ -619,7 +619,7 @@ |
35 | 40 | # Target for extension-less symlinks to tool binaries with extension '*.bin'. |
36 | 41 | $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR) |
37 | 42 | @ $(RM) $@ |
38 | | - @ ln -s $(abspath $<) $@ |
| 43 | - @ ln -s $(notdir $<) $@ |
39 | 44 | + @ cd $(TOOL_BUILD_DIR); ln -s $(notdir $<) $(notdir $@) |
40 | 45 | |
41 | 46 | $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME) |
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 @@ |
4 | 4 | # USE_CUDNN := 1 |
5 | 5 | |
6 | 6 | # CPU-only switch (uncomment to build without GPU support). |
7 | 7 | -# CPU_ONLY := 1 |
8 | 8 | +CPU_ONLY := 1 |
9 | 9 | |
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 @@ |
12 | 13 | # CUSTOM_CXX := g++ |
13 | 14 | |
14 | 15 | # CUDA directory contains bin/ and lib/ directories that we need. |
… |
… |
|
17 | 18 | # On Ubuntu 14.04, if cuda tools are installed via |
18 | 19 | # "sudo apt-get install nvidia-cuda-toolkit" then use this instead: |
19 | 20 | # CUDA_DIR := /usr |
20 | | |
| 21 | @@ -33,15 +33,15 @@ |
21 | 22 | # 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. |
23 | 25 | -CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ |
24 | 26 | - -gencode arch=compute_20,code=sm_21 \ |
25 | 27 | - -gencode arch=compute_30,code=sm_30 \ |
26 | 28 | - -gencode arch=compute_35,code=sm_35 \ |
27 | 29 | - -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 |
29 | 34 | +# CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ |
30 | 35 | +# -gencode arch=compute_20,code=sm_21 \ |
31 | 36 | +# -gencode arch=compute_30,code=sm_30 \ |
32 | 37 | +# -gencode arch=compute_35,code=sm_35 \ |
33 | 38 | +# -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 |
35 | 43 | |
36 | 44 | # BLAS choice: |
37 | 45 | # atlas for ATLAS (default) |
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 |
3 | 3 | @@ -2,7 +2,7 @@ |
4 | 4 | # Contributions simplifying and improving our build system are welcome! |
5 | 5 | |
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 @@ |
4 | 4 | # atlas for ATLAS (default) |
5 | 5 | # mkl for MKL |
6 | 6 | # open for OpenBlas |
… |
… |
|
9 | 9 | # Custom (MKL/ATLAS/OpenBLAS) include and lib directories. |
10 | 10 | # Leave commented to accept the defaults for your choice of BLAS |
11 | 11 | # (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 |
17 | 17 | extern "C" { |
18 | 18 | -#include <cblas.h> |
19 | 19 | +#include <cblas_openblas.h> |
20 | 20 | } |
21 | | #include <math.h> |
| 21 | #endif // USE_ACCELERATE |
22 | 22 | |