Skip to content

Commit dbd7896

Browse files
authored
cmakelist windows (#12927)
* picked pr * "fix ci"
1 parent 04b1e4d commit dbd7896

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
2424
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
2525
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
2626
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
27+
if(WIN32)
28+
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
29+
endif(WIN32)
2730

2831
if(NOT CMAKE_CROSSCOMPILING)
2932
find_package(CUDA QUIET)
@@ -165,14 +168,21 @@ include(external/python) # download, build, install python
165168
include(external/openblas) # download, build, install openblas
166169
include(external/mkldnn) # download, build, install mkldnn
167170
include(external/swig) # download, build, install swig
168-
include(external/warpctc) # download, build, install warpctc
169171
include(external/boost) # download boost
170172
include(external/any) # download libn::any
171173
include(external/eigen) # download eigen3
172174
include(external/pybind11) # download pybind11
173175
include(external/cares)
174176
include(external/cub)
175177

178+
if (NOT WIN32)
179+
# there is no official support of snappystream, warpctc, nccl, cupti in windows
180+
include(external/snappy) # download snappy
181+
include(external/snappystream) # download snappystream
182+
include(external/warpctc) # download, build, install warpctc
183+
include(cupti)
184+
endif (NOT WIN32)
185+
176186
if(WITH_DISTRIBUTE)
177187
if(WITH_GRPC)
178188
include(external/grpc)
@@ -194,13 +204,10 @@ if(WITH_BRPC_RDMA)
194204
endif()
195205
endif()
196206

197-
include(external/snappy) # download snappy
198-
include(external/snappystream)
199-
include(external/threadpool)
200207

208+
include(external/threadpool)
201209
include(flags) # set paddle compile flags
202210
include(cudnn) # set cudnn libraries, must before configure
203-
include(cupti)
204211
include(configure) # add paddle env configuration
205212

206213
if(WITH_GPU)

cmake/configure.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ if(NOT CMAKE_CROSSCOMPILING)
6161
endif()
6262
endif()
6363

64+
if(WIN32)
65+
# windows stupid compile option for all targets.
66+
add_definitions(-D_XKEYCHECK_H)
67+
endif(WIN32)
68+
6469
if(NOT WITH_GOLANG)
6570
add_definitions(-DPADDLE_WITHOUT_GOLANG)
6671
endif(NOT WITH_GOLANG)

0 commit comments

Comments
 (0)