Skip to content

Commit 748229a

Browse files
authored
Merge pull request #1093 from gangliao/warp_ctc
Disable dynamic linked cuda libs default
2 parents c016758 + 4d6aca4 commit 748229a

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ find_package(Threads REQUIRED)
2727
include(system)
2828
include(simd)
2929

30-
###################### Configurations ############################
30+
################################ Configurations #######################################
3131
option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_FOUND})
3232
option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND})
33-
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
33+
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" OFF)
3434
option(WITH_TESTING "Compile PaddlePaddle with unit testing" ON)
3535
option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)
3636
option(WITH_STYLE_CHECK "Compile PaddlePaddle with style check" ON)
@@ -43,6 +43,7 @@ option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
4343
option(ON_COVERALLS "Compile PaddlePaddle with code coverage" OFF)
4444
option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
4545
option(ON_TRAVIS "Exclude special unit test on Travis CI" OFF)
46+
########################################################################################
4647

4748
include(external/zlib) # download, build, install zlib
4849
include(external/gflags) # download, build, install gflags

cmake/external/openblas.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
INCLUDE(cblas)
1616

1717
IF(NOT ${CBLAS_FOUND})
18+
MESSAGE(FATAL_ERROR "Please install OpenBlas, MKL or ATLAS.")
1819
INCLUDE(ExternalProject)
1920

2021
SET(CBLAS_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/openblas)

cmake/external/warpctc.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ ExternalProject_Add(
5353
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${WARPCTC_INSTALL_DIR}
5454
CMAKE_ARGS -DWITH_GPU=${WITH_GPU}
5555
CMAKE_ARGS -DWITH_OMP=${USE_OMP}
56+
CMAKE_ARGS -DWITH_TORCH=OFF
57+
CMAKE_ARGS -DBUILD_SHARED=ON
5658
)
5759

5860
LIST(APPEND external_project_dependencies warpctc)

cmake/util.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ function(link_paddle_exe TARGET_NAME)
120120
target_link_libraries(${TARGET_NAME} rt)
121121
endif()
122122
endif()
123+
123124
add_dependencies(${TARGET_NAME} ${external_project_dependencies})
124125
endfunction()
125126

paddle/cuda/src/hl_warpctc_wrap.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ void* warpctc_dso_handle = nullptr;
2929
* false, you need to add the path of libwarp-ctc.so to
3030
* the linked-libs of paddle or to LD_PRELOAD.
3131
*/
32-
#ifdef PADDLE_USE_DSO
3332
#define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \
3433
struct DynLoad__##__name { \
3534
template <typename... Args> \
@@ -41,15 +40,6 @@ void* warpctc_dso_handle = nullptr;
4140
return reinterpret_cast<warpctcFunc>(p_##_name)(args...); \
4241
} \
4342
} __name; // struct DynLoad__##__name
44-
#else
45-
#define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \
46-
struct DynLoad__##__name { \
47-
template <typename... Args> \
48-
auto operator()(Args... args) -> decltype(__name(args...)) { \
49-
return __name(args...); \
50-
} \
51-
} __name; // struct DynLoad__##__name
52-
#endif
5343

5444
// include all needed warp-ctc functions
5545
DYNAMIC_LOAD_WARPCTC_WRAP(get_warpctc_version)

paddle/scripts/travis/build_and_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
1313
sudo make install
1414
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
1515
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
16-
cmake .. -DON_TRAVIS=ON -DON_COVERALLS=ON -DCOVERALLS_UPLOAD=ON -DWITH_SWIG_PY=ON
16+
cmake .. -DON_TRAVIS=ON -DON_COVERALLS=ON -DCOVERALLS_UPLOAD=ON
1717
NPROC=`sysctl -n hw.ncpu`
1818
make -j $NPROC
1919
fi

0 commit comments

Comments
 (0)