You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Multi2Sim安装求助:Ubuntu 18.04/22.04环境下CMake环节卡滞问题

Multi2Sim安装求助:Ubuntu 18.04/22.04环境下CMake环节卡滞问题

Hey there, I’ve been stuck on this exact CMake hurdle with Multi2Sim on Ubuntu before—let’s walk through the fixes step by step, no jargon overload!

First, nail down all dependencies (this is 90% of the problem)

CMake usually chokes because it can’t find required libraries. Run these commands based on your Ubuntu version:

For Ubuntu 18.04:

sudo apt update && sudo apt install -y build-essential cmake libxml2-dev libsdl1.2-dev zlib1g-dev

For Ubuntu 22.04:

SDL 1.2 is deprecated here, so we need to use SDL 2.0 and some compatibility packages:

sudo apt update && sudo apt install -y build-essential cmake libxml2-dev libsdl2-dev zlib1g-dev libsdl2-ttf-dev

Pro tip: If you get a "package not found" error for any of these, double-check the package name—Ubuntu 22.04 renames some older libs!

Use a clean build directory (don’t cmake directly in the source folder)

Multi2Sim’s build system hates messy source directories. Do this instead:

  1. Grab the stable source code (avoid the latest git master if you can—it might have untested bugs):
    git clone https://github.com/multi2sim/multi2sim.git
    cd multi2sim
    git checkout 4.2.0  # This is a reliable stable version
    
  2. Create a separate build folder:
    mkdir build && cd build
    
  3. Run CMake with explicit paths (this avoids auto-detection failures):
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release
    

If CMake still complains about missing SDL: For Ubuntu 22.04, add -DSDL2_INCLUDE_DIR=/usr/include/SDL2 to the cmake command to point it straight to the headers.

Upgrade CMake if needed

Ubuntu 18.04 ships with CMake 3.10, which is too old for some parts of Multi2Sim’s build script. To upgrade:

sudo apt remove --purge cmake
sudo snap install cmake --classic

Verify the version with cmake --version—you want 3.16 or higher.

Fix common CMake errors you might hit

  • "Could NOT find XML2": Make sure you installed libxml2-dev—sometimes the dev package is easy to miss.
  • "SDL not found": Double-check the SDL version for your Ubuntu release (1.2 for 18.04, 2.0 for 22.04) and re-run the dependency install command.
  • CMake gets stuck on "Configuring done": Kill the process, delete the build folder, re-run cmake with the -DCMAKE_VERBOSE_MAKEFILE=ON flag—it’ll print exactly what’s causing the hang, so you can target that missing dependency.

Once CMake runs successfully, finish the install with:

make -j$(nproc)  # Uses all your CPU cores to speed up building
sudo make install

Test it with m2s --version—if it prints the version number, you’re good to go!

备注:内容来源于stack exchange,提问作者archromex

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 08:43:06