singa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wang...@apache.org
Subject [1/2] incubator-singa git commit: SINGA-274 Improve Debian packaging with CPack
Date Fri, 07 Apr 2017 06:58:30 GMT
Repository: incubator-singa
Updated Branches:
  refs/heads/master e0cae3c30 -> 85dbad744


SINGA-274 Improve Debian packaging with CPack


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/5d50f22f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/5d50f22f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/5d50f22f

Branch: refs/heads/master
Commit: 5d50f22f0e5a303e5690a0de5d79455c5d4f86eb
Parents: 0d4b97e
Author: Moaz Reyad <moazreyad@gmail.com>
Authored: Fri Mar 17 19:38:19 2017 +0800
Committer: Moaz Reyad <moazreyad@gmail.com>
Committed: Tue Apr 4 11:05:28 2017 +0800

----------------------------------------------------------------------
 CMakeLists.txt       | 74 ++++++++++++++++++++++++++++-------------------
 src/model/rnn.cc     | 27 -----------------
 tool/debian/postinst | 21 ++++++++++++++
 3 files changed, 65 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d50f22f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 627c217..7dd1b57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,37 +172,51 @@ INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION ${CMAKE_INSTALL_PREFIX}
PA
 INSTALL(CODE "execute_process(COMMAND python setup.py install --prefix=${CMAKE_INSTALL_PREFIX}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python)")
 
 # CPack
-IF (USE_MODULES)
-	SET(CORE_DEPENDENCIES "libgoogle-glog-dev, libstdc++6, libc6")
-ELSE()
-	SET(CORE_DEPENDENCIES "libgoogle-glog-dev, libprotobuf-dev, libopenblas-dev, libstdc++6,
libc6")
-ENDIF()
-
-SET(PYTHON_DEPENDENCIES "${CORE_DEPENDENCIES}, python-dev, libpython2.7, python-pip, python-numpy,
python-pillow")
-
-SET(CPACK_GENERATOR "DEB")
-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Apache Incubator <dev@singa.incubator.apache.org>")
-SET(CPACK_DEBIAN_PACKAGE_VERSION ${PACKAGE_VERSION})
-SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
-SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
-SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://singa.apache.org")
-SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Singa is an Apache Incubating project for developing
an open source deep learning library.
- The Singa project was initiated by the DB System Group at National University of Singapore
in 2014. It focused on distributed deep learning by partitioning the model and data onto nodes
in a cluster and parallelize the training. The prototype was accepted by Apache Incubator
in March 2015.")
-IF (USE_PYTHON)
-	SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PYTHON_DEPENDENCIES})
-        #SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/tool/debian/postinst;${PROJECT_SOURCE_DIR}/tool/debian/postrm"
)
-	IF (USE_CUDA)
-		SET(CPACK_DEBIAN_PACKAGE_NAME "python-singa-cuda")
-		SET(CPACK_PACKAGE_FILE_NAME "python-singa-cuda-${PACKAGE_VERSION}")
-		SET(CPACK_DEBIAN_PACKAGE_PREDEPENDS "ca-certificates, cuda-cudart-8-0, cuda-curand-8-0")
+IF(PACKAGE)
+	IF(USE_PYTHON)
+		INSTALL(FILES ${CMAKE_BINARY_DIR}/python/setup.py 
+			DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa/python)
+		INSTALL(FILES ${CMAKE_BINARY_DIR}/python/singa/singa_wrap.py
+			DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa/python/singa)
+		INSTALL(FILES ${CMAKE_BINARY_DIR}/python/singa/_singa_wrap.so
+			DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa/python/singa)
+		INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/python 
+			DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa)	
+		INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/python/singa/proto
+			DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa/python/singa)	
+	ENDIF()
+    
+	IF (USE_MODULES)
+		SET(CORE_DEPENDENCIES "libgoogle-glog-dev, libstdc++6, libc6")
 	ELSE()
-		SET(CPACK_DEBIAN_PACKAGE_NAME "python-singa")
-		SET(CPACK_PACKAGE_FILE_NAME "python-singa-${PACKAGE_VERSION}")
+		SET(CORE_DEPENDENCIES "libgoogle-glog-dev, libprotobuf-dev, libopenblas-dev, libstdc++6,
libc6")
+	ENDIF()
+
+	SET(PYTHON_DEPENDENCIES "${CORE_DEPENDENCIES}, python-dev, libpython2.7, python-pip, python-numpy,
python-pillow")
+
+	SET(CPACK_GENERATOR "DEB")
+	SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Apache Incubator <dev@singa.incubator.apache.org>")
+	SET(CPACK_DEBIAN_PACKAGE_VERSION ${PACKAGE_VERSION})
+	SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
+	SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
+	SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://singa.apache.org")
+	SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Singa is an Apache Incubating project for developing
an open source deep learning library.
+	 The Singa project was initiated by the DB System Group at National University of Singapore
in 2014. It focused on distributed deep learning by partitioning the model and data onto nodes
in a cluster and parallelize the training. The prototype was accepted by Apache Incubator
in March 2015.")
+	IF (USE_PYTHON)
+		SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PYTHON_DEPENDENCIES})
+		SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/tool/debian/postinst" )
 		SET(CPACK_DEBIAN_PACKAGE_PREDEPENDS "ca-certificates")
+		IF (USE_CUDA)
+			SET(CPACK_DEBIAN_PACKAGE_NAME "python-singa-cuda")
+			SET(CPACK_PACKAGE_FILE_NAME "python-singa-cuda-${PACKAGE_VERSION}")
+		ELSE()
+			SET(CPACK_DEBIAN_PACKAGE_NAME "python-singa")
+			SET(CPACK_PACKAGE_FILE_NAME "python-singa-${PACKAGE_VERSION}")
+		ENDIF()
+	ELSE()
+		SET(CPACK_DEBIAN_PACKAGE_NAME "singa")
+		SET(CPACK_PACKAGE_FILE_NAME "singa-${PACKAGE_VERSION}")
+		SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CORE_DEPENDENCIES})
 	ENDIF()
-ELSE()
-	SET(CPACK_DEBIAN_PACKAGE_NAME "singa")
-	SET(CPACK_PACKAGE_FILE_NAME "singa-${PACKAGE_VERSION}")
-        SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CORE_DEPENDENCIES})
+	INCLUDE(CPack)
 ENDIF()
-INCLUDE(CPack)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d50f22f/src/model/rnn.cc
----------------------------------------------------------------------
diff --git a/src/model/rnn.cc b/src/model/rnn.cc
deleted file mode 100644
index d1a7d2c..0000000
--- a/src/model/rnn.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-namespace singa {
-
-
-
-
-
-
-}  /* singa */

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d50f22f/tool/debian/postinst
----------------------------------------------------------------------
diff --git a/tool/debian/postinst b/tool/debian/postinst
new file mode 100644
index 0000000..2d63734
--- /dev/null
+++ b/tool/debian/postinst
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+pip install /usr/local/lib/singa/python
+rm -r /usr/local/lib/singa
+


Mime
View raw message