简体   繁体   English

Windows上的MinGW32 make命令

[英]MinGW32 make command on windows

I am trying to install a simulation software on windows using MingW32 and cmake. 我正在尝试使用MingW32和cmake在Windows上安装仿真软件。

The problem I have is after I use : 我使用后的问题是:

cmake .. -DCMAKE_INSTALL_PREFIX="/cygdrive/c/Gromacs467" -DGMX_X11=OFF -DGMX_GPU=OFF -DGMX_MPI=OFF -DGMX_PREFER_STATIC_LIBS=ON -DGMX_CPU_ACCELERATION=SSE2 -DBUILD_SHARED_LIBS=NO -DGMX_BUILD_OWN_FFTW=ON -VMDDIR="C:\Program Files (x86)\University of Illinois\VMD"  -G "MinGW Makefiles"

From a Microsoft visual studio, (Otherwise I ran in other issue). 从Microsoft的Visual Studio,(否则我遇到了其他问题)。

I then start a MinGW console and go to the repertory where my Makefile was created, and enter the command make, and here is what I get : 然后,我启动一个MinGW控制台,转到创建我的Makefile的目录,然后输入命令make,这就是我得到的:

c:\Temp\gromacs-4.6.7\cmake_build>make
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

And naturally the make command does not actually execute. 当然,make命令实际上不会执行。 Why do I get the windows version ? 为什么我得到Windows版本? No idea.... 不知道....

Interestingly enough, the name of the MniGW32 console change to add make at the end if I enter it more than once, and keeps on doing it later. 有趣的是,如果我多次输入MniGW32控制台的名称,则会在末尾添加make,然后继续进行。

make --version gives the normal output, so I do not understand where the problem comes from. make --version提供正常的输出,所以我不明白问题出在哪里。

c:\Temp\gromacs-4.6.7\cmake_build>make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-msys

If you use cmake ... -G "MinGW Makefiles" you will need to call mingw32-make . 如果使用cmake ... -G "MinGW Makefiles" ,则需要调用mingw32-make

And just a hint: I assume you were previously building with Cygwin and for MinGW32 it should be -DCMAKE_INSTALL_PREFIX="/c/Gromacs467" instead of -DCMAKE_INSTALL_PREFIX="/cygdrive/c/Gromacs467" 提示:我假设您以前使用Cygwin构建,对于MinGW32,它应该是-DCMAKE_INSTALL_PREFIX="/c/Gromacs467"而不是-DCMAKE_INSTALL_PREFIX="/cygdrive/c/Gromacs467"

References 参考

Instead of calling make directly, you can let CMake invoke the build for you with the following syntax: 除了直接调用make ,您还可以让CMake使用以下语法为您调用构建:

cmake --build <build-dir> --target <target-name> --config <build-type>

The --target and --config arguments are optional and <build-dir> must point to your CMake project's build directory. --target--config参数是可选的,并且<build-dir>必须指向CMake项目的build目录。 The main advantage to invoking your build this way is that CMake has already determined the build tool and knows where to find it and how to invoke it correctly. 以这种方式调用构建的主要优点是CMake已经确定了构建工具,并且知道在哪里可以找到它以及如何正确调用它。 Invoking your build via CMake in this manner is likely to be more robust. 以这种方式通过CMake调用构建可能会更健壮。

Basic CMake documentation for the --build option available here and some related material can be found in this blog post , particularly the section "Abstracting away the build tool" (disclosure: I wrote the blog article). 此处提供--build选项的基本CMake文档以及一些相关材料,可以在此博客文章中找到,特别是“抽象化构建工具”部分(披露:我写了博客文章)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM