AMLSim icon indicating copy to clipboard operation
AMLSim copied to clipboard

Working project setup on Windows 11 2025?

Open MJimmyChen-reform opened this issue 10 months ago • 1 comments

Hey,

I've been trying to get this project set up and working with Windows 11 and it looks like there are way too many adaptations to be done to get it working.

  • Pygraphviz problems -> resolved through an Anaconda install
  • Since the jar files are older versions you mostly have to google the jar file together with the version and get most of them through mvnrepository
  • Had to do some adaptations (Through ChatGPT/LLM) in the run_AMLSim.sh as classpath separators were different for Windows vs Unix
  • python3 scripts/visualize/plot_distributions.py conf.json AND python3 scripts/validation/validate_alerts.py conf.json
  • For these two optional steps I had to manually remove the empty lines in the tmp/sample/ CSV files and some more fixes for index out of bounds etc

I might have forgotten some, but can somebody tell me that they were able to do a clean set up from scratch without having to all these 'manual' steps that are not documented? Especially the ones that need you to change code or clean the CSVs...

MJimmyChen-reform avatar Mar 06 '25 12:03 MJimmyChen-reform

✅ How I Successfully Ran AMLSim on macOS (Python 3.8, Java)

After spending several hours troubleshooting, I wanted to share a complete setup guide for getting the AMLSim simulator running on macOS. This should help anyone else who encounters similar issues.

✅ First, use Python to generate data
✅ Then, run the Java simulator with those files


1. Set Up Python Environment

⬇️ Use Python 3.8 (important)

python3.8 -m venv .venv
source .venv/bin/activate

📦 Install Graphviz (required for pygraphviz)

If pygraphviz can't find Graphviz headers, you'll get errors like fatal error: 'graphviz/cgraph.h' file not found.

brew install graphviz

Check install location:

brew --prefix graphviz
# Should return something like: /opt/homebrew/opt/graphviz

🔧 Install pygraphviz with header paths

export CFLAGS="-I/opt/homebrew/opt/graphviz/include"
export LDFLAGS="-L/opt/homebrew/opt/graphviz/lib"
pip install wheel
pip install --no-cache-dir --no-build-isolation pygraphviz

Adjust the paths above if your brew --prefix graphviz returns a different location.

📦 Install remaining Python dependencies

pip install -r requirements.txt

2. Set Up Java + MASON

Make sure Java and Maven are installed. Then download MASON 20.

⬇️ Download MASON 20

Get it from: https://cs.gmu.edu/~eclab/projects/mason/

Place mason.20.jar into the jars/ folder of this project.

📦 Install the JAR into Maven

mvn install:install-file \
  -Dfile=jars/mason.20.jar \
  -DgroupId=mason \
  -DartifactId=mason \
  -Dversion=20 \
  -Dpackaging=jar \
  -DgeneratePom=true

3. Generate Data Using Python

This creates the transaction graph required by the Java simulator:

python scripts/transaction_graph_generator.py conf.json

Check that it creates the tmp/ directory and associated CSV files.

4. Run the Java Simulator

🔨 Build AMLSim JAR (run once)

sh scripts/build_AMLSim.sh

This compiles the project and builds the JAR under target/.

▶️ Run the simulation

sh scripts/run_AMLSim.sh conf.json

Hope this helps anyone else who runs into the same issues I did.

touchyongan avatar Jun 02 '25 08:06 touchyongan