@@ -33,9 +33,7 @@ if(WIN32)
33
33
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj /MT" )
34
34
endif (WIN32 )
35
35
36
- if (NOT CMAKE_CROSSCOMPILING )
37
- find_package (CUDA QUIET )
38
- endif (NOT CMAKE_CROSSCOMPILING )
36
+ find_package (CUDA QUIET )
39
37
find_package (Git REQUIRED )
40
38
find_package (Threads REQUIRED )
41
39
@@ -49,7 +47,6 @@ option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FO
49
47
option (WITH_NGRAPH "Compile PaddlePaddle with nGraph support." OFF )
50
48
option (WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON )
51
49
option (WITH_TESTING "Compile PaddlePaddle with unit testing" OFF )
52
- option (WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON )
53
50
option (WITH_PYTHON "Compile PaddlePaddle with python interpreter" ON )
54
51
option (WITH_DOUBLE "Compile PaddlePaddle with double precision" OFF )
55
52
option (WITH_RDMA "Compile PaddlePaddle with RDMA support" OFF )
@@ -60,11 +57,9 @@ option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
60
57
option (WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF )
61
58
option (COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF )
62
59
option (ON_TRAVIS "Exclude special unit test on Travis CI" OFF )
63
- option (WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF )
64
60
option (WITH_FLUID_ONLY "Compile PaddlePaddle fluid only" OFF )
65
61
option (WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF )
66
62
option (GLIDE_INSTALL "Download and install go dependencies " ON )
67
- option (USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF )
68
63
option (WITH_DISTRIBUTE "Compile with distributed support" OFF )
69
64
option (WITH_PSLIB "Compile with pslib support" OFF )
70
65
option (USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF )
@@ -96,37 +91,6 @@ if(NOT CMAKE_BUILD_TYPE)
96
91
FORCE )
97
92
endif ()
98
93
99
- if (ANDROID OR IOS )
100
- if (ANDROID )
101
- if (${CMAKE_SYSTEM_VERSION} VERSION_LESS "16" )
102
- message (FATAL_ERROR "Unsupport standalone toolchains with Android API level lower than 16" )
103
- endif ()
104
- endif ()
105
-
106
- set (WITH_GPU OFF CACHE STRING
107
- "Disable GPU when cross-compiling for Android and iOS" FORCE )
108
- set (WITH_AVX OFF CACHE STRING
109
- "Disable AVX when cross-compiling for Android and iOS" FORCE )
110
- set (WITH_PYTHON OFF CACHE STRING
111
- "Disable PYTHON when cross-compiling for Android and iOS" FORCE )
112
- set (WITH_RDMA OFF CACHE STRING
113
- "Disable RDMA when cross-compiling for Android and iOS" FORCE )
114
- set (WITH_MKL OFF CACHE STRING
115
- "Disable MKL when cross-compiling for Android and iOS" FORCE )
116
- set (WITH_NGRAPH OFF CACHE STRING
117
- "Disable nGraph when cross-compiling for Android and iOS" FORCE )
118
- set (WITH_GOLANG OFF CACHE STRING
119
- "Disable golang when cross-compiling for Android and iOS" FORCE )
120
-
121
- # Compile PaddlePaddle mobile inference library
122
- if (NOT WITH_C_API )
123
- set (WITH_C_API ON CACHE STRING
124
- "Always compile the C_API when cross-compiling for Android and iOS" FORCE )
125
- endif ()
126
- set (MOBILE_INFERENCE ON )
127
- add_definitions (-DPADDLE_MOBILE_INFERENCE )
128
- endif ()
129
-
130
94
if (APPLE )
131
95
set (WITH_MKL OFF CACHE STRING
132
96
"Disable MKL for building on mac" FORCE )
@@ -135,8 +99,6 @@ endif()
135
99
if (WIN32 )
136
100
set (WITH_DISTRIBUTE OFF CACHE STRING
137
101
"Disable DISTRIBUTE when compiling for Windows" FORCE )
138
- set (WITH_C_API OFF CACHE STRING
139
- "Disable C_API when compiling for Windows" FORCE )
140
102
set (WITH_FLUID_ONLY ON CACHE STRING
141
103
"Enable FLUID_ONLY when compiling for Windows" FORCE )
142
104
endif ()
@@ -150,21 +112,7 @@ set(FLUID_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_install_dir" CACHE STRING
150
112
set (FLUID_INFERENCE_INSTALL_DIR "${CMAKE_BINARY_DIR} /fluid_inference_install_dir" CACHE STRING
151
113
"A path setting fluid inference shared and static libraries" )
152
114
153
- if (WITH_C_API AND WITH_PYTHON )
154
- message (WARNING "It is suggest not embedded a python interpreter in Paddle "
155
- "when using C-API. It will give an unpredictable behavior when using a "
156
- "different Python interpreter from compiling." )
157
- endif ()
158
-
159
- if (WITH_C_API )
160
- set (WITH_FLUID_ONLY OFF CACHE STRING "Disable install fluid when compile the C_API" FORCE )
161
- endif ()
162
-
163
- if (MOBILE_INFERENCE )
164
- set (THIRD_PARTY_BUILD_TYPE MinSizeRel )
165
- else ()
166
- set (THIRD_PARTY_BUILD_TYPE Release )
167
- endif ()
115
+ set (THIRD_PARTY_BUILD_TYPE Release )
168
116
169
117
set (WITH_MKLML ${WITH_MKL} )
170
118
if (NOT DEFINED WITH_MKLDNN )
@@ -193,7 +141,6 @@ include(external/python) # download, build, install python
193
141
include (external/openblas ) # download, build, install openblas
194
142
include (external/mkldnn ) # download, build, install mkldnn
195
143
include (external/ngraph ) # download, build, install nGraph
196
- include (external/swig ) # download, build, install swig
197
144
include (external/boost ) # download boost
198
145
include (external/any ) # download libn::any
199
146
include (external/eigen ) # download eigen3
@@ -265,7 +212,7 @@ endif()
265
212
if (WITH_JEMALLOC )
266
213
find_package (JeMalloc REQUIRED )
267
214
include_directories (${JEMALLOC_INCLUDE_DIR} )
268
- add_definitions (-DWITH_JEMALLOC )
215
+ add_definitions (-DPADDLE_WITH_JEMALLOC )
269
216
endif ()
270
217
271
218
include (generic ) # simplify cmake module
@@ -279,9 +226,6 @@ include(inference_lib) # add paddle fluid inference libraries
279
226
280
227
281
228
include_directories ("${PADDLE_SOURCE_DIR} " )
282
- include_directories ("${PADDLE_SOURCE_DIR} /paddle/legacy/cuda/include" )
283
- include_directories ("${CMAKE_CURRENT_BINARY_DIR} /proto" )
284
- include_directories ("${CMAKE_CURRENT_BINARY_DIR} /go/pserver/client/c" )
285
229
286
230
set (EXTERNAL_LIBS
287
231
gflags
@@ -315,26 +259,6 @@ if(WITH_MKLDNN)
315
259
list (APPEND EXTERNAL_LIBS ${MKLDNN_LIB} )
316
260
endif ()
317
261
318
- if (USE_NNPACK )
319
- include (external/nnpack )
320
- list (APPEND EXTERNAL_LIBS ${NNPACK_LIBS} )
321
- endif (USE_NNPACK )
322
-
323
- add_subdirectory (proto )
324
-
325
- if (NOT MOBILE_INFERENCE AND NOT WITH_FLUID_ONLY )
326
- # "add_subdirectory(go)" should be placed after the following loine,
327
- # because it depends on paddle/optimizer.
328
- add_subdirectory (paddle/legacy/optimizer )
329
- endif ()
330
-
331
- # "add_subdirectory(paddle)" and "add_subdirectory(python)" should be
332
- # placed after this block, because they depends on it.
333
- if (WITH_GOLANG )
334
- enable_language (Go )
335
- add_subdirectory (go )
336
- endif (WITH_GOLANG )
337
-
338
262
set (PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR} /python/build" )
339
263
340
264
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG" )
@@ -352,9 +276,3 @@ add_subdirectory(paddle)
352
276
if (WITH_PYTHON )
353
277
add_subdirectory (python )
354
278
endif ()
355
-
356
- if (WITH_DOC )
357
- find_package (Sphinx REQUIRED )
358
- find_python_module (recommonmark REQUIRED )
359
- add_subdirectory (doc )
360
- endif ()
0 commit comments