![确定 gcc make 是否成功](https://linux22.com/image/1007021/%E7%A1%AE%E5%AE%9A%20gcc%20make%20%E6%98%AF%E5%90%A6%E6%88%90%E5%8A%9F.png)
我是一个非常缺乏经验的 Ubuntu 用户。我通过 SSH 使用我大学的计算机集群。该集群的 gcc 版本太旧,无法安装其他我需要安装的东西,我正尝试在我的用户空间中安装它的更新版本。我尝试安装版本 4.9.4,而集群有 4.4.7。我没有 sudo 权限,无法使用 apt-get。我按照官方 gcc 页面(这也解释了这篇博文我发现)。
gcc 页面说这个make
步骤可能需要很长时间,所以我让它运行了一整夜。在某个时候,我认为我的连接中断了,因为今天早上,我的终端显示“管道中断”。这是make
我笔记本电脑上终端命令显示的最后一件事:
make[2]: Entering directory `/nfs/thry/drpv/Gowri/Software/objdir'
make[3]: Entering directory `/nfs/thry/drpv/Gowri/Software/objdir'
rm -f stage_current
make[3]: Leaving directory `/nfs/thry/drpv/Gowri/Software/objdir'
Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
我希望即使我的 ssh 连接中断,我在集群计算机上输入的命令也应该能够完成运行。我的假设错了吗?
我决定继续尝试make install
,经过几分钟的运行(并在屏幕上显示一系列步骤),我得到了这个:
make[3]: Entering directory `/nfs/thry/drpv/Gowri/Software/objdir/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common'
Makefile:373: .deps/sanitizer_allocator.Plo: No such file or directory
Makefile:374: .deps/sanitizer_common.Plo: No such file or directory
Makefile:375: .deps/sanitizer_common_libcdep.Plo: No such file or directory
Makefile:376: .deps/sanitizer_coverage.Plo: No such file or directory
Makefile:377: .deps/sanitizer_flags.Plo: No such file or directory
Makefile:378: .deps/sanitizer_libc.Plo: No such file or directory
Makefile:379: .deps/sanitizer_libignore.Plo: No such file or directory
Makefile:380: .deps/sanitizer_linux.Plo: No such file or directory
Makefile:381: .deps/sanitizer_linux_libcdep.Plo: No such file or directory
Makefile:382: .deps/sanitizer_mac.Plo: No such file or directory
Makefile:383: .deps/sanitizer_platform_limits_linux.Plo: No such file or directory
Makefile:384: .deps/sanitizer_platform_limits_posix.Plo: No such file or directory
Makefile:385: .deps/sanitizer_posix.Plo: No such file or directory
Makefile:386: .deps/sanitizer_posix_libcdep.Plo: No such file or directory
Makefile:387: .deps/sanitizer_printf.Plo: No such file or directory
Makefile:388: .deps/sanitizer_stackdepot.Plo: No such file or directory
Makefile:389: .deps/sanitizer_stacktrace.Plo: No such file or directory
Makefile:390: .deps/sanitizer_stacktrace_libcdep.Plo: No such file or directory
Makefile:391: .deps/sanitizer_stoptheworld_linux_libcdep.Plo: No such file or directory
Makefile:392: .deps/sanitizer_suppressions.Plo: No such file or directory
Makefile:393: .deps/sanitizer_symbolizer.Plo: No such file or directory
Makefile:394: .deps/sanitizer_symbolizer_libbacktrace.Plo: No such file or directory
Makefile:395: .deps/sanitizer_symbolizer_libcdep.Plo: No such file or directory
Makefile:396: .deps/sanitizer_symbolizer_posix_libcdep.Plo: No such file or directory
Makefile:397: .deps/sanitizer_symbolizer_win.Plo: No such file or directory
Makefile:398: .deps/sanitizer_thread_registry.Plo: No such file or directory
Makefile:399: .deps/sanitizer_win.Plo: No such file or directory
make[3]: *** No rule to make target `.deps/sanitizer_win.Plo'. Stop.
make[3]: Leaving directory `/nfs/thry/drpv/Gowri/Software/objdir/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/nfs/thry/drpv/Gowri/Software/objdir/x86_64-unknown-linux-gnu/libsanitizer'
make[1]: *** [install-target-libsanitizer] Error 2
make[1]: Leaving directory `/nfs/thry/drpv/Gowri/Software/objdir'
make: *** [install] Error 2
这是否意味着安装不正常,我应该尝试重做make
?如果可能的话,我想避免长时间的等待,但如果有必要,我可以重做。抱歉,这个问题比较长,提前谢谢。
答案1
您可以重定向输出以供稍后查看:
make <options> 2>&1 | tee make.out; echo status $?
但我认为断开的 ssh 链接会阻止它完成。如果这是个问题,请使用 mosh 之类的东西。即使您失去所有连接、休眠、更改 AP 等,Mosh 也会让您重新连接断开的会话。