Skip to content

Commit fef3fd6

Browse files
authored
Merge pull request #15452 from luotao1/legacy_option
remove legacy compiler option
2 parents 5a8bd82 + 54c0da0 commit fef3fd6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+72
-2244
lines changed

CMakeLists.txt

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ if(WIN32)
3333
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj /MT")
3434
endif(WIN32)
3535

36-
if(NOT CMAKE_CROSSCOMPILING)
37-
find_package(CUDA QUIET)
38-
endif(NOT CMAKE_CROSSCOMPILING)
36+
find_package(CUDA QUIET)
3937
find_package(Git REQUIRED)
4038
find_package(Threads REQUIRED)
4139

@@ -49,7 +47,6 @@ option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FO
4947
option(WITH_NGRAPH "Compile PaddlePaddle with nGraph support." OFF)
5048
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
5149
option(WITH_TESTING "Compile PaddlePaddle with unit testing" OFF)
52-
option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)
5350
option(WITH_PYTHON "Compile PaddlePaddle with python interpreter" ON)
5451
option(WITH_DOUBLE "Compile PaddlePaddle with double precision" OFF)
5552
option(WITH_RDMA "Compile PaddlePaddle with RDMA support" OFF)
@@ -60,11 +57,9 @@ option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
6057
option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
6158
option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
6259
option(ON_TRAVIS "Exclude special unit test on Travis CI" OFF)
63-
option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF)
6460
option(WITH_FLUID_ONLY "Compile PaddlePaddle fluid only" OFF)
6561
option(WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF)
6662
option(GLIDE_INSTALL "Download and install go dependencies " ON)
67-
option(USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF)
6863
option(WITH_DISTRIBUTE "Compile with distributed support" OFF)
6964
option(WITH_PSLIB "Compile with pslib support" OFF)
7065
option(USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF)
@@ -96,37 +91,6 @@ if(NOT CMAKE_BUILD_TYPE)
9691
FORCE)
9792
endif()
9893

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-
13094
if (APPLE)
13195
set(WITH_MKL OFF CACHE STRING
13296
"Disable MKL for building on mac" FORCE)
@@ -135,8 +99,6 @@ endif()
13599
if (WIN32)
136100
set(WITH_DISTRIBUTE OFF CACHE STRING
137101
"Disable DISTRIBUTE when compiling for Windows" FORCE)
138-
set(WITH_C_API OFF CACHE STRING
139-
"Disable C_API when compiling for Windows" FORCE)
140102
set(WITH_FLUID_ONLY ON CACHE STRING
141103
"Enable FLUID_ONLY when compiling for Windows" FORCE)
142104
endif()
@@ -150,21 +112,7 @@ set(FLUID_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_install_dir" CACHE STRING
150112
set(FLUID_INFERENCE_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_inference_install_dir" CACHE STRING
151113
"A path setting fluid inference shared and static libraries")
152114

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)
168116

169117
set(WITH_MKLML ${WITH_MKL})
170118
if (NOT DEFINED WITH_MKLDNN)
@@ -193,7 +141,6 @@ include(external/python) # download, build, install python
193141
include(external/openblas) # download, build, install openblas
194142
include(external/mkldnn) # download, build, install mkldnn
195143
include(external/ngraph) # download, build, install nGraph
196-
include(external/swig) # download, build, install swig
197144
include(external/boost) # download boost
198145
include(external/any) # download libn::any
199146
include(external/eigen) # download eigen3
@@ -312,11 +259,6 @@ if(WITH_MKLDNN)
312259
list(APPEND EXTERNAL_LIBS ${MKLDNN_LIB})
313260
endif()
314261

315-
if(USE_NNPACK)
316-
include(external/nnpack)
317-
list(APPEND EXTERNAL_LIBS ${NNPACK_LIBS})
318-
endif(USE_NNPACK)
319-
320262
set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")
321263

322264
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")

Dockerfile.android

Lines changed: 0 additions & 42 deletions
This file was deleted.

cmake/cblas.cmake

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,18 @@ endif()
6464
## Then find the reference-cblas. www.netlib.org/blas/
6565
set(REFERENCE_CBLAS_ROOT $ENV{REFERENCE_CBLAS_ROOT} CACHE PATH
6666
"Folder contains reference-cblas")
67-
if(NOT CMAKE_CROSSCOMPILING)
68-
set(REFERENCE_CBLAS_INCLUDE_SEARCH_PATHS
69-
${REFERENCE_CBLAS_ROOT}/include
70-
/usr/include
71-
/usr/include/cblas
72-
)
67+
set(REFERENCE_CBLAS_INCLUDE_SEARCH_PATHS
68+
${REFERENCE_CBLAS_ROOT}/include
69+
/usr/include
70+
/usr/include/cblas
71+
)
7372

74-
set(REFERENCE_CBLAS_LIB_SEARCH_PATHS
75-
${REFERENCE_CBLAS_ROOT}/lib
76-
/usr/lib
77-
/usr/lib/blas/reference/
78-
/usr/lib/reference/
79-
)
80-
else()
81-
# Disable the finding of reference cblas under host's system path
82-
set(REFERENCE_CBLAS_INCLUDE_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/include)
83-
set(REFERENCE_CBLAS_LIB_SEARCH_PATHS ${REFERENCE_CBLAS_ROOT}/lib)
84-
endif()
73+
set(REFERENCE_CBLAS_LIB_SEARCH_PATHS
74+
${REFERENCE_CBLAS_ROOT}/lib
75+
/usr/lib
76+
/usr/lib/blas/reference/
77+
/usr/lib/reference/
78+
)
8579

8680
if(WITH_SYSTEM_BLAS)
8781
find_path(REFERENCE_CBLAS_INCLUDE_DIR NAMES cblas.h PATHS
@@ -98,10 +92,3 @@ if(WITH_SYSTEM_BLAS)
9892
message(STATUS "Found reference-cblas (include: ${CBLAS_INC_DIR}, library: ${CBLAS_LIBRARIES})")
9993
endif()
10094
endif()
101-
102-
if(IOS_USE_VECLIB_FOR_BLAS AND VECLIB_FOUND)
103-
set(CBLAS_FOUND ON)
104-
set(CBLAS_PROVIDER vecLib)
105-
set(CBLAS_INC_DIR ${VECLIB_INC_DIR})
106-
add_definitions(-DPADDLE_USE_VECLIB)
107-
endif()

cmake/configure.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ if(NOT WITH_PROFILER)
4949
add_definitions(-DPADDLE_DISABLE_PROFILER)
5050
endif(NOT WITH_PROFILER)
5151

52-
if(NOT CMAKE_CROSSCOMPILING)
53-
if(WITH_AVX AND AVX_FOUND)
54-
set(SIMD_FLAG ${AVX_FLAG})
55-
elseif(SSE3_FOUND)
56-
set(SIMD_FLAG ${SSE3_FLAG})
57-
endif()
52+
if(WITH_AVX AND AVX_FOUND)
53+
set(SIMD_FLAG ${AVX_FLAG})
54+
elseif(SSE3_FOUND)
55+
set(SIMD_FLAG ${SSE3_FLAG})
5856
endif()
5957

6058
if(WIN32)

0 commit comments

Comments
 (0)