Merge PR #309; test passed for non-python version;
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/97781d04 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/97781d04 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/97781d04 Branch: refs/heads/master Commit: 97781d046235a67a841998ce7a6111dc7a68f45e Parents: e8e4660 cde701a Author: wangwei <[email protected]> Authored: Sat Mar 4 16:39:15 2017 +0000 Committer: wangwei <[email protected]> Committed: Sat Mar 4 16:39:15 2017 +0000 ---------------------------------------------------------------------- CMakeLists.txt | 37 +++++++ tool/debian/build.sh | 153 -------------------------- tool/debian/python-singa/DEBIAN/control | 14 --- tool/debian/python-singa/DEBIAN/postinst | 20 ---- tool/debian/python-singa/DEBIAN/postrm | 20 ---- tool/debian/singa/DEBIAN/control | 12 -- 6 files changed, 37 insertions(+), 219 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/97781d04/CMakeLists.txt ---------------------------------------------------------------------- diff --cc CMakeLists.txt index 35e6222,8ee2824..59bb4e3 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -168,7 -160,56 +168,44 @@@ ENDIF( INSTALL(DIRECTORY include/singa DESTINATION ${CMAKE_INSTALL_PREFIX}/include) INSTALL(FILES ${CMAKE_BINARY_DIR}/include/singa/singa_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/singa) -INSTALL (DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION +INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN "*libgtest.a" EXCLUDE ) + -IF (USE_PYTHON) -INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/python - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa) - -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 ${CMAKE_BINARY_DIR}/python/singa/proto - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/singa/python/singa) -ENDIF() +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 <[email protected]>") + 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" ) ++ #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") + ELSE() + SET(CPACK_DEBIAN_PACKAGE_NAME "python-singa") + SET(CPACK_PACKAGE_FILE_NAME "python-singa-${PACKAGE_VERSION}") + SET(CPACK_DEBIAN_PACKAGE_PREDEPENDS "ca-certificates") + ENDIF() + ELSE() + SET(CPACK_DEBIAN_PACKAGE_NAME "singa") + SET(CPACK_PACKAGE_FILE_NAME "singa-${PACKAGE_VERSION}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CORE_DEPENDENCIES}) + ENDIF() + INCLUDE(CPack)
