Skip to content

Commit

Permalink
ggml : update cmake to build on macOS (facebookresearch#235)
Browse files Browse the repository at this point in the history
* cmake : fix build on Mac OS

* ggml : update readme
  • Loading branch information
ggerganov authored Dec 4, 2023
1 parent 82f9432 commit 54dfed1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 4 additions & 1 deletion ggml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ To build the interactive console for S2TT & ASR,
cd seamless_communication/ggml
mkdir build; cd build
cmake -DGGML_OPENBLAS=ON \
cmake \
-DGGML_OPENBLAS=ON \
-DBUILD_SHARED_LIBS=On \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-g2 -fno-omit-frame-pointer" \
..
make -j4 unity # Interactive Console
```
Note that `-DGGML_OPENBLAS=ON` is not necessary on macOS.

For more build commands see [Makefile](Makefile).

## CLI usage
Expand Down
6 changes: 1 addition & 5 deletions ggml/examples/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ struct gpt_params {
int32_t n_gpu_layers = 0;
};

bool unity_params_parse(int argc, char ** argv, unity_params & params);

bool gpt_params_parse(int argc, char ** argv, gpt_params & params);

void unity_print_usage(int /*argc*/, char ** argv, const unity_params & params);

void gpt_print_usage(int argc, char ** argv, const gpt_params & params);


Expand Down Expand Up @@ -179,4 +175,4 @@ struct sam_params {

bool sam_params_parse(int argc, char ** argv, sam_params & params);

void sam_print_usage(int argc, char ** argv, const sam_params & params);
void sam_print_usage(int argc, char ** argv, const sam_params & params);
5 changes: 2 additions & 3 deletions ggml/examples/unity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ target_sources(fairseq2_cpp
)
add_executable(unity unity.cpp)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SNDFILE REQUIRED sndfile)
target_include_directories(unity PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../.. ${SNDFILE_INCLUDE_DIRS})
target_link_libraries(unity PRIVATE ggml ${SNDFILE_LIBRARIES})
pkg_check_modules(SNDFILE REQUIRED IMPORTED_TARGET sndfile)
target_link_libraries(unity PRIVATE ggml PkgConfig::SNDFILE)
target_sources(unity
PRIVATE
fairseq2.cpp
Expand Down

0 comments on commit 54dfed1

Please sign in to comment.