Skip to content

Commit 2906d83

Browse files
authored
Merge pull request #12806 from velconia/fix_anakin_in_manylinux1
Fix anakin in manylinux1
2 parents e955361 + c128c24 commit 2906d83

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ include(external/snappy) # download snappy
204204
include(external/snappystream)
205205
include(external/threadpool)
206206

207+
include(flags) # set paddle compile flags
208+
include(cudnn) # set cudnn libraries, must before configure
209+
include(cupti)
210+
include(configure) # add paddle env configuration
211+
207212
if(WITH_GPU)
208213
include(cuda)
209214
include(tensorrt)
@@ -212,10 +217,6 @@ elseif()
212217
set(WITH_ANAKIN OFF CACHE STRING "Anakin is used in GPU only now." FORCE)
213218
endif()
214219

215-
include(flags) # set paddle compile flags
216-
include(cudnn) # set cudnn libraries, must before configure
217-
include(cupti)
218-
include(configure) # add paddle env configuration
219220
include(generic) # simplify cmake module
220221
include(package) # set paddle packages
221222
include(ccache) # set ccache for compilation

cmake/configure.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ if(WITH_GPU)
112112
endif()
113113
endif()
114114
if(WITH_ANAKIN)
115-
set(ENV{CUDNN_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR})
116-
set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY})
115+
# NOTICE(minqiyang): the end slash is important because $CUDNN_INCLUDE_DIR
116+
# is a softlink to real cudnn.h directory
117+
set(ENV{CUDNN_INCLUDE_DIR} "${CUDNN_INCLUDE_DIR}/")
118+
get_filename_component(CUDNN_LIBRARY_DIR ${CUDNN_LIBRARY} DIRECTORY)
119+
set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY_DIR})
117120
endif()
118121
elseif(WITH_AMD_GPU)
119122
add_definitions(-DPADDLE_WITH_HIP)

cmake/external/anakin.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ execute_process(COMMAND bash -c "cd ${ANAKIN_SOURCE_DIR}; wget -q --no-check-cer
1919
include_directories(${ANAKIN_INCLUDE})
2020
include_directories(${ANAKIN_INCLUDE}/saber/)
2121

22-
set(ANAKIN_COMPILE_EXTRA_FLAGS
22+
set(ANAKIN_COMPILE_EXTRA_FLAGS
2323
-Wno-error=unused-but-set-variable -Wno-unused-but-set-variable
24-
-Wno-error=unused-variable -Wno-unused-variable
24+
-Wno-error=unused-variable -Wno-unused-variable
2525
-Wno-error=format-extra-args -Wno-format-extra-args
26-
-Wno-error=comment -Wno-comment
27-
-Wno-error=format -Wno-format
26+
-Wno-error=comment -Wno-comment
27+
-Wno-error=format -Wno-format
2828
-Wno-error=switch -Wno-switch
29-
-Wno-error=return-type -Wno-return-type
29+
-Wno-error=return-type -Wno-return-type
3030
-Wno-error=non-virtual-dtor -Wno-non-virtual-dtor
3131
-Wno-sign-compare
32-
-Wno-reorder
32+
-Wno-reorder
3333
-Wno-error=cpp)
3434

3535
ExternalProject_Add(
@@ -47,6 +47,7 @@ ExternalProject_Add(
4747
-DPROTOBUF_ROOT=${THIRD_PARTY_PATH}/install/protobuf
4848
-DMKLML_ROOT=${THIRD_PARTY_PATH}/install/mklml
4949
-DCUDNN_ROOT=${CUDNN_ROOT}
50+
-DCUDNN_INCLUDE_DIR=${CUDNN_INCLUDE_DIR}
5051
${EXTERNAL_OPTIONAL_ARGS}
5152
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${ANAKIN_INSTALL_DIR}
5253
)

0 commit comments

Comments
 (0)