Skip to content

Commit 425f951

Browse files
committed
Fix warpctc bugs
1 parent 057c216 commit 425f951

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmake/external/warpctc.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ SET(WARPCTC_LIB_DIR "${WARPCTC_INSTALL_DIR}/lib" CACHE PATH "Warp-ctc Library Di
2424

2525
IF(WIN32)
2626
SET(WARPCTC_LIBRARIES
27-
"${WARPCTC_INSTALL_DIR}/lib/warpctc.lib" CACHE FILEPATH "Warp-ctc Library" FORCE)
27+
"${WARPCTC_INSTALL_DIR}/lib/warpctc.dll" CACHE FILEPATH "Warp-ctc Library" FORCE)
2828
ELSE(WIN32)
29+
IF(APPLE)
30+
SET(_warpctc_SHARED_SUFFIX dylib)
31+
ELSE(APPLE)
32+
SET(_warpctc_SHARED_SUFFIX so)
33+
ENDIF(APPLE)
34+
2935
SET(WARPCTC_LIBRARIES
30-
"${WARPCTC_INSTALL_DIR}/lib/libwarpctc.a" CACHE FILEPATH "Warp-ctc Library" FORCE)
36+
"${WARPCTC_INSTALL_DIR}/lib/libwarpctc.${_warpctc_SHARED_SUFFIX}" CACHE FILEPATH "Warp-ctc Library" FORCE)
3137
ENDIF(WIN32)
3238

3339
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
@@ -48,7 +54,7 @@ ExternalProject_Add(
4854
CMAKE_ARGS -DWITH_GPU=${WITH_GPU}
4955
CMAKE_ARGS -DWITH_OMP=${USE_OMP}
5056
CMAKE_ARGS -DWITH_TORCH=OFF
51-
CMAKE_ARGS -DBUILD_SHARED=OFF
57+
CMAKE_ARGS -DBUILD_SHARED=ON
5258
)
5359

5460
LIST(APPEND external_project_dependencies warpctc)

paddle/gserver/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if(NOT WITH_DOUBLE)
8080
test_WarpCTCLayer.cpp)
8181

8282
add_test(NAME test_WarpCTCLayer
83-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer
83+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer --warpctc_dir=${WARPCTC_LIB_DIR}
8484
WORKING_DIRECTORY ${PROJ_ROOT}/paddle)
8585
endif()
8686

0 commit comments

Comments
 (0)