Repository: incubator-singa Updated Branches: refs/heads/master 6fbc4e902 -> a3f34cb07
SINGA-303 Create conda packages Add scripts and configurations for building SINGA packages using conda tools. Build success; Uploaded to anaconda manually; TODO: integrate with travis and jenkins to upload the packages automatically Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/5d172664 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/5d172664 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/5d172664 Branch: refs/heads/master Commit: 5d1726646d28103f8cd904b8c7cc7db19cd38329 Parents: 6fbc4e9 Author: xiezl <[email protected]> Authored: Mon Feb 20 00:00:20 2017 +0800 Committer: Wei Wang <[email protected]> Committed: Wed Feb 22 16:41:00 2017 +0800 ---------------------------------------------------------------------- CMakeLists.txt | 3 ++- python/CMakeLists.txt | 11 ----------- python/setup.py.in | 2 +- tool/conda/build.sh | 10 ++++++++++ tool/conda/meta.yaml | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d172664/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 61c708d..d7acd09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ 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 ) +INSTALL(CODE "execute_process(COMMAND python setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python)") http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d172664/python/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index d8a0f2d..7445a57 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -129,14 +129,3 @@ CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY}) #create python/singa/proto/__init__.py FILE(WRITE ${CMAKE_BINARY_DIR}/python/singa/proto/__init__.py "") -#MESSAGE(STATUS "apple: ${APPLE}") -IF(APPLE) -ADD_CUSTOM_TARGET( - change_suffix ALL - COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_BINARY_DIR}/python/singa/_singa_wrap.dylib" "${CMAKE_BINARY_DIR}/python/singa/_singa_wrap.so" - COMMENT "change .dylib to .so in mac system" -) -ADD_DEPENDENCIES(change_suffix _singa_wrap) -ENDIF(APPLE) - - http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d172664/python/setup.py.in ---------------------------------------------------------------------- diff --git a/python/setup.py.in b/python/setup.py.in index 30be063..dbe779c 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -81,7 +81,7 @@ setup( #have to be included in MANIFEST.in as well. package_data={ - 'singa': ['_singa_wrap.so'], + 'singa': ['_singa_wrap.*'], }, #Although 'package_data' is the preferred approach, in some case you may http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d172664/tool/conda/build.sh ---------------------------------------------------------------------- diff --git a/tool/conda/build.sh b/tool/conda/build.sh new file mode 100644 index 0000000..414bd49 --- /dev/null +++ b/tool/conda/build.sh @@ -0,0 +1,10 @@ +export CMAKE_PREFIX_PATH=$PREFIX +export export CPLUS_INCLUDE_PATH=`python -c "import numpy; print numpy.get_include()"`:$CPLUS_INCLUDE_PATH + +echo $PREFIX + +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=$PREFIX .. +make +make install http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/5d172664/tool/conda/meta.yaml ---------------------------------------------------------------------- diff --git a/tool/conda/meta.yaml b/tool/conda/meta.yaml new file mode 100644 index 0000000..95fbc58 --- /dev/null +++ b/tool/conda/meta.yaml @@ -0,0 +1,35 @@ +package: + name: singa + version: "1.1.0" + +source: + git_url: https://github.com/nudles/incubator-singa.git + + +build: + number: {{ GIT_DESCRIBE_NUMBER }} + +requirements: + build: + - python 2.7* + - numpy >=1.10 + - swig >=3.0 + - openblas >=0.2.10 + - libprotobuf >=2.5,<2.7 + - glog # [osx] + + run: + - python 2.7* + - numpy >=1.10 + - libprotobuf >=2.5,<3.0 + - openblas >=0.2.10 + - flask >=0.10.1 + - flask_cors >=3.0.2 + - pillow >=2.3.0 + - unittest-xml-reporting + - glog # [osx] + +about: + home: http://singa.apache.org/ + license: Apache V2 + license_file: LICENSE
