如何在msys2中修复./configure?

发布于 2025-01-24 06:45:19 字数 481 浏览 0 评论 0原文

我正在尝试构建 libxc-4.3.4 在Windows 10 。 已经安装了构建工具

pacman -S --needed base-devel mingw-w64-x86_64-toolchain autoconf

我已经在Linux机器上安装了数十个时间, 。第一步是,

./configure --prefix /somewhere

但是在MSYS2中,我得到了

$ ./configure --prefix $PWD/../libxc
bash: ./configure: No such file or directory

如何使这项工作?

I'm trying to build libxc-4.3.4 in an MSYS2 shell on Windows 10. I've installed the latest version of MSYS2 (msys2-x86_64-20220319.exe) and followed the installation instructions. I've installed build tools using

pacman -S --needed base-devel mingw-w64-x86_64-toolchain autoconf

I've installed libxc dozens of time on Linux machines. The first step is

./configure --prefix /somewhere

But in MSYS2 I get

$ ./configure --prefix $PWD/../libxc
bash: ./configure: No such file or directory

How can I make this work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独患者 2025-01-31 06:45:19

MSYS2先决条件

首先确保MSYS2具有所有需要的程序。

在MSYS2 SHELL中首先更新软件包管理器信息:

pacman -Syu --noconfirm

然后安装所需的软件包。我至少建议至少这些:

pacman -S --noconfirm autoconf autoconf-archive automake make libtool pkg-config

接下来的项目来源

您应该确保所处的文件夹实际上具有配置脚本:

ls -l configure

如今许多项目正在切换到更有效的构建系统,例如CMAKE或MESON。
我通常在项目源文件夹中使用以下命令来检查几个构建系统:

ls -ld configure* m4 CMakeLists.txt cmake Makefile GNUmakefile setup.py scons SConscript SConstruct meson.build meson_options.txt *.pro *.proj *.sln BUILD.gn .gn 2> /dev/null

构建libxc

libxc项目 ,我看到有一个cmakelists.txt文件,还有configure.ac < /代码>文件。
因此,要么您应该考虑使用cmake或与以下方式生成配置文件:

touch README ChangeLog
autoreconf -f -i -I m4 

我刚刚尝试使用CMAKE和NINJA在MSYS2中构建LiBXC,而且这有效:

# set the line below to the desired install location
INSTALLPREFIX=D:\Prog\changeme

# build static library
cmake -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_PYTHON:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -S. -Bbuild_static &&
 ninja -Cbuild_static install/strip &&
 echo SUCCESS

# build shared library
cmake -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DENABLE_PYTHON:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -S. -Bbuild_shared &&
 ninja -Cbuild_shared install/strip &&
 echo SUCCESS

MSYS2 prerequisites

First of all make sure MSYS2 has all programs that are needed.

In the MSYS2 shell first update the package manager information:

pacman -Syu --noconfirm

Then install the packages you need. I would recommend at least these:

pacman -S --noconfirm autoconf autoconf-archive automake make libtool pkg-config

Project sources

Next you should make sure the folder you are in actually has a configure script:

ls -l configure

A lot of projects these days are switching to more efficient build systems like CMake or Meson.
I usually use the following command in the projects source folder to check for several build systems:

ls -ld configure* m4 CMakeLists.txt cmake Makefile GNUmakefile setup.py scons SConscript SConstruct meson.build meson_options.txt *.pro *.proj *.sln BUILD.gn .gn 2> /dev/null

building libxc

For the libxc project I see there is a CMakeLists.txt file and also a configure.ac file.
So either you should look into using CMake or generate the configure file with:

touch README ChangeLog
autoreconf -f -i -I m4 

I have just tried to build libxc in MSYS2 with CMake and Ninja and this worked:

# set the line below to the desired install location
INSTALLPREFIX=D:\Prog\changeme

# build static library
cmake -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_PYTHON:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -S. -Bbuild_static &&
 ninja -Cbuild_static install/strip &&
 echo SUCCESS

# build shared library
cmake -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DENABLE_PYTHON:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -S. -Bbuild_shared &&
 ninja -Cbuild_shared install/strip &&
 echo SUCCESS
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文