2015-02-11 08:12:20 +00:00
|
|
|
# -*- 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
|
|
|
|
|
|
|
|
|
|
PortSystem 1.0
|
|
|
|
|
PortGroup github 1.0
|
2021-06-13 11:15:13 -04:00
|
|
|
PortGroup boost 1.0
|
2015-02-11 08:12:20 +00:00
|
|
|
|
2017-08-24 16:00:58 +02:00
|
|
|
github.setup BVLC caffe 1de4cebfb81d50267d0d8c2595372b14e1408248
|
2025-01-25 02:50:03 +11:00
|
|
|
# Change github.tarball_from to 'releases' or 'archive' next update
|
|
|
|
|
github.tarball_from tarball
|
2017-08-24 16:00:58 +02:00
|
|
|
version 20170817
|
2026-06-04 13:20:03 -05:00
|
|
|
revision 28
|
2021-06-13 11:15:13 -04:00
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
categories math science
|
2016-12-04 23:45:28 -05:00
|
|
|
maintainers nomaintainer
|
2015-02-11 08:12:20 +00:00
|
|
|
|
2015-02-22 07:00:03 +00:00
|
|
|
description a fast framework for deep learning
|
2025-01-25 02:50:03 +11:00
|
|
|
long_description {*}${description}
|
2015-02-11 08:12:20 +00:00
|
|
|
|
|
|
|
|
homepage http://caffe.berkeleyvision.org/
|
|
|
|
|
license BSD
|
|
|
|
|
|
2017-08-24 16:00:58 +02:00
|
|
|
checksums rmd160 fbf514385ccfb2e7c0ef3ccd85c15ffbbd52ec88 \
|
|
|
|
|
sha256 3fae039f041bc024c966c3f6e99395602cbcd5a29a540f6f4336b6007f8d79b6
|
2015-02-11 08:12:20 +00:00
|
|
|
|
2021-06-13 11:15:13 -04:00
|
|
|
compiler.cxx_standard \
|
|
|
|
|
2011
|
|
|
|
|
|
|
|
|
|
boost.version 1.71
|
|
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
depends_lib-append port:google-glog \
|
|
|
|
|
port:gflags \
|
2018-04-25 12:05:14 -04:00
|
|
|
port:protobuf3-cpp \
|
2015-02-11 08:12:20 +00:00
|
|
|
port:leveldb \
|
|
|
|
|
port:snappy \
|
|
|
|
|
port:lmdb \
|
|
|
|
|
port:hdf5 \
|
2021-11-02 09:27:22 -04:00
|
|
|
path:lib/opencv3/libopencv_core.dylib:opencv3 \
|
2015-02-11 08:12:20 +00:00
|
|
|
port:szip
|
|
|
|
|
|
|
|
|
|
depends_run-append port:wget
|
|
|
|
|
|
|
|
|
|
patchfiles patch-Makefile.diff \
|
2015-02-22 07:00:03 +00:00
|
|
|
patch-Makefile.config.diff
|
2015-02-11 08:12:20 +00:00
|
|
|
|
|
|
|
|
post-extract {
|
|
|
|
|
copy ${worksrcpath}/Makefile.config.example ${worksrcpath}/Makefile.config
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
use_configure no
|
|
|
|
|
|
|
|
|
|
variant universal {}
|
|
|
|
|
|
2017-08-24 16:00:58 +02:00
|
|
|
set defs "-DGTEST_HAS_TR1_TUPLE=0 -Wno-deprecated -Wunused-local-typedef"
|
2015-02-11 08:12:20 +00:00
|
|
|
build.args CXX="${configure.cxx}" \
|
|
|
|
|
_CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx] ${defs}" \
|
|
|
|
|
_PREFIX=${prefix}
|
2017-09-26 08:55:38 +02:00
|
|
|
build.target tools/
|
2017-08-24 16:00:58 +02:00
|
|
|
|
|
|
|
|
test.run yes
|
|
|
|
|
test.args ${build.args}
|
|
|
|
|
test.target test runtest
|
|
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
set caffe_root ${prefix}/libexec/${name}
|
2017-09-26 08:55:38 +02:00
|
|
|
destroot.args ${build.args} \
|
|
|
|
|
DISTRIBUTE_DIR=${destroot}${prefix}
|
|
|
|
|
destroot.target dist
|
2015-02-11 08:12:20 +00:00
|
|
|
|
2017-09-26 08:55:38 +02:00
|
|
|
post-destroot {
|
|
|
|
|
# fix libraries
|
2015-07-18 04:26:57 +00:00
|
|
|
system "install_name_tool -id ${prefix}/lib/libcaffe.so \
|
|
|
|
|
${destroot}${prefix}/lib/libcaffe.so"
|
|
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
# copy files to caffe_root
|
|
|
|
|
xinstall -m 755 -d ${destroot}${caffe_root}
|
2017-09-26 08:55:38 +02:00
|
|
|
foreach dir {data examples models scripts} {
|
2015-02-11 08:12:20 +00:00
|
|
|
copy ${worksrcpath}/${dir} ${destroot}${caffe_root}
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-24 16:00:58 +02:00
|
|
|
# copy binary data of examples
|
|
|
|
|
file mkdir ${destroot}${caffe_root}/build
|
|
|
|
|
copy ${worksrcpath}/.build_release/examples ${destroot}${caffe_root}/build/
|
|
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
# install additional documents
|
|
|
|
|
set docdir ${prefix}/share/doc/${name}
|
|
|
|
|
xinstall -m 755 -d ${destroot}${docdir}
|
|
|
|
|
xinstall -m 644 -W ${worksrcpath} \
|
|
|
|
|
CONTRIBUTORS.md LICENSE README.md \
|
|
|
|
|
${destroot}${docdir}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notes "
|
|
|
|
|
To try examples, copy ${caffe_root} and run commands.
|
|
|
|
|
"
|
|
|
|
|
|
2015-02-22 07:00:03 +00:00
|
|
|
if {[variant_isset cudnn]} { default_variants +gpu }
|
|
|
|
|
|
|
|
|
|
if {![variant_isset gpu]} { default_variants +cpu }
|
|
|
|
|
|
2021-04-27 10:07:15 -05:00
|
|
|
default_variants +openblas
|
2015-02-11 08:12:20 +00:00
|
|
|
|
2015-02-22 07:00:03 +00:00
|
|
|
variant cpu conflicts gpu description {Use CPU only} {
|
|
|
|
|
patchfiles-append patch-cpu-only.diff
|
|
|
|
|
notes-append "
|
|
|
|
|
This port is for CPU-only. Do not forget to train on CPU, not on GPU.
|
|
|
|
|
"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant gpu conflicts cpu description {Use GPU and CUDA in /usr/local/cuda} {}
|
|
|
|
|
|
|
|
|
|
variant cudnn description {Use cuDNN} {
|
|
|
|
|
patchfiles-append patch-cudnn.diff
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-11 08:12:20 +00:00
|
|
|
variant openblas description {Use OpenBLAS} {
|
2023-06-17 22:32:10 +02:00
|
|
|
depends_lib-append path:lib/libopenblas.dylib:OpenBLAS
|
2015-02-11 08:12:20 +00:00
|
|
|
patchfiles-append patch-openblas.diff
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant python27 description {Install Python 2.7 interface} {
|
|
|
|
|
depends_lib-append \
|
|
|
|
|
port:python27 \
|
|
|
|
|
port:py27-cython \
|
|
|
|
|
port:py27-numpy \
|
|
|
|
|
port:py27-scipy \
|
|
|
|
|
port:py27-scikit-image \
|
|
|
|
|
port:py27-scikit-learn \
|
|
|
|
|
port:py27-matplotlib \
|
|
|
|
|
port:py27-ipython \
|
|
|
|
|
port:py27-h5py \
|
|
|
|
|
port:py27-networkx \
|
|
|
|
|
port:py27-nose \
|
|
|
|
|
port:py27-pandas \
|
2018-04-25 12:05:14 -04:00
|
|
|
port:py27-protobuf3 \
|
2015-02-11 08:12:20 +00:00
|
|
|
port:py27-gflags \
|
|
|
|
|
port:py27-leveldb \
|
2017-08-24 16:00:58 +02:00
|
|
|
port:py27-dateutil \
|
|
|
|
|
port:py27-pydot
|
2015-02-11 08:12:20 +00:00
|
|
|
|
|
|
|
|
build.target-append pycaffe
|
2017-08-24 16:00:58 +02:00
|
|
|
test.target-append pytest
|
2015-02-11 08:12:20 +00:00
|
|
|
|
|
|
|
|
post-destroot {
|
|
|
|
|
set packages_dir \
|
2015-07-18 04:26:57 +00:00
|
|
|
${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
|
|
|
|
|
xinstall -m 755 -d ${destroot}${packages_dir}
|
2017-08-24 16:00:58 +02:00
|
|
|
system "install_name_tool -change @rpath/libcaffe.so.1.0.0 ${prefix}/lib/libcaffe.so \
|
2017-09-26 08:55:38 +02:00
|
|
|
${worksrcpath}/python/caffe/_caffe.so"
|
|
|
|
|
copy ${worksrcpath}/python/caffe ${destroot}${packages_dir}
|
2015-02-11 08:12:20 +00:00
|
|
|
}
|
|
|
|
|
}
|