提交 613462ec 编写于 作者: Y yuyang18

Remove hard code in swig_paddle install script

ISSUE=4582455



git-svn-id: https://svn.baidu.com/idl/trunk/paddle@1419 1ad973e4-5ce8-4261-8a94-b56d1f490c56
上级 990f660b
......@@ -40,3 +40,4 @@ py_paddle/paddle.py
HPPL_ERROR_LOG
unittest.list
proto
dist
......@@ -40,14 +40,11 @@ configure_file(
generate_python_api(python_swig_sources)
set(PY_PADDLE_WHEEL_NAME
${PROJ_ROOT}/paddle/py_paddle-0.1.1a10-cp27-none-linux_x86_64.whl)
# TODO(yuyang18) : make wheel name calculated by cmake
add_custom_command(OUTPUT ${PY_PADDLE_WHEEL_NAME}
COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_wheel &&
cp dist/*.whl . &&
rm -rf dist py_paddle.egg-info build
add_custom_command(OUTPUT ${PROJ_ROOT}/paddle/dist/.timestamp
COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_wheel
COMMAND ${CMAKE_COMMAND} -E touch dist/.timestamp
COMMAND rm -rf py_paddle.egg-info build
WORKING_DIRECTORY ${PROJ_ROOT}/paddle
DEPENDS python_swig_sources
paddle_parameter
......@@ -60,11 +57,12 @@ add_custom_command(OUTPUT ${PY_PADDLE_WHEEL_NAME}
paddle_cuda
)
install(FILES ${PY_PADDLE_WHEEL_NAME}
DESTINATION opt/paddle/share/wheels)
install(DIRECTORY ${PROJ_ROOT}/paddle/dist/
DESTINATION opt/paddle/share/wheels
)
add_custom_target(python_api_wheel ALL DEPENDS
${PY_PADDLE_WHEEL_NAME})
${PROJ_ROOT}/paddle/dist/.timestamp)
if(WITH_TESTING)
add_subdirectory(test)
......
......@@ -20,7 +20,7 @@ popd > /dev/null
cd $SCRIPTPATH
if [ ! -f ../../*.whl ] ; then # Swig not compiled.
if [ ! -f ../../dist/*.whl ] ; then # Swig not compiled.
exit 0
fi
......@@ -28,7 +28,7 @@ rm .test_env -rf
virtualenv .test_env
source .test_env/bin/activate
pip --timeout 600 install ../../*.whl
pip --timeout 600 install ../../dist/*.whl
test_list="testArguments.py testGradientMachine.py testMatrix.py testVector.py testTrain.py"
......
......@@ -48,4 +48,5 @@ setup(name="py_paddle",
install_requires = [
'numpy>=1.10.1', # The numpy is required.
'protobuf>=2.4.1' # The paddle protobuf version
])
],
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册