From 6d093eb25a0c3117e82396e73309354ba7b309d9 Mon Sep 17 00:00:00 2001 From: taoboyang Date: Tue, 16 Jul 2024 12:16:33 +0800 Subject: [PATCH] update the macos building doc --- .../install/_index.md | 16 ++++++++++++++-- .../install/_index.md | 19 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/content/en/docs/bmf/getting_started_yourself/install/_index.md b/content/en/docs/bmf/getting_started_yourself/install/_index.md index bbb39ea..59c50e3 100644 --- a/content/en/docs/bmf/getting_started_yourself/install/_index.md +++ b/content/en/docs/bmf/getting_started_yourself/install/_index.md @@ -187,7 +187,6 @@ yum repo of CentOS:7 has no ffmpeg libraries now, please follow the below steps ```bash brew install ffmpeg@4 -export DYLD_LIBRARY_PATH="/usr/local/opt/ffmpeg@4/lib:$DYLD_LIBRARY_PATH" ``` @@ -390,10 +389,23 @@ To compile libncurses on macOS, you can follow these steps: sudo make install ``` + d. BMF depends on libbfd, so you need to install binutils + ``` + brew install binutils + ``` +Before compiling, you need to check whether the local python and ffmpeg are linked to the correct version. If not, you may need to make adjustments with the following commands: +``` +brew unlink ffmpeg +brew link ffmpeg@4 +brew link --force python@3.9 + +``` The above command will configure the installation path to ```/usr/local/opt/ncurses```. You can also change the path as needed. After compilation and installation are complete, you should be able to find the libncurses library file in the specified installation path. With the above steps, you can successfully compile and install libncurses on macOS. Please note that the process may change due to version updates. -After completing the above two points of preparatory work, you can compile BMF under Mac OS and use the command: +After completing preparatory works above, you can compile BMF under Mac OS and use the command, in some higher version compilers, you may encounter compilation errors of the benchmark library, and we have also dealt with them. You could make the compilation by using commands followed: ``` +git submodule update --init --recursive +sed -i '' '/sigma_gn /s/^/\/\//g' bmf/hml/third_party/benchmark/src/complexity.cc ./build_osx.sh ``` diff --git a/content/zh/docs/bmf/getting_started_yourself/install/_index.md b/content/zh/docs/bmf/getting_started_yourself/install/_index.md index 4d4f722..1204ed3 100644 --- a/content/zh/docs/bmf/getting_started_yourself/install/_index.md +++ b/content/zh/docs/bmf/getting_started_yourself/install/_index.md @@ -187,7 +187,6 @@ yum repo of CentOS:7 has no ffmpeg libraries now, please follow the below steps ```bash brew install ffmpeg@4 -export DYLD_LIBRARY_PATH="/usr/local/opt/ffmpeg@4/lib:$DYLD_LIBRARY_PATH" ``` @@ -390,10 +389,26 @@ Mac OS 端编译时需要注意以下几点: sudo make install ``` + d. BMF 依赖 libbfd 库,因此您需要安装 binutils + + ``` + brew install binutils + ``` + +在进行编译操作之前,您需要检查本地 的 python、ffmpeg 是否链接到正确的版本,如果不是,您可能需要以下命令做出调整 +``` +brew unlink ffmpeg +brew link ffmpeg@4 +brew link --force python@3.9 +``` + 上面的命令将把安装路径配置为 ```/usr/local/opt/ncurses```。您也可以根据需要更改路径。编译安装完成后,可以在指定的安装路径中找到 libncurses 库文件。通过以上步骤,就可以在 mac OS 上成功编译并安装 libncurses。请注意,该流程可能会因版本更新而发生变化。 -完成以上两点准备工作后,您可以在 Mac OS 下编译 BMF,使用命令: + +完成以上准备工作后,您可以在 Mac OS 下编译 BMF,在一些高版本的编译器中,您可能会遇到 benchmark 库的编译错误,我们对此也进行了处理,您可以使用以下命令完成编译: ``` +git submodule update --init --recursive +sed -i '' '/sigma_gn /s/^/\/\//g' bmf/hml/third_party/benchmark/src/complexity.cc ./build_osx.sh ```