Return-Path: X-Original-To: apmail-singa-commits-archive@minotaur.apache.org Delivered-To: apmail-singa-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8E0C182D8 for ; Tue, 23 Feb 2016 06:20:46 +0000 (UTC) Received: (qmail 90677 invoked by uid 500); 23 Feb 2016 06:20:43 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 90650 invoked by uid 500); 23 Feb 2016 06:20:43 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 90641 invoked by uid 99); 23 Feb 2016 06:20:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2016 06:20:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 37EECC1338 for ; Tue, 23 Feb 2016 06:20:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id O96IrgqH0Hqn for ; Tue, 23 Feb 2016 06:20:40 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 9B12B5F60D for ; Tue, 23 Feb 2016 06:20:39 +0000 (UTC) Received: (qmail 90378 invoked by uid 99); 23 Feb 2016 06:20:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2016 06:20:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7D823E0667; Tue, 23 Feb 2016 06:20:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangwei@apache.org To: commits@singa.incubator.apache.org Date: Tue, 23 Feb 2016 06:20:40 -0000 Message-Id: <272166ca31614e92831b628866d87298@git.apache.org> In-Reply-To: <092c059c0a244475b7c119dd7fa51c19@git.apache.org> References: <092c059c0a244475b7c119dd7fa51c19@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] incubator-singa git commit: SINGA-112 Clean GNU configure and make code SINGA-112 Clean GNU configure and make code Clean the compilation codes and add some comments. Delete cuda and cudnn related files when run `make clean'. Delete cxx files generated by swig and add guidance in README. Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/c1444b7d Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/c1444b7d Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/c1444b7d Branch: refs/heads/master Commit: c1444b7d28a24312dec071a2f9ebf9ce6687772a Parents: 5526c51 Author: xiezl Authored: Sat Jan 30 17:33:17 2016 +0800 Committer: xiezl Committed: Mon Feb 1 14:03:16 2016 +0800 ---------------------------------------------------------------------- Makefile.am | 22 +- README.md | 9 +- autogen.sh | 2 +- configure.ac | 9 +- tool/python/singa/driver_wrap.cxx | 5409 -------------------------------- tool/python/singa/generatepy.sh | 13 +- 6 files changed, 30 insertions(+), 5434 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c1444b7d/Makefile.am ---------------------------------------------------------------------- diff --git a/Makefile.am b/Makefile.am index a432dc8..dd97844 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,7 +168,6 @@ lib_LTLIBRARIES = libsinga.la $(LTLIBS) bin_PROGRAMS = singa singatool $(PROGS) pydir = $(CURDIR)/tool/python/singa/ py_LTLIBRARIES = $(PY_PROGS) -#py_LTLIBRARIES = $(PY_PROGS) #lib_LTLIBRARIES = libsinga.la libsinga_la_SOURCES = $(PROTO_SRCS) $(SINGA_SRCS) @@ -202,7 +201,6 @@ singa_CXXFLAGS = $(DEFAULT_FLAGS) -MMD -I$(top_srcdir)/include singa_LDFLAGS = -lsinga \ -lglog \ -lprotobuf \ - #-lrt \ -lopenblas \ -lzmq \ -lczmq \ @@ -237,18 +235,6 @@ singatool_LDFLAGS = -lsinga \ -lprotobuf \ -lzookeeper_mt -#if DCUDA -#singatool_SOURCES += $(CUDA_SRCS) $(CUDA_HDRS) -#singatool_CXXFLAGS += $(CUDA_CFLAGS) -#singatool_LDFLAGS += $(CUDA_LDFLAGS) $(CUDA_LIBS) -#endif - -#if DCUDNN -#singatool_SOURCES += $(CUDNN_SRCS) -#singatool_CXXFLAGS += $(CUDNN_CFLAGS) -#singatool_LDFLAGS += $(CUDNN_LDFLAGS) $(CUDNN_LIBS) -#endif - if DHDFS singatool_SOURCES += $(HDFS_SRCS) singatool_CXXFLAGS += $(HDFS_CFLAGS) @@ -270,7 +256,6 @@ singatest_LDADD = ./libgtest.la singatest_LDFLAGS = -lsinga \ -lglog \ -lprotobuf \ - #-lrt \ -lopenblas \ -lzmq \ -lczmq \ @@ -309,9 +294,12 @@ endif clean-local: rm -rf $(PROTO_SRCS) $(PROTO_HDRS) rm -rf $(PROTO_PYS) + rm -rf neuralnet/neuron_layer/*.o + rm -rf src/utils/math_kernel.o rm -rf rat_check rm -rf tool/python/pb2 +# Add scrips for py driver installation all-local: @if [ -f ".libs/_driver.so" ]; then \ echo "Copy libs for python wrapper"; \ @@ -319,6 +307,7 @@ all-local: touch tool/python/singa/__init__.py; \ fi +# For rat check rat: @if test ! -z '$(shell command -v java 2>/dev/null)'; then \ if test ! -z '$(shell echo $$RAT_PATH)'; then \ @@ -334,9 +323,11 @@ rat: .cu.o: .cu $(NVCC) $(MSHADOW_FLAGS) --shared -Xcompiler -fPIC $(CUDA_CFLAGS) $(CUDA_LDFLAGS) $(CUDA_LIBS) -I$(top_srcdir)/include -std=c++11 -G -c -o $@ $< +# Generate gpu libs for singa libsingagpu.so: $(CUDA_OBJS) $(NVCC) -o libsingagpu.so -shared -Xcompiler -fPIC $(CUDA_OBJS) $(CUDA_CFLAGS) $(CUDA_LDFLAGS) $(CUDA_LIBS) -I$(top_srcdir)/include -std=c++11 -G +# Create python class files install-pyLTLIBRARIES: $(py_LTLIBRARIES) touch tool/python/singa/__init__.py cp -f .libs/_driver.so tool/python/singa/ @@ -345,6 +336,7 @@ uninstall-pyLTLIBRARIES: rm -f tool/python/singa/__init__.py rm -f tool/python/singa/_driver.so +# For autorun singatest test: singatest @./singatest http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c1444b7d/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index d9d2e94..0749309 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ For advanced features, the following libraries are needed: * `Apache Mesos` (Apache 2.0) * `Apache Hadoop` (Apache 2.0) * `libhdfs3` (Apache 2.0) + * `swig` (GPL) ##Documentation @@ -71,11 +72,17 @@ To compile with HDFS support, you should run: --with-libhdfs is optional as by default the path is /usr/local/. +To compile with python wrappers, you should run: + + $ ./tool/python/singa/generatepy.sh + $ ./configure --enable-python --with-python=/PATH/TO/Python.h + +--with-python is optinal as by default the path is /usr/local/include. + You can also run the following command for further configuration. $ ./configure --help - ##Running Examples Let us train the [CNN model](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) over the http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c1444b7d/autogen.sh ---------------------------------------------------------------------- diff --git a/autogen.sh b/autogen.sh index 1960c15..f41a815 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,3 +1,4 @@ +#!/bin/sh #/** # * Copyright 2015 The Apache Software Foundation # * @@ -17,7 +18,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. # */ -#!/bin/sh mkdir -p ./config; aclocal; http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c1444b7d/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 2377fa9..c7f1877 100644 --- a/configure.ac +++ b/configure.ac @@ -93,7 +93,7 @@ AC_SUBST(CUDA_LDFLAGS) AC_SUBST(CUDA_LIBS) AC_SUBST(CUDA_CFLAGS) -# Setup custom CUDA paths +# Setup custom CUDNN paths AC_ARG_ENABLE([cudnn], [AS_HELP_STRING(--enable-cudnn,enable CUDNN support)], [enable_cudnn=yes], [enable_cudnn=no]) @@ -146,6 +146,7 @@ AC_CHECK_LIB([protobuf], [main], [], [ AC_MSG_ERROR([unable to find protobuf library]) ]) +# Setup custom lmdb paths AC_ARG_ENABLE(lmdb, AS_HELP_STRING([--enable-lmdb],[enable debug option]), [enable_lmdb=yes],[enable_lmdb=no]) @@ -159,6 +160,7 @@ fi PROGS='' LTLIBS='' +# Setup custom libhdfs paths AC_ARG_ENABLE(hdfs, AS_HELP_STRING([--enable-hdfs],[enable hdfs support]), [enable_hdfs=yes],[enable_hdfs=no]) @@ -194,6 +196,7 @@ AC_SUBST(HDFS_CFLAGS) AC_SUBST(HDFS_LDFLAGS) AC_SUBST(HDFS_LIBS) +# Setup for test args AC_ARG_ENABLE(test, AS_HELP_STRING([--enable-test],[enable singa test]), [enable_test=yes],[enable_test=no]) @@ -206,6 +209,7 @@ else LTLIBS+='' fi +# Setup for debug args AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debug mode]), [enable_debug=yes],[enable_debug=no]) @@ -216,6 +220,7 @@ else DEBUG+=' -O2' fi +# Setup for python args AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[enable python binding])], [enable_python=yes],[enable_python=no]) @@ -230,6 +235,7 @@ if test x"$enable_python" != x"no"; then fi AC_SUBST(PYLIBS) +# Setup for python paths AC_ARG_WITH([python], [AS_HELP_STRING([--with-python=PATH],[prefix where python is installed])], [python_prefix=$withval],[python_prefix="/usr/include/python`python -V 2>&1 | awk '{print substr($2,1,3)}'`"]) @@ -263,6 +269,7 @@ AC_SUBST([DEBUG]) AC_SUBST([PYFLAGS]) AC_SUBST([PY_PROGS]) +# Setup for opencv libs #AC_CHECK_LIB([opencv_imgproc], [main], [], [ # AC_MSG_ERROR([unable to find opencv_imgproc lib]) # ])