当前位置: 首页 > 工具软件 > Yasm > 使用案例 >

【Linux】nasm/yasm not found

潘向明
2023-12-01

背景

在配置FFmpeg的时候,如下:

cd ~/Git
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg

mkdir -p $(pwd)/build_x64_release_shared 
./configure \
 --prefix=$(pwd)/build_x64_release_shared \
 --disable-static \
 --disable-stripping \
 --disable-doc \
 --enable-shared

遇到nasm/yasm报错如下:

root@3fbaf54f21b4:/path/FFmpeg# ./configure  --prefix=$(pwd)/build_x64_release_shared  --disable-static  --disable-stripping  --disable-doc  --enable-shared
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
root@3fbaf54f21b4:/path/FFmpeg# 

分析:yasm是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。
所以系统中未安装yasm时,就会报上面错误。

如果不需要yasm也可以:

./configure --disable-x86asm

解决办法

apt-get install yasm
安装细节:

root@3fbaf54f21b4:/path# apt-get install yasm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  yasm
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 406 kB of archives.
After this operation, 2164 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 yasm amd64 1.3.0-2build1 [406 kB]
Fetched 406 kB in 4s (100 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package yasm.
(Reading database ... 22072 files and directories currently installed.)
Preparing to unpack .../yasm_1.3.0-2build1_amd64.deb ...
Unpacking yasm (1.3.0-2build1) ...
Setting up yasm (1.3.0-2build1) ...
root@3fbaf54f21b4:/path# 
 类似资料: