gpt4 book ai didi

shell - 如何将 TMPDIR 环境变量设置为另一个目录?

转载 作者:行者123 更新时间:2023-12-04 16:23:25 24 4
gpt4 key购买 nike

我正在尝试编译 ffmpeg 并且 tmp 目录有问题,因为它是用 noexec 挂载的:

./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared Unable to create and execute files in /tmp. Set the TMPDIR environment variable to another directory and make sure that it is not mounted noexec. Sanity test failed.

If you think configure made a mistake, make sure you are using the latest version from SVN. If the latest version fails, report the problem to the ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.err" produced by configure as this will help solving the problem.


如何将 TMPDIR 环境变量设置为另一个目录?

最佳答案

我能够使用下面的代码完成它:

$ export TMPDIR=~/tmp-ffmpeg

$ mkdir $TMPDIR

$ ./configure \
--enable-gpl \
--enable-version3 \
--enable-shared \
--enable-nonfree \
--enable-postproc \
--enable-libfaac \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libxvid \
--enable-x11grab \
--extra-cflags="-I/usr/local/include" \
--extra-ldflags="-L/usr/local/lib"

$ make
$ make install
$ rm -rf $TMPDIR
$ unset TMPDIR
还有 mktemp(1)命令。这样您就可以按如下方式设置 TMPDIR:
$ TMPDIR="$(mktemp -d -q ~/tmp/tmp.XXXXX)"
$ echo $TMPDIR
/home/marcelo/tmp/tmp.I8V9H
这应该适用于 GNU coreutils 以及 BSD(macOs、FreeBSD 等)。另请注意,您无需导出 TMPDIR 然后取消设置。而是尝试直接传递变量来配置:
$ TMPDIR="/foo/bar/baz" ./configure ...
希望它可以帮助其他人;-)

关于shell - 如何将 TMPDIR 环境变量设置为另一个目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11697214/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com