File tree Expand file tree Collapse file tree 6 files changed +30
-38
lines changed Expand file tree Collapse file tree 6 files changed +30
-38
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,21 @@ include_directories("${PROJ_ROOT}/paddle/cuda/include")
72
72
include_directories ("${CMAKE_CURRENT_BINARY_DIR} /proto" )
73
73
74
74
set (EXTERNAL_LIBS
75
- # have not include gtest here.
76
75
${GFLAGS_LIBRARIES}
77
76
${GLOG_LIBRARIES}
78
77
${CBLAS_LIBRARIES}
79
78
${PROTOBUF_LIBRARY}
80
79
${ZLIB_LIBRARIES}
80
+ ${PYTHON_LIBRARIES}
81
81
)
82
82
83
+ if (WITH_GPU)
84
+ list (APPEND EXTERNAL_LIB ${CUDA_LIBRARIES} ${CUDA_rt_LIBRARY} )
85
+ if (NOT WITH_DSO)
86
+ list (APPEND EXTERNAL_LIB ${CUDNN_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_curand_LIBRARY} )
87
+ endif (NOT WITH_DSO)
88
+ endif (WITH_GPU)
89
+
83
90
add_subdirectory (proto)
84
91
add_subdirectory (paddle)
85
92
add_subdirectory (python)
Original file line number Diff line number Diff line change @@ -216,7 +216,3 @@ ENDIF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
216
216
217
217
INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_DIR} )
218
218
INCLUDE_DIRECTORIES (${PYTHON_NUMPY_INCLUDE_DIR} )
219
-
220
- MESSAGE ("[Paddle] Python Executable: ${PYTHON_EXECUTABLE} " )
221
- MESSAGE ("[Paddle] Python Include: ${PYTHON_INCLUDE_DIRS} " )
222
- MESSAGE ("[Paddle] Python Libraries: ${PYTHON_LIBRARIES} " )
Original file line number Diff line number Diff line change @@ -95,32 +95,12 @@ function(link_paddle_exe TARGET_NAME)
95
95
paddle_parameter
96
96
paddle_proto
97
97
paddle_cuda
98
- ${METRIC_LIBS}
99
98
${EXTERNAL_LIBS}
100
99
${CMAKE_THREAD_LIBS_INIT}
101
100
${CMAKE_DL_LIBS}
102
101
${RDMA_LD_FLAGS}
103
102
${RDMA_LIBS} )
104
103
105
- if (WITH_PYTHON)
106
- target_link_libraries (${TARGET_NAME}
107
- ${PYTHON_LIBRARIES} util)
108
- endif ()
109
-
110
- if (WITH_GPU)
111
- if (NOT WITH_DSO OR WITH_METRIC)
112
- target_link_libraries (${TARGET_NAME}
113
- ${CUDNN_LIBRARY}
114
- ${CUDA_curand_LIBRARY} )
115
- CUDA_ADD_CUBLAS_TO_TARGET(${TARGET_NAME} )
116
- endif ()
117
-
118
- check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME )
119
- if (HAVE_CLOCK_GETTIME)
120
- target_link_libraries (${TARGET_NAME} rt)
121
- endif ()
122
- endif ()
123
-
124
104
add_dependencies (${TARGET_NAME} ${external_project_dependencies} )
125
105
endfunction ()
126
106
Original file line number Diff line number Diff line change @@ -45,28 +45,33 @@ SET(SWIG_MODULE_swig_paddle_EXTRA_DEPS
45
45
46
46
IF (APPLE )
47
47
SET (CMAKE_LINK_FLAGS "-undefined dynamic_lookup -Wl,-all_load" )
48
+ ELSE (APPLE )
49
+ SET (ARCHIVE_START "-Wl,--whole-archive" )
50
+ SET (ARCHIVE_END "-Wl,--no-whole-archive" )
48
51
ENDIF (APPLE )
49
52
50
53
SWIG_ADD_MODULE(swig_paddle python Paddle.i)
51
54
SWIG_LINK_LIBRARIES(swig_paddle
52
55
${CMAKE_LINK_FLAGS}
53
56
${CMAKE_DL_LIBS}
54
57
${EXTERNAL_LIBS}
55
- ${PYTHON_LIBRARIES}
56
58
${CMAKE_THREAD_LIBS_INIT}
57
59
${RDMA_LD_FLAGS}
58
60
${RDMA_LIBS}
59
61
paddle_parameter
60
- paddle_function
61
62
paddle_math
62
63
paddle_utils
63
- paddle_gserver
64
64
paddle_pserver
65
65
paddle_api
66
66
paddle_cuda
67
67
paddle_trainer_lib
68
68
paddle_network
69
69
paddle_proto
70
+ ARCHIVE_START
71
+ paddle_gserver
72
+ paddle_function
73
+ ${METRIC_LIBS}
74
+ ARCHIVE_END
70
75
)
71
76
72
77
add_custom_command (OUTPUT ${PROJ_ROOT} /paddle/dist/.timestamp
Original file line number Diff line number Diff line change @@ -20,7 +20,11 @@ popd > /dev/null
20
20
21
21
cd $SCRIPTPATH
22
22
23
- $1 -m pip install ../../dist/* .whl
23
+ rm -rf .test_env
24
+ virtualenv .test_env
25
+ source .test_env/bin/activate
26
+
27
+ python -m pip install ../../dist/* .whl
24
28
25
29
test_list=" testArguments.py testGradientMachine.py testMatrix.py testVector.py testTrain.py testTrainer.py"
26
30
@@ -29,7 +33,7 @@ export PYTHONPATH=$PWD/../../../python/
29
33
for fn in $test_list
30
34
do
31
35
echo " test $fn "
32
- $1 $fn
36
+ python $fn
33
37
if [ $? -ne 0 ]; then
34
38
exit 1
35
39
fi
Original file line number Diff line number Diff line change 16
16
from setuptools import setup, Extension
17
17
18
18
setup(name="py_paddle",
19
- version="@PADDLE_VERSION@",
20
- packages=['py_paddle'],
21
- include_package_data=True,
22
- package_data={'py_paddle':['*.py','_swig_paddle.so']},
23
- install_requires = [
24
- 'numpy>=1.8.0', # The numpy is required.
25
- 'protobuf>=2.4.1' # The paddle protobuf version
26
- ],
19
+ version="@PADDLE_VERSION@",
20
+ packages=['py_paddle'],
21
+ include_package_data=True,
22
+ package_data={'py_paddle':['*.py','_swig_paddle.so']},
23
+ install_requires = [
24
+ 'numpy>=1.8.0', # The numpy is required.
25
+ 'protobuf>=2.4.1' # The paddle protobuf version
26
+ ],
27
27
)
You can’t perform that action at this time.
0 commit comments