| 1 | Patch subprojects to use guix builds instead
|
| 2 |
|
| 3 | diff --git a/CMakeLists.txt b/CMakeLists.txt
|
| 4 | index 62b99d1..c1ac38a 100644
|
| 5 | |
| 6 | |
| 7 | @@ -98,7 +98,7 @@ else()
|
| 8 | endif()
|
| 9 |
|
| 10 | find_package(Threads)
|
| 11 | -add_subdirectory(third_party/spdlog EXCLUDE_FROM_ALL)
|
| 12 | +find_package( spdlog)
|
| 13 |
|
| 14 | set(PRIVATE_INCLUDE_DIRECTORIES
|
| 15 | ${CMAKE_CURRENT_SOURCE_DIR}/src
|
| 16 | @@ -249,9 +249,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(amd64)|(AMD64)")
|
| 17 | set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
|
| 18 | set(BUILD_SHARED_LIBS OFF)
|
| 19 | set(BUILD_TESTING OFF)
|
| 20 | - add_subdirectory(third_party/cpu_features EXCLUDE_FROM_ALL)
|
| 21 | + find_package( CpuFeatures)
|
| 22 | set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
|
| 23 | - list(APPEND LIBRARIES cpu_features)
|
| 24 | + find_library( CPU_FEATURES_LIBRARIES cpu_features)
|
| 25 | + list(APPEND LIBRARIES ${CPU_FEATURES_LIBRARIES})
|
| 26 | endif()
|
| 27 |
|
| 28 | if(ENABLE_CPU_DISPATCH)
|
| 29 | @@ -349,8 +350,8 @@ if(WITH_MKL)
|
| 30 | else()
|
| 31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
| 32 | set(MKL_LIBRARIES
|
| 33 | - ${MKL_LIBRARY_DIR}/libmkl_core.a
|
| 34 | - ${MKL_LIBRARY_DIR}/libmkl_intel_ilp64.a
|
| 35 | + ${MKL_LIBRARY_DIR}/libmkl_core.so
|
| 36 | + ${MKL_LIBRARY_DIR}/libmkl_intel_ilp64.so
|
| 37 | )
|
| 38 | endif()
|
| 39 |
|
| 40 | @@ -358,19 +359,19 @@ if(WITH_MKL)
|
| 41 | if(WIN32)
|
| 42 | list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/mkl_intel_thread.lib)
|
| 43 | else()
|
| 44 | - list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_intel_thread.a)
|
| 45 | + list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_intel_thread.so)
|
| 46 | endif()
|
| 47 | elseif(OPENMP_RUNTIME STREQUAL "COMP")
|
| 48 | if(WIN32)
|
| 49 | message(FATAL_ERROR "Building with MKL requires Intel OpenMP")
|
| 50 | else()
|
| 51 | - list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_gnu_thread.a)
|
| 52 | + list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_gnu_thread.so)
|
| 53 | endif()
|
| 54 | elseif(OPENMP_RUNTIME STREQUAL "NONE")
|
| 55 | if(WIN32)
|
| 56 | list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/mkl_sequential.lib)
|
| 57 | else()
|
| 58 | - list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_sequential.a)
|
| 59 | + list(APPEND MKL_LIBRARIES ${MKL_LIBRARY_DIR}/libmkl_sequential.so)
|
| 60 | endif()
|
| 61 | endif()
|
| 62 | list(APPEND PRIVATE_INCLUDE_DIRECTORIES ${MKL_INCLUDE_DIR})
|
| 63 | @@ -439,6 +440,7 @@ if (WITH_RUY)
|
| 64 | add_definitions(-DCT2_WITH_RUY)
|
| 65 | set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
| 66 | set(CPUINFO_LIBRARY_TYPE static CACHE STRING "cpuinfo library type")
|
| 67 | + # if package found and appended to libraries, issue with linking
|
| 68 | add_subdirectory(third_party/ruy EXCLUDE_FROM_ALL)
|
| 69 | unset(CMAKE_POSITION_INDEPENDENT_CODE)
|
| 70 | list(APPEND LIBRARIES ruy)
|
| 71 | diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
|
| 72 | index 3311ad3..7d90693 100644
|
| 73 | |
| 74 | |
| 75 | @@ -1,14 +1,12 @@
|
| 76 | -if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/cxxopts/include")
|
| 77 | - message(FATAL_ERROR "The client dependency repository (cxxopts) is missing! "
|
| 78 | - "You probably didn't clone the project with --recursive. You can include it "
|
| 79 | - "by calling \"git submodule update --init --recursive\"")
|
| 80 | -endif()
|
| 81 | -
|
| 82 | add_executable(translator
|
| 83 | translator.cc
|
| 84 | )
|
| 85 | +find_path(
|
| 86 | + CXXOPTS_ROOT
|
| 87 | + include/cxxopts.hpp
|
| 88 | +)
|
| 89 | target_include_directories(translator
|
| 90 | - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/cxxopts/include
|
| 91 | + PRIVATE ${CXXOPTS_ROOT}/include
|
| 92 | )
|
| 93 | target_link_libraries(translator
|
| 94 | PRIVATE ${PROJECT_NAME}
|
| 95 | diff --git a/src/cpu/cpu_info.cc b/src/cpu/cpu_info.cc
|
| 96 | index 9030ac7..6949644 100644
|
| 97 | |
| 98 | |
| 99 | @@ -4,7 +4,7 @@
|
| 100 |
|
| 101 | #include <cstring>
|
| 102 |
|
| 103 | -#include <cpuinfo_x86.h>
|
| 104 | +#include <cpu_features/cpuinfo_x86.h>
|
| 105 |
|
| 106 | namespace ctranslate2 {
|
| 107 | namespace cpu {
|
| 108 | diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
| 109 | index 283c49d..9ca6cc8 100644
|
| 110 | |
| 111 | |
| 112 | @@ -2,7 +2,7 @@ enable_testing()
|
| 113 |
|
| 114 | option(BUILD_GMOCK "" OFF)
|
| 115 | option(INSTALL_GTEST "" OFF)
|
| 116 | -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/googletest ${CMAKE_CURRENT_BINARY_DIR}/googletest)
|
| 117 | +find_package( GTest)
|
| 118 |
|
| 119 | add_executable(ctranslate2_test
|
| 120 | batching_test.cc
|
| 121 | @@ -20,7 +20,7 @@ target_include_directories(ctranslate2_test PRIVATE
|
| 122 | )
|
| 123 | target_link_libraries(ctranslate2_test
|
| 124 | ${PROJECT_NAME}
|
| 125 | - gtest_main
|
| 126 | + gtest
|
| 127 | )
|
| 128 |
|
| 129 | add_executable(benchmark_ops
|