Skip to content

Commit

Permalink
static link Threads lib for a portable bin (#1012)
Browse files Browse the repository at this point in the history
* static link Threads lib for a portable bin
* Changelog: Threads to EXT_LIBS

---------

Co-authored-by: Thamme Gowda <[email protected]>
  • Loading branch information
thammegowda and Thamme Gowda authored Nov 22, 2023
1 parent 26a392b commit ba5df66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]
- Fixed compilation with clang 16.0.6
- Added Threads::Threads to EXT_LIBS


### Added
- Added `--no-spm-encode` option, allowing the model to use vocabulary IDs directly to train/decode.
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

########
# pThreads: consider it as EXT_LIBS for a more portable binary
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
set(EXT_LIBS ${EXT_LIBS} Threads::Threads)
########


###############################################################################
# Set compilation flags
if(MSVC)
Expand Down

0 comments on commit ba5df66

Please sign in to comment.