From f80b6dfc2d7a8aaf57308c082159b80e28a3cf87 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 24 Jul 2024 09:17:55 +0200 Subject: [PATCH] test Signed-off-by: Ettore Di Giacinto --- backend/cpp/llama/CMakeLists.txt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/backend/cpp/llama/CMakeLists.txt b/backend/cpp/llama/CMakeLists.txt index 9f976d74..5a17d3d3 100644 --- a/backend/cpp/llama/CMakeLists.txt +++ b/backend/cpp/llama/CMakeLists.txt @@ -39,10 +39,8 @@ find_package(Protobuf CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED) if ( DEFINED ENV{ONEAPI_ROOT}) - find_package(IntelSYCL REQUIRED) find_package(MKL REQUIRED) - add_compile_options(-I/${SYCL_INCLUDE_DIR}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -L${MKLROOT}/lib") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${MKLROOT}/lib") endif() find_program(_PROTOBUF_PROTOC protoc) @@ -87,6 +85,24 @@ target_link_libraries(${TARGET} PRIVATE common llama myclip ${CMAKE_THREAD_LIBS_ gRPC::${_REFLECTION} gRPC::${_GRPC_GRPCPP} protobuf::${_PROTOBUF_LIBPROTOBUF}) + +# Conditionally link SYCL to grpc-server +if ( DEFINED ENV{ONEAPI_ROOT}) + find_package(IntelSYCL REQUIRED) + target_link_libraries(${TARGET} PRIVATE common llama myclip ${CMAKE_THREAD_LIBS_INIT} absl::flags hw_grpc_proto + absl::flags_parse + gRPC::${_REFLECTION} + gRPC::${_GRPC_GRPCPP} + protobuf::${_PROTOBUF_LIBPROTOBUF} + sycl) +else() + target_link_libraries(${TARGET} PRIVATE common llama myclip ${CMAKE_THREAD_LIBS_INIT} absl::flags hw_grpc_proto + absl::flags_parse + gRPC::${_REFLECTION} + gRPC::${_GRPC_GRPCPP} + protobuf::${_PROTOBUF_LIBPROTOBUF}) +endif() + target_compile_features(${TARGET} PRIVATE cxx_std_11) if(TARGET BUILD_INFO) add_dependencies(${TARGET} BUILD_INFO)