argosopentech / argosopentech/MetalTranslate

Link to specified external library version

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
61
Forks
15
PR merge metrics
No merged PRs in 30d

Description

```
cmake_minimum_required(VERSION 3.10)

project(MetalTranslate)

include(ExternalProject)

set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)

# CTranslate2 External Project
ExternalProject_Add(CTranslate2
GIT_REPOSITORY https://github.com/OpenNMT/CTranslate2
GIT_TAG 4908b9d
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DWITH_MKL=OFF -DWITH_DNNL=ON
)

# Tokenizer External Project
ExternalProject_Add(Tokenizer
GIT_REPOSITORY https://github.com/OpenNMT/Tokenizer
GIT_TAG 559b8e7
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)

# Include directories for CTranslate2 and Tokenizer
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)

# Ensure CTranslate2 and Tokenizer are built before metaltranslate
add_executable(metaltranslate src/main.cpp)

# Add the MetalTranslate sources
set(TARGET_H
src/MetalTranslate.h
src/MetalTranslateConfig.h)

target_sources(metaltranslate PRIVATE src/MetalTranslate.cpp)

# Link the external libraries
add_dependencies(metaltranslate CTranslate2 Tokenizer)
target_link_libraries(metaltranslate ${EXTERNAL_INSTALL_LOCATION}/lib/libctranslate2.so)
target_link_libraries(metaltranslate ${EXTERNAL_INSTALL_LOCATION}/lib/libOpenNMTTokenizer.so)

```

Please revise CMakelists.txt like this.
It was not works previous version on my machine

Contributor guide

No contributing guide indexed for this repository

Research direction

Open the repository's CMakeLists.txt and compare it with the supplied ExternalProject_Add configuration for CTranslate2 and Tokenizer. Configure and build the project to verify the pinned revisions and library linking work; done means the external projects build and metaltranslate links successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.