third_party.cmake 2.4 KB
Newer Older
W
willzhang4a58 已提交
1 2 3 4 5 6 7 8 9 10
if (NOT WIN32)
  find_package(Threads)
endif()

include(zlib)
include(protobuf)
include(googletest)
include(glog)
include(gflags)
include(grpc)
J
jiyuan 已提交
11
include(tensorflow)
W
willzhang4a58 已提交
12

W
willzhang4a58 已提交
13
find_package(CUDA REQUIRED)
W
willzhang4a58 已提交
14
find_package(CuDNN REQUIRED)
W
willzhang4a58 已提交
15

W
willzhang4a58 已提交
16
find_package(BLAS REQUIRED)
W
willzhang4a58 已提交
17
message(STATUS "Blas Lib: " ${BLAS_LIBRARIES})
W
willzhang4a58 已提交
18

W
willzhang4a58 已提交
19
set(oneflow_third_party_libs
J
jiyuan 已提交
20
    ${tensorflow_STATIC_LIBRARIES}
W
willzhang4a58 已提交
21 22 23 24 25 26 27
    ${CMAKE_THREAD_LIBS_INIT}
    ${ZLIB_STATIC_LIBRARIES}
    ${GLOG_STATIC_LIBRARIES}
    ${GFLAGS_STATIC_LIBRARIES}
    ${GOOGLETEST_STATIC_LIBRARIES}
    ${PROTOBUF_STATIC_LIBRARIES}
    ${GRPC_STATIC_LIBRARIES}
J
jiyuan 已提交
28 29 30 31 32 33
    ${gif_STATIC_LIBRARIES}
    ${farmhash_STATIC_LIBRARIES}
    ${highwayhash_STATIC_LIBRARIES}
    ${JPEG_STATIC_LIBRARIES}
    ${PNG_STATIC_LIBRARIES}
    ${JSONCPP_STATIC_LIBRARIES}
W
willzhang4a58 已提交
34
    ${CUDA_CUBLAS_LIBRARIES}
W
willzhang4a58 已提交
35
    ${CUDNN_LIBRARIES}
W
willzhang4a58 已提交
36
    ${BLAS_LIBRARIES}
W
willzhang4a58 已提交
37 38
)

39 40 41 42 43
if(WIN32)
  # static gflags lib requires "PathMatchSpecA" defined in "ShLwApi.Lib"
  list(APPEND oneflow_third_party_libs "ShLwApi.Lib")
endif()

W
willzhang4a58 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57
set(oneflow_third_party_dependencies
  zlib_copy_headers_to_destination
  zlib_copy_libs_to_destination
  gflags_copy_headers_to_destination
  gflags_copy_libs_to_destination
  glog_copy_headers_to_destination
  glog_copy_libs_to_destination
  googletest_copy_headers_to_destination
  googletest_copy_libs_to_destination
  protobuf_copy_headers_to_destination
  protobuf_copy_libs_to_destination
  protobuf_copy_binary_to_destination
  grpc_copy_headers_to_destination
  grpc_copy_libs_to_destination
J
jiyuan 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  tensorflow_copy_headers_to_destination
  tensorflow_copy_libs_to_destination
  gif_copy_headers_to_destination
  gif_copy_libs_to_destination
  farmhash_copy_headers_to_destination
  farmhash_copy_libs_to_destination
  highwayhash_copy_headers_to_destination
  highwayhash_copy_libs_to_destination
  jpeg_copy_headers_to_destination
  jpeg_copy_libs_to_destination
  png_copy_headers_to_destination
  png_copy_libs_to_destination
  jsoncpp_copy_headers_to_destination
  jsoncpp_copy_libs_to_destination
  eigen_copy_headers_dir
W
willzhang4a58 已提交
73 74 75 76 77 78 79 80 81
)

include_directories(
    ${ZLIB_INCLUDE_DIR}
    ${GFLAGS_INCLUDE_DIR}
    ${GLOG_INCLUDE_DIR}
    ${GOOGLETEST_INCLUDE_DIR}
    ${PROTOBUF_INCLUDE_DIR}
    ${GRPC_INCLUDE_DIR}
J
jiyuan 已提交
82 83 84 85 86 87 88 89
    ${TENSORFLOW_INCLUDE_DIR}
    ${GIF_INCLUDE_DIR}
    ${FARMHASH_INCLUDE_DIR}
    ${HIGHWAYHASH_INCLUDE_DIR}
    ${JPEG_INCLUDE_DIR}
    ${PNG_INCLUDE_DIR}
    ${JSONCPP_INCLUDE_DIR}
    ${EIGEN_INCLUDE_DIRS}
W
willzhang4a58 已提交
90
    ${CUDNN_INCLUDE_DIRS}
W
willzhang4a58 已提交
91
)