AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[make](ubuntu)

Martin Hope
KeShAw
Asked: 2025-02-12 05:38:31 +0800 CST

就“make”命令而言,删除和修改文件的区别

  • 6
blah: blah.o
    cc blah.o -o blah # Runs third

blah.o: blah.c
    cc -c blah.c -o blah.o # Runs second

blah.c:
    echo "int main() { return 0; }" > blah.c # Runs first

当我运行make命令时,它给出了预期的输出。现在,如果我运行touchblah.c 文件,输出为cc -c blah.c -o blah.o cc blah.o -o blah,但是当我运行deleteblah.c 文件时,它继续创建它并且输出为echo "int main() {return 0; }" > blah.c cc -c blah.c -o blah.o cc blah.o -o blah。

现在我无法理解的是,“blah”如何知道 blah.c 不可用。它只是检查了 blah.o,其时间戳没有改变。是不是 blah.o 自己在被“blah”检查时检查了 blah.c 是否有任何更新。无论如何,为什么两个输出不同。是不是touching 文件 blah.c 并没有删除它,而 blah.o 知道这一点,所以它只是更新了它的时间戳。到底发生了什么?

make
  • 2 个回答
  • 53 Views
Martin Hope
game lover
Asked: 2022-02-08 13:41:20 +0800 CST

如何修改已经编译的makefile?

  • 0

假设我有一个如下所示的生成文件:

all: a_functions.o b_functions.o c_functions.o d_functions.o main.o
     gcc -o all a_functions.o b_functions.o c_functions.o d_functions.o main.o
a_functions.o: a_functions.c
     gcc -c -o a_functions.o a_functions.c
b_functions.o: b_functions.c
     gcc -c -o b_functions.o b_functions.c
c_functions.o: c_functions.c
     gcc -c -o c_functions.o c_functions.c
main.o: main.c
     gcc -c -o main.o main.c

我可以使用命令编译它

sudo make -f makefile

如果我运行,程序运行良好

./all

但是如果我想在makefile中添加一个干净的命令怎么办?我添加了

clean:
     rm *.o all

在makefile的末尾,但我的终端显示

-bash: ./clean: No such file or directory

当我这样做时 ./clean

当然重新编译makefile也不起作用。表明

make: 'all' is up to date.

当我做sudo make -f makefile

我在这里找到了如何编辑makefile?你可以使用

$ CFLAGS="-std=c99" make

终端中的此命令,或者我可以添加

CFLAGS=-std=c99

在我的makefile中,但它们仍然显示

一切都是最新的

该图像只是证明修改对我不起作用的证据。

在此处输入图像描述

make
  • 1 个回答
  • 252 Views
Martin Hope
ADBeveridge
Asked: 2021-09-06 20:24:49 +0800 CST

GNOME Builder 安装失败

  • 1

GNOME Builder 无法安装我的 Autotools 项目,因为它没有预先sudo添加到make install命令中。如何强制 Builder 添加sudo?

make
  • 2 个回答
  • 211 Views
Martin Hope
matthew
Asked: 2021-08-12 21:36:40 +0800 CST

什么是构建目录?

  • 0

我正在尝试按照https://github.com/audacity/audacity/blob/master/BUILDING.md中的说明构建 Audacity 最后第二步:

$ cd <build directory>

这是什么意思?以及如何构建软件?

make
  • 1 个回答
  • 2100 Views
Martin Hope
eri0o
Asked: 2020-12-21 06:46:43 +0800 CST

如何从源代码构建 SDL2 并制作 debian 包并安装 debian 包?

  • 1

我想从源代码构建 SDL2,这样我就可以使用更新的版本,它更喜欢 dlopen 而不是链接到像来自 ubuntu 包管理器的包之类的库,但也因为我想在旧版本的 Ubuntu 中构建它,所以它有更好的 glibc 兼容性。

问题是我还想生成一个工件,它是我的项目的 debian 包,但我还需要将 SDL2 构建为安装在系统上的 debian 包,以便在打包我的项目时生成正确的规则。

我从 SDL2 (2.0.12) 解压源代码,使用./configure并make构建源代码。然后我用来 dpkg-buildpackage -us -uc为 SDL2 构建 debian 包。问题是生成的软件包无法安装并抱怨未满足的 libudev 依赖项,该依赖项已安装在我的系统中。从 sdl2 源构建 debian 包时我缺少什么吗?

dpkg packaging make sdl
  • 1 个回答
  • 539 Views
Martin Hope
holdtheline
Asked: 2020-11-28 07:44:12 +0800 CST

用 make 编译的卸载程序

  • 1

我正在尝试了解有关make命令的一些内容,即使我已经阅读了手册,我仍然对它的用法有一些疑问。特别是,如果我在终端上使用“经典”命令序列安装程序(由许多包组成),即:

./configure -prefix /usr/bin/my_program (这里指的是一些软件通常提供的配置文件)

制作

须藤使安装

卸载该程序的逆操作是什么?删除之前选择的整个目录就足够了吗?(例如使用 sudo rm -r /usr/bin/my_program)。

感谢任何好心的人向我解释

make configure
  • 2 个回答
  • 595 Views
Martin Hope
Shadow
Asked: 2020-10-19 12:37:29 +0800 CST

使用 linuxthreads 编译 glibc 2.3

  • 0

我正在尝试使用插件 linuxthreads ( https://ftp.gnu.org/gnu/glibc/编译 glibc 2.3 ( https://ftp.gnu.org/gnu/glibc/glibc-2.3.tar.gz ) glibc-linuxthreads-2.3.tar.gz)在 ubuntu 18.04 下。自述文件的要求是:

  • gcc (3.2 或更新)
  • GNU make 版本 3.79 或更新版本
  • binutils 2.10.1 或更高版本
  • 2.2 内核头文件

我应该安装较旧的发行版还是可以在较新的发行版上执行此任务。非常感谢任何建议或指示。

我可以使用支持 linuxthreads 的最新版本,即 glibc 2.5。我选择了 2.3,因为我已经阅读了 README。

到目前为止,我设法安装了 gcc 3.3。但我坚持尝试安装 gnu make 3.x(3.82 或 3.79)。

CC=gcc-3.3 ./configure --enable-add-ons=linuxthreads --prefix=<mypath>/glibc
loading cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking sysdep dirs... sysdeps/x86_64/elf linuxthreads/sysdeps/unix/sysv/linux/x86_64 linuxthreads/sysdeps/unix/sysv/linux linuxthreads/sysdeps/pthread sysdeps/pthread linuxthreads/sysdeps/unix/sysv linuxthreads/sysdeps/unix linuxthreads/sysdeps/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking build system type... x86_64-unknown-linux-gnu
checking for gcc... gcc-3.3
checking version of gcc-3.3... 3.3.6, ok
checking for gnumake... no
checking for gmake... no
checking for make... no
configure: error: 
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

make 必须低于版本 4。

compiling make glibc 18.04
  • 1 个回答
  • 780 Views
Martin Hope
mLstudent33
Asked: 2020-10-16 21:45:11 +0800 CST

openmpi 安装在本地和远程服务器上失败

  • 2

我尝试4.0.5.tar.gz在学校的 Ubuntu 18.04 LTS 服务器上安装版本,但按照此处的说明失败了:

shell$ gunzip -c openmpi-4.0.5.tar.gz | tar xf -
shell$ cd openmpi-4.0.5
shell$ ./configure --prefix=/usr/local
<...lots of output...>
shell$ make all install

所以我尝试了 3.1.6 版本,但又失败了。

错误是:

  make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/share/openmpi/amca-param-sets'
 /usr/bin/install -c -m 644 amca-param-sets/example.conf '/usr/local/share/openmpi/amca-param-sets'
/usr/bin/install: cannot remove '/usr/local/share/openmpi/amca-param-sets/example.conf': Permission denied
Makefile:1806: recipe for target 'install-dist_amca_paramDATA' failed
make[2]: *** [install-dist_amca_paramDATA] Error 1
make[2]: Leaving directory '/home/T00057442/openmpi31/openmpi-3.1.6/contrib'
Makefile:1897: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/T00057442/openmpi31/openmpi-3.1.6/contrib'
Makefile:1896: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

对于服务器上和本地的版本 3.1.6:

make[2]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/share/openmpi/amca-param-sets'
/bin/mkdir: cannot create directory ‘/usr/local/share/openmpi’: Permission denied
Makefile:1789: recipe for target 'install-dist_amca_paramDATA' failed
make[2]: *** [install-dist_amca_paramDATA] Error 1
make[2]: Leaving directory '/media/nobu/UbuntuFiles/Downloads/openmpi-4.0.5/contrib'
Makefile:1880: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/media/nobu/UbuntuFiles/Downloads/openmpi-4.0.5/contrib'
Makefile:1879: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

所以两次都是install-am?那是什么,有人成功安装了 openmpi 或 mpich 吗?我需要 Ray Surveyor:http: //zorino.github.io/raysurveyor-tutorial/#/42

编辑:我跑

base) nobu@gold3forever:~/Desktop/BioInformatics/RA/kover/ray$ mpiexec --version
mpiexec: error while loading shared libraries: libopen-rte.so.40: cannot open shared object file: No such file or directory

然后我尝试了:

(base) nobu@gold3forever:~/Desktop/BioInformatics/RA/kover/ray$ mpirun --version
mpirun: error while loading shared libraries: libopen-rte.so.40: cannot open shared object file: No such file or directory

最后

(base) nobu@gold3forever:~/Desktop/BioInformatics/RA/kover/ray$ mpicxx --showme:version
mpicxx: error while loading shared libraries: libopen-pal.so.40: cannot open shared object file: No such file or directory

我以为我没问题,按照@NORbert 在他的回答中的指示,但是当我尝试安装 Ray Surveyor 时,我得到了

(base) nobu@gold3forever:~/Desktop/BioInformatics/RA/kover/ray$ make PREFIX=`pwd`/BUILD MAXKMERLENGTH=64 HAVE_LIBZ=y HAVE_LIBBZ2=y ASSERT=n;
  CXX code/application_core/ray_main.o
mpicxx: error while loading shared libraries: libopen-pal.so.40: cannot open shared object file: No such file or directory
Makefile:160: recipe for target 'code/application_core/ray_main.o' failed
make: *** [code/application_core/ray_main.o] Error 127
command-line compiling make
  • 3 个回答
  • 966 Views
Martin Hope
jmaloney1985
Asked: 2020-10-08 07:36:13 +0800 CST

使用“make install”命令时出错

  • 1

我正在尝试安装需要安装某些库的 WRF 天气软件( http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php#STEP7 )。我可以解压缩 zip 文件,运行configure并make执行得很好,但是当我尝试时make install,我收到以下错误:

make  install-recursive
make[1]: Entering directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4'
Making install in src/mpl
make[2]: Entering directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4/src/mpl'
make[3]: Entering directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4/src/mpl'
/usr/bin/mkdir -p '/{path_to_dir}/Build_WRF/LIBRARIES/mpich/lib'
/usr/bin/mkdir: cannot create directory ‘/{path_to_dir}’: Permission denied
make[3]: *** [Makefile:409: install-libLTLIBRARIES] Error 1
make[3]: Leaving directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4/src/mpl'
make[2]: *** [Makefile:893: install-am] Error 2
make[2]: Leaving directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4/src/mpl'
make[1]: *** [Makefile:23607: install-recursive] Error 1
make[1]: Leaving directory '/home/jmaloney1985/Desktop/Programs/Build_WRF/LIBRARIES/mpich-3.0.4'
make: *** [Makefile:23930: install] Error 2

对此有什么想法?非常感谢任何输入。

谢谢!

command-line error-handling makefile make execute-command
  • 1 个回答
  • 1366 Views
Martin Hope
HC Pieck
Asked: 2020-10-05 04:06:51 +0800 CST

如何为 macbook pro 2018 安装驱动程序?

  • 1

我最近在我的 MBP 2018 上安装了 Ubuntu 20.04 和 MacOS。

现在我正在尝试从MCMrARM安装驱动程序,但是运行 Makefile 给了我这个:

make -C /lib/modules/5.4.0-48-generic/build M=/home/hcpieck/mbp2018-bridge-drv modules
make[1]: 进入目录'/usr/src/linux-headers-5.4.0 -48-generic'
arch/x86/Makefile:147: CONFIG_X86_X32 启用但没有 binutils 支持
make[1]: gcc: Command not found
CC [M] /home/hcpieck/mbp2018-bridge-drv/pci.o
/bin/ sh: 1: gcc: not found
make[2]: *** [scripts/Makefile.build:275: /home/hcpieck/mbp2018-bridge-drv/pci.o] 错误 127
make[1]: *** [Makefile:1734: /home/hcpieck/mbp2018-bridge-drv] 错误 2
make[1]: 离开目录 '/usr/src/linux-headers-5.4.0-48-generic'
make: *** [Makefile :10: 全部] 错误 2

我错过了什么?

谢谢,

drivers compiling macbook-pro make 20.04
  • 1 个回答
  • 2595 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve