-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix binutils install doc on macOS (#28)
* * fix binutils install doc * fix typo * fix typo * fix typo * change binutils compile command * fix the binutils path * Add notes for binutils install
- Loading branch information
1 parent
1452f47
commit 67b861f
Showing
2 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,13 +391,24 @@ To compile libncurses on macOS, you can follow these steps: | |
|
||
d. BMF depends on libbfd, so you need to install binutils | ||
``` | ||
brew install binutils | ||
wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.bz2 | ||
tar xvf binutils-2.43.1.tar.bz2 | ||
cd binutils-2.43.1 | ||
./configure --prefix=/usr/local/opt/binutils --enable-install-libiberty | ||
make -j8 | ||
sudo make install | ||
``` | ||
> Notes: | ||
> | ||
> When installing binutils on macOS, you may encounter an error such as `clang: error: unsupported option '-print-multi-os-directory'`. This error is because clang does not support this option. However, on the macOS platform, this error will not affect the installation of BMF's dependent libraries, so please ignore this error. | ||
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 [email protected] | ||
export BMF_PYTHON_VERSION="3.9" | ||
export LIBRARY_PATH=/usr/local/opt/binutils/lib:$LIBRARY_PATH | ||
export CMAKE_PREFIX_PATH=/usr/local/opt/binutils:$CMAKE_PREFIX_PATH | ||
``` | ||
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. | ||
|
@@ -406,7 +417,6 @@ After completing preparatory works above, you can compile BMF under macOS and us | |
``` | ||
git submodule update --init --recursive | ||
sed -i '' '/sigma_gn /s/^/\/\//g' bmf/hml/third_party/benchmark/src/complexity.cc | ||
export BMF_PYTHON_VERSION="3.9" | ||
./build_osx.sh | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,15 +392,25 @@ macOS 端编译时需要注意以下几点: | |
d. BMF 依赖 libbfd 库,因此您需要安装 binutils | ||
|
||
``` | ||
brew install binutils | ||
wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.bz2 | ||
tar xvf binutils-2.43.1.tar.bz2 | ||
cd binutils-2.43.1 | ||
./configure --prefix=/usr/local/opt/binutils --enable-install-libiberty | ||
make -j8 | ||
sudo make install | ||
``` | ||
> 注意事项: | ||
> | ||
> 在macOS上安装binutils,您可能遇到`clang: error: unsupported option '-print-multi-os-directory'`这样的报错,这个报错是由于clang不支持此选项,但在macOS平台上,此报错不会影响BMF所依赖库的安装,所以请忽略此报错 | ||
|
||
在进行编译操作之前,您需要检查本地 的 python、ffmpeg 是否链接到正确的版本,如果不是,您可能需要以下命令做出调整 | ||
``` | ||
brew unlink ffmpeg | ||
brew link ffmpeg@4 | ||
export BMF_PYTHON_VERSION="3.9" | ||
brew link --force [email protected] | ||
export BMF_PYTHON_VERSION="3.9" | ||
export LIBRARY_PATH=/usr/local/opt/binutils/lib:$LIBRARY_PATH | ||
export CMAKE_PREFIX_PATH=/usr/local/opt/binutils:$CMAKE_PREFIX_PATH | ||
``` | ||
|
||
上面的命令将把安装路径配置为 ```/usr/local/opt/ncurses```。您也可以根据需要更改路径。编译安装完成后,可以在指定的安装路径中找到 libncurses 库文件。通过以上步骤,就可以在 macOS 上成功编译并安装 libncurses。请注意,该流程可能会因版本更新而发生变化。 | ||
|