Command-line tool not working

9 views
Skip to first unread message

Jack Sissons

unread,
Jan 20, 2026, 2:47:03 PM (yesterday) Jan 20
to slim-discuss
Hi Ben,

I'm having an issue running SLiM from the command line. It seems the slim tool is not working for me. I'm preparing to do some production runs and so I was running through workshop 22 but it doesn't accept "slim rep.slim", returning the error:

'slim' is not recognized as an internal or external command,
operable program or batch file.

My understanding is that simply installing slim should implement this tool, so I've tried reinstalling slim, buit no dice. Typing slim works if I'm in the install directory, but nowhere else.

Hopefully I'm mkaing a simple mistake. Any help would be greatly appreciated :)

(SLiM 5.1, Windows 11)

Thanks,

Jack

Ben Haller

unread,
Jan 20, 2026, 3:59:51 PM (yesterday) Jan 20
to slim-d...@googlegroups.com
Hi Jack!

I'm not a Windows user, but hopefully someone on this list can help you.  My vague guess would be that maybe `slim` is not in your search path so it isn't being found at all, or maybe you're trying to run a Windows-native build of SLiM inside the WSL, or maybe a WSL-built SLiM inside native Windows, or something like that.  It's interesting that it works if you're in the install directory; that does suggest that maybe you need to add its final destination to your shell's PATH.  Good luck!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/slim-discuss/c8b1cc29-161a-40e7-8b66-1444e980294dn%40googlegroups.com.

Sergio D. Pérez

unread,
Jan 20, 2026, 5:27:01 PM (yesterday) Jan 20
to slim-discuss
Hi Jack,

A couple of months ago, I wrote a tutorial about SLiM 5.x installation process on Windows machines. I hope this works :) When installing the dependencies in Step 2, make sure that they match those in the manual.

Best,
Sergio 
SLiM 5.0 Installation on Windows using MSYS2 (from SLiM5.zip)

## STEP 1: Set up MSYS2

1. Download and install MSYS2 from: https://www.msys2.org
2. Open **MSYS2 MinGW 64-bit** terminal (not MSYS or UCRT).
3. Update the system:
    pacman -Syu
    # Close the terminal if prompted, then reopen and run:
    pacman -Su

## STEP 2: Install dependencies

pacman -S \
  mingw-w64-x86_64-gcc \
  mingw-w64-x86_64-cmake \
  mingw-w64-x86_64-make \
  mingw-w64-x86_64-qt5 \
  mingw-w64-x86_64-qt5-base \
  mingw-w64-x86_64-autotools \
  mingw-w64-x86_64-libpng \
  mingw-w64-x86_64-zlib \
  git #optional, at least you want to install it through GitHub

## STEP 3: Move SLiM5.zip to MSYS2

# If downloaded via browser, it will be in Downloads.
# From MSYS2:
cp /c/Users/antid/Downloads/SLiM5.zip ~ #just unzip the compressed file in your downloads folder
cd ~
unzip SLiM5.zip

# This creates a folder, e.g., SLiM5 or slim_v5, make sure to extract it an rename it at convenience

## STEP 4: Compile SLiMgui

cd /SLiM5   # or adjust if directory has a different name
mkdir build
cd build
cmake -G"MSYS Makefiles" -D BUILD_SLIMGUI=ON ..
make SLiMgui

# Optional: install to mingw64 so slimgui is available system-wide
DESTDIR=/mingw64 make install

## STEP 5: Verify installation

ls /mingw64/bin/slimgui.exe
slimgui &   # Opens SLiMgui

# Inside SLiMgui, test this script:
# initialize() {
#   sim.simulationFinished();
# }

# Console output should confirm SLiM version 5.0

## Notes

- This avoids using `git clone` if you prefer using the .zip from the official site.
- The SLiM_Recipes.zip file contains examples and does not need to be installed — just extract and open the files in SLiMgui.

## Make an alias to open slimgui
nano ~/.bashrc
alias slimgui='"/mingw64/Program Files (x86)/SLiM/bin/SLiMgui.exe"' # save and close
source ~/.bashrc #reload file
slimgui
### to run slim commands
export PATH="$PATH:/mingw64/Program Files (x86)/SLiM/bin" ### Add SliM to the installation path permanently

Reply all
Reply to author
Forward
0 new messages