<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on shinottt</title><link>https://shinottt.org/posts/</link><description>Recent content in Posts on shinottt</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 04 May 2026 13:16:49 +0800</lastBuildDate><atom:link href="https://shinottt.org/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>GROMACS编译 Windows系统</title><link>https://shinottt.org/posts/gromacs%E7%BC%96%E8%AF%91-windows%E7%B3%BB%E7%BB%9F/</link><pubDate>Mon, 04 May 2026 13:16:49 +0800</pubDate><guid>https://shinottt.org/posts/gromacs%E7%BC%96%E8%AF%91-windows%E7%B3%BB%E7%BB%9F/</guid><description>&lt;h1 id="gromacs-with-fftpack">GROMACS with fftpack&lt;/h1>
&lt;p>Windows原生环境下使用MinGW和CMake编译使用fftpack的GROMACS。
GROMACS源代码下载：&lt;a href="https://manual.gromacs.org/current/download.html">GROMACS下载地址&lt;/a>。
工具准备：&lt;a href="https://www.mingw-w64.org/">MinGW&lt;/a>，&lt;a href="https://cmake.org/">CMake&lt;/a>，&lt;a href="https://www.python.org/">Python&lt;/a>。&lt;/p>
&lt;p>从Github上MinGW的release页面下载&lt;a href="https://github.com/niXman/mingw-builds-binaries/releases">x86_64-[版本号]-release-win32-seh-ucrt-rt_v12-rev0.7z&lt;/a>版MinGW编译器，并解压到任意目录，比如 &lt;code>D:/mingw64&lt;/code> 。将 &lt;code>D:/mingw64/bin&lt;/code> 目录添加到系统环境变量PATH中。在PowerShell中使用 &lt;code>gcc --version&lt;/code> 或 &lt;code>g++ --version&lt;/code> 命令查看版本验证MinGW是否安装成功。从CMake和Python官网下载对应Windows系统版本的安装程序，安装时勾选添加到环境变量。安装完成后在PowerShell中使用 &lt;code>cmake --version&lt;/code> 和 &lt;code>python --version&lt;/code> 查看版本信息验证安装。&lt;/p>
&lt;p>下载GROMACS源代码，解压到任意目录，比如 &lt;code>F:/VSCodeFile/GROMACS/&lt;/code> 。使用 &lt;code>tar -zxvf [源代码文件名]&lt;/code> 解压GROMACS源代码，并进入该目录。在PowerShell中执行以下命令：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>cd F:/VSCodeFile/GROMACS
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tar -zxvf gromacs-2024.5.tar.gz
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd gromacs-2024.5
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>进入解压目录后，使用以下指令构建CMake项目：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>cmake -S . -B build -G &lt;span style="color:#e6db74">&amp;#34;MinGW Makefiles&amp;#34;&lt;/span> -DCMAKE_INSTALL_PREFIX&lt;span style="color:#f92672">=&lt;/span>F:/GROMACS-fftpack -DGMX_FFT_LIBRARY&lt;span style="color:#f92672">=&lt;/span>fftpack -DCMAKE_BUILD_TYPE&lt;span style="color:#f92672">=&lt;/span>Release
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cmake --build build --target install
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>cmake参数解释：
&lt;code>-S .&lt;/code> 指定当前目录作为源代码目录；
&lt;code>-B build&lt;/code> 指定构建目录为build文件夹，用于存放编译过程中生成的文件；
&lt;code>-G &amp;quot;MinGW Makefiles&amp;quot;&lt;/code> 指定使用MinGW的Makefile生成器。&amp;ldquo;MinGW Makefiles&amp;quot;生成器会构建MinGW编译器的makefile文件。使用 &lt;code>cmake -G&lt;/code> 查看所有可用的生成器；
&lt;code>-DCMAKE_INSTALL_PREFIX=指定的GROMACS安装路径&lt;/code> ，比如作者的安装路径 &lt;code>F:/GROMACS-fftpack&lt;/code> ；
&lt;code>-DGMX_FFT_LIBRARY=fftpack&lt;/code> 指定使用fftpack库支持FFT (Fast Fourier Transform) 计算。还可以使用fftw3，mkl等其他库；
&lt;code>-DCMAKE_BUILD_TYPE=Release&lt;/code> 指定编译类型为发布模式，编译器一般会对Release模式进行优化，提高运行效率；
&lt;code>--build build&lt;/code> 指定CMake构建目录，进行编译安装；
&lt;code>--target install&lt;/code> 构建install目标，使用CMakeLists.txt中的install()命令进行安装；
更多编译选项可查看&lt;a href="https://manual.gromacs.org/current/install-guide/index.html">GROMACS官方文档&lt;/a>。&lt;/p></description></item></channel></rss>