source: trunk/dports/math/caffe/Portfile @ 135284

Last change on this file since 135284 was 135284, checked in by hum@…, 5 years ago

caffe: update to 20150418

File size: 3.7 KB
Line 
1# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        BVLC caffe c6414ea7cab5917c904729c87f786e0a5909475c
8version             20150418
9categories          math science
10maintainers         hum openmaintainer
11
12description         a fast framework for deep learning
13long_description    ${description}
14
15homepage            http://caffe.berkeleyvision.org/
16platforms           darwin
17license             BSD
18
19checksums           rmd160  1bc95d11cbc8ccbf3d4752895331e77e323b728c \
20                    sha256  a25ed9a4685b1dee010f24b9fc958d9f787c9c42d04bfc6882449c8085ca9435
21
22depends_lib-append  port:google-glog \
23                    port:gflags \
24                    port:protobuf-cpp \
25                    port:leveldb \
26                    port:snappy \
27                    port:lmdb \
28                    port:boost \
29                    port:hdf5 \
30                    port:opencv \
31                    port:szip
32
33depends_run-append  port:wget
34
35patchfiles          patch-Makefile.diff \
36                    patch-Makefile.config.diff
37
38post-extract {
39    copy ${worksrcpath}/Makefile.config.example ${worksrcpath}/Makefile.config
40}
41
42use_configure       no
43
44variant universal {}
45
46set defs "-DGTEST_HAS_TR1_TUPLE=0"
47build.args          CXX="${configure.cxx}" \
48                    _CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx] ${defs}" \
49                    _PREFIX=${prefix}
50                   
51set caffe_root ${prefix}/libexec/${name}
52
53destroot {
54    # copy files to caffe_root
55    xinstall -m 755 -d ${destroot}${caffe_root}
56    foreach dir {data examples models python scripts tools} {
57        copy ${worksrcpath}/${dir} ${destroot}${caffe_root}
58    }
59    copy ${worksrcpath}/.build_release ${destroot}${caffe_root}/build
60
61    # install additional documents
62    set docdir ${prefix}/share/doc/${name}
63    xinstall -m 755 -d ${destroot}${docdir}
64    xinstall -m 644 -W ${worksrcpath} \
65        CONTRIBUTORS.md LICENSE README.md \
66        ${destroot}${docdir}
67}
68
69notes "
70To try examples, copy ${caffe_root} and run commands.
71"
72
73if {[variant_isset cudnn]} { default_variants +gpu }
74
75if {![variant_isset gpu]} { default_variants +cpu }
76
77default_variants    +python27 +openblas
78
79variant cpu conflicts gpu description {Use CPU only} {
80    patchfiles-append  patch-cpu-only.diff
81    notes-append "
82This port is for CPU-only. Do not forget to train on CPU, not on GPU.
83"
84}
85
86variant gpu conflicts cpu description {Use GPU and CUDA in /usr/local/cuda} {}
87
88variant cudnn description {Use cuDNN} {
89    patchfiles-append  patch-cudnn.diff
90}
91
92variant openblas description {Use OpenBLAS} {
93    depends_lib-append port:OpenBLAS
94    patchfiles-append  patch-openblas.diff
95}
96
97variant python27 description {Install Python 2.7 interface} {
98    depends_lib-append \
99                    port:python27 \
100                    port:py27-cython \
101                    port:py27-numpy \
102                    port:py27-scipy \
103                    port:py27-scikit-image \
104                    port:py27-scikit-learn \
105                    port:py27-matplotlib \
106                    port:py27-ipython \
107                    port:py27-h5py \
108                    port:py27-networkx \
109                    port:py27-nose \
110                    port:py27-pandas \
111                    port:py27-protobuf \
112                    port:py27-gflags \
113                    port:py27-leveldb \
114                    port:py27-dateutil
115
116    build.target-append  pycaffe
117
118    post-destroot {
119        set packages_dir \
120            ${destroot}${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
121        xinstall -m 755 -d ${packages_dir}
122        copy ${worksrcpath}/python/caffe ${packages_dir}
123    }
124}
Note: See TracBrowser for help on using the repository browser.