You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2016/02/23 07:20:40 UTC
[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 <xi...@comp.nus.edu.sg>
Authored: Sat Jan 30 17:33:17 2016 +0800
Committer: xiezl <xi...@comp.nus.edu.sg>
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])
# ])