1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

New port: graphics/caffe

Caffe is a deep learning framework made with expression, speed, and
modularity in mind. It is developed by the Berkeley Vision and Learning
Center (BVLC) and by community contributors.

WWW: http://caffe.berkeleyvision.org/

PR:		217428
Submitted by:	eric@camachat.org (maintainer)
Reviewed by:	mat
Approved by:	swills (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D10053
This commit is contained in:
Joseph Mingrone 2017-03-20 16:19:52 +00:00
parent 726a53be78
commit 16c17beecb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=436550
7 changed files with 281 additions and 0 deletions

View File

@ -79,6 +79,7 @@
SUBDIR += c-a-i-r
SUBDIR += cadubi
SUBDIR += cairo
SUBDIR += caffe
SUBDIR += cairo-reference
SUBDIR += cairomm
SUBDIR += cal3d

74
graphics/caffe/Makefile Normal file
View File

@ -0,0 +1,74 @@
# $FreeBSD$
PORTNAME= caffe
PORTVERSION= 1.0.0.r5
CATEGORIES= graphics
MAINTAINER= eric@camachat.org
COMMENT= Fast open framework for deep learning
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYNUMPY} \
${LOCALBASE}/bin/cython:lang/cython \
${LOCALBASE}/include/cblas.h:math/cblas \
bash:shells/bash
LIB_DEPENDS= libsnappy.so:archivers/snappy \
libleveldb.so:databases/leveldb \
liblmdb.so:databases/lmdb \
libboost_system.so:devel/boost-libs \
libboost_python.so:devel/boost-python-libs \
libgflags.so:devel/gflags \
libglog.so:devel/glog \
libprotobuf.so:devel/protobuf \
libopencv_highgui.so:graphics/opencv2 \
libopencv_core.so:graphics/opencv2-core \
libopenblas.so:math/openblas \
libhdf5.so:science/hdf5
RUN_DEPENDS= ${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}protobuf>=2.5.0:devel/py-protobuf \
${PYTHON_PKGNAMEPREFIX}scikit-image>=0.12:graphics/py-scikit-image \
${PYTHON_PKGNAMEPREFIX}pillow>=1.7:graphics/py-pillow \
${PYTHON_PKGNAMEPREFIX}networkx>=1.8:math/py-networkx \
${PYTHON_PKGNAMEPREFIX}matplotlib>=1.1:math/py-matplotlib \
${PYTHON_PKGNAMEPREFIX}PyWavelets>=0.4:math/py-PyWavelets
USE_LDCONFIG= yes
USES= gmake python fortran compiler:c++11-lib pkgconfig
CXXFLAGS+= -DGTEST_USE_OWN_TR1_TUPLE=1
LDFLAGS+= -DGTEST_USE_OWN_TR1_TUPLE=1
LDFLAGS+= -lboost_thread
MAKE_ARGS+= DISTRIBUTE_DIR=${STAGEDIR}${PREFIX}
ALL_TARGET= all py
INSTALL_TARGET= dist
TEST_TARGET= runtest
PLIST_SUB= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} DATADIR=${DATADIR}
GH_ACCOUNT= BVLC
USE_GITHUB= yes
GH_TAGNAME= rc5
post-extract:
@${CP} -v ${.CURDIR}/files/Makefile.config ${WRKSRC}/
post-patch:
@${REINPLACE_CMD} \
-e "s|%%CXX%%|clang++|g" \
-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
-e "s|%%DATADIR%%|${DATADIR}|g" \
-e "s|%%PYTHON_INCLUDEDIR%%|${PYTHON_INCLUDEDIR}|g" \
-e "s|%%PYTHON_SITELIBDIR%%|${PYTHON_SITELIBDIR}|g" \
-e "s|%%STAGEDIR%%|${STAGEDIR}|g" \
${WRKSRC}/Makefile.config ${WRKSRC}/Makefile
pre-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
post-install:
@${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/* ${STAGEDIR}/${PREFIX}/lib/*.so.* \
${STAGEDIR}/${PYTHON_SITELIBDIR}/${PORTNAME}/*.so
.include <bsd.port.mk>

3
graphics/caffe/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1489879004
SHA256 (BVLC-caffe-1.0.0.r5-rc5_GH0.tar.gz) = 06592aa8f5254335df3e244dafacc15765e2c60479b4bf2e7c887e8e023802fb
SIZE (BVLC-caffe-1.0.0.r5-rc5_GH0.tar.gz) = 8505332

View File

@ -0,0 +1,9 @@
# %%PYTHON_LIBDIR%%
CUSTOM_CXX := %%CXX%%
CPU_ONLY := 1
BLAS := open
PYTHON_INCLUDE := %%PYTHON_INCLUDEDIR%% %%PYTHON_SITELIBDIR%%/numpy/core/include
PYTHON_LIB := %%LOCALBASE%%/lib
INCLUDE_DIRS := $(PYTHON_INCLUDE) %%LOCALBASE%%/include
LIBRARY_DIRS := $(PYTHON_LIB) %%LOCALBASE%%/lib /usr/lib
USE_PKG_CONFIG := 1

View File

@ -0,0 +1,38 @@
--- Makefile.orig 2017-02-21 04:06:19 UTC
+++ Makefile
@@ -316,10 +316,10 @@ endif
# Debugging
ifeq ($(DEBUG), 1)
- COMMON_FLAGS += -DDEBUG -g -O0
+ COMMON_FLAGS += -DDEBUG -g
NVCCFLAGS += -G
else
- COMMON_FLAGS += -DNDEBUG -O2
+ COMMON_FLAGS += -DNDEBUG
endif
# cuDNN acceleration configuration.
@@ -681,19 +681,18 @@ $(DIST_ALIASES): $(DISTRIBUTE_DIR)
$(DISTRIBUTE_DIR): all py | $(DISTRIBUTE_SUBDIRS)
# add proto
- cp -r src/caffe/proto $(DISTRIBUTE_DIR)/
+ cp -r src/caffe/proto %%STAGEDIR%%%%DATADIR%%/
# add include
cp -r include $(DISTRIBUTE_DIR)/
mkdir -p $(DISTRIBUTE_DIR)/include/caffe/proto
cp $(PROTO_GEN_HEADER_SRCS) $(DISTRIBUTE_DIR)/include/caffe/proto
# add tool and example binaries
- cp $(TOOL_BINS) $(DISTRIBUTE_DIR)/bin
- cp $(EXAMPLE_BINS) $(DISTRIBUTE_DIR)/bin
+ for f in $(TOOL_BINS) $(EXAMPLE_BINS); do cp -v "$$f" "$(DISTRIBUTE_DIR)/bin/`basename -s.bin $$f`"; done
# add libraries
cp $(STATIC_NAME) $(DISTRIBUTE_DIR)/lib
install -m 644 $(DYNAMIC_NAME) $(DISTRIBUTE_DIR)/lib
cd $(DISTRIBUTE_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT)
# add python - it's not the standard way, indeed...
- cp -r python $(DISTRIBUTE_DIR)/python
+ cp -r python/caffe %%STAGEDIR%%%%PYTHON_SITELIBDIR%%/
-include $(DEPS)

6
graphics/caffe/pkg-descr Normal file
View File

@ -0,0 +1,6 @@
Caffe is a deep learning framework made with expression, speed, and modularity
in mind. It is developed by the Berkeley Vision and Learning Center (BVLC) and
by community contributors. Yangqing Jia created the project during his PhD at
UC Berkeley. Caffe is released under the BSD 2-Clause license.
WWW: http://caffe.berkeleyvision.org/

150
graphics/caffe/pkg-plist Normal file
View File

@ -0,0 +1,150 @@
bin/device_query
bin/convert_mnist_siamese_data
bin/caffe
bin/convert_cifar_data
bin/net_speed_benchmark
bin/test_net
bin/convert_imageset
bin/train_net
bin/upgrade_net_proto_text
bin/upgrade_solver_proto_text
bin/finetune_net
bin/classification
bin/compute_image_mean
bin/convert_mnist_data
bin/upgrade_net_proto_binary
bin/extract_features
lib/libcaffe.a
lib/libcaffe.so.1.0.0-rc5
lib/libcaffe.so
include/caffe/blob.hpp
include/caffe/layer.hpp
include/caffe/util/rng.hpp
include/caffe/util/blocking_queue.hpp
include/caffe/util/hdf5.hpp
include/caffe/util/cudnn.hpp
include/caffe/util/io.hpp
include/caffe/util/upgrade_proto.hpp
include/caffe/util/benchmark.hpp
include/caffe/util/nccl.hpp
include/caffe/util/signal_handler.h
include/caffe/util/gpu_util.cuh
include/caffe/util/format.hpp
include/caffe/util/mkl_alternate.hpp
include/caffe/util/db_leveldb.hpp
include/caffe/util/math_functions.hpp
include/caffe/util/insert_splits.hpp
include/caffe/util/db.hpp
include/caffe/util/db_lmdb.hpp
include/caffe/util/device_alternate.hpp
include/caffe/util/im2col.hpp
include/caffe/layers/softmax_layer.hpp
include/caffe/layers/cudnn_sigmoid_layer.hpp
include/caffe/layers/crop_layer.hpp
include/caffe/layers/cudnn_lcn_layer.hpp
include/caffe/layers/mvn_layer.hpp
include/caffe/layers/accuracy_layer.hpp
include/caffe/layers/cudnn_lrn_layer.hpp
include/caffe/layers/conv_layer.hpp
include/caffe/layers/python_layer.hpp
include/caffe/layers/dummy_data_layer.hpp
include/caffe/layers/spp_layer.hpp
include/caffe/layers/image_data_layer.hpp
include/caffe/layers/relu_layer.hpp
include/caffe/layers/inner_product_layer.hpp
include/caffe/layers/multinomial_logistic_loss_layer.hpp
include/caffe/layers/scale_layer.hpp
include/caffe/layers/exp_layer.hpp
include/caffe/layers/softmax_loss_layer.hpp
include/caffe/layers/recurrent_layer.hpp
include/caffe/layers/log_layer.hpp
include/caffe/layers/split_layer.hpp
include/caffe/layers/window_data_layer.hpp
include/caffe/layers/silence_layer.hpp
include/caffe/layers/reduction_layer.hpp
include/caffe/layers/slice_layer.hpp
include/caffe/layers/pooling_layer.hpp
include/caffe/layers/im2col_layer.hpp
include/caffe/layers/lrn_layer.hpp
include/caffe/layers/loss_layer.hpp
include/caffe/layers/data_layer.hpp
include/caffe/layers/tile_layer.hpp
include/caffe/layers/elu_layer.hpp
include/caffe/layers/parameter_layer.hpp
include/caffe/layers/cudnn_tanh_layer.hpp
include/caffe/layers/neuron_layer.hpp
include/caffe/layers/bnll_layer.hpp
include/caffe/layers/contrastive_loss_layer.hpp
include/caffe/layers/reshape_layer.hpp
include/caffe/layers/cudnn_pooling_layer.hpp
include/caffe/layers/threshold_layer.hpp
include/caffe/layers/rnn_layer.hpp
include/caffe/layers/lstm_layer.hpp
include/caffe/layers/memory_data_layer.hpp
include/caffe/layers/hinge_loss_layer.hpp
include/caffe/layers/euclidean_loss_layer.hpp
include/caffe/layers/prelu_layer.hpp
include/caffe/layers/flatten_layer.hpp
include/caffe/layers/dropout_layer.hpp
include/caffe/layers/cudnn_conv_layer.hpp
include/caffe/layers/argmax_layer.hpp
include/caffe/layers/base_data_layer.hpp
include/caffe/layers/power_layer.hpp
include/caffe/layers/cudnn_relu_layer.hpp
include/caffe/layers/deconv_layer.hpp
include/caffe/layers/concat_layer.hpp
include/caffe/layers/infogain_loss_layer.hpp
include/caffe/layers/sigmoid_cross_entropy_loss_layer.hpp
include/caffe/layers/sigmoid_layer.hpp
include/caffe/layers/filter_layer.hpp
include/caffe/layers/cudnn_softmax_layer.hpp
include/caffe/layers/absval_layer.hpp
include/caffe/layers/input_layer.hpp
include/caffe/layers/batch_norm_layer.hpp
include/caffe/layers/batch_reindex_layer.hpp
include/caffe/layers/hdf5_output_layer.hpp
include/caffe/layers/tanh_layer.hpp
include/caffe/layers/eltwise_layer.hpp
include/caffe/layers/bias_layer.hpp
include/caffe/layers/base_conv_layer.hpp
include/caffe/layers/hdf5_data_layer.hpp
include/caffe/layers/embed_layer.hpp
include/caffe/caffe.hpp
include/caffe/common.hpp
include/caffe/parallel.hpp
include/caffe/solver.hpp
include/caffe/proto/caffe.pb.h
include/caffe/net.hpp
include/caffe/sgd_solvers.hpp
include/caffe/solver_factory.hpp
include/caffe/data_transformer.hpp
include/caffe/layer_factory.hpp
include/caffe/internal_thread.hpp
include/caffe/syncedmem.hpp
include/caffe/filler.hpp
include/caffe/test/test_gradient_check_util.hpp
include/caffe/test/test_caffe_main.hpp
%%PYTHON_SITELIBDIR%%/caffe/_caffe.so
%%PYTHON_SITELIBDIR%%/caffe/coord_map.py
%%PYTHON_SITELIBDIR%%/caffe/io.py
%%PYTHON_SITELIBDIR%%/caffe/proto/__init__.py
%%PYTHON_SITELIBDIR%%/caffe/proto/caffe_pb2.py
%%PYTHON_SITELIBDIR%%/caffe/detector.py
%%PYTHON_SITELIBDIR%%/caffe/pycaffe.py
%%PYTHON_SITELIBDIR%%/caffe/draw.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_solver.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_net.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_python_layer_with_param_str.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_net_spec.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_io.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_python_layer.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_layer_type_list.py
%%PYTHON_SITELIBDIR%%/caffe/test/test_coord_map.py
%%PYTHON_SITELIBDIR%%/caffe/net_spec.py
%%PYTHON_SITELIBDIR%%/caffe/classifier.py
%%PYTHON_SITELIBDIR%%/caffe/__init__.py
%%PYTHON_SITELIBDIR%%/caffe/imagenet/ilsvrc_2012_mean.npy
%%PYTHON_SITELIBDIR%%/caffe/_caffe.cpp
%%DATADIR%%/proto/caffe.proto
@dir %%DATADIR%%/proto
@dir %%DATADIR%%