Skip to content

NetLogo on ARM Devices

jeremy.baker@northwestern.edu edited this page Aug 24, 2021 · 4 revisions

We don't currently have a version pre-built for the Raspberry Pi or other ARM devices, but you should be able to get the Linux version of NetLogo running on any ARM device running java. Here are the steps you'll need to take:

  • Download either the 32-bit or 64-bit linux version from the CCL Website.
  • Untar the downloaded .tgz file
  • cd into the created directory "netlogo-xxxx"
  • Ensure that java -version runs from the command line and shows your version of java is 1.8.
    • If java -version doesn't run it means that java isn't installed or isn't on your path. Follow the appropriate instructions for your device / distro to install java and / or modify your path to include java.
    • If java -version shows an older version of Java you may be able to get NetLogo 5.3.1 or earlier working, upgrade java as appropriate for your device / distro.
  • Create a new file netlogo.sh and copy in the text below these steps
  • run ./netlogo.sh (you may need to make it executable first)

text of NetLogo.sh:

#!/bin/sh
cd "`dirname "$0"`"
java -Xmx1024m -Dfile.encoding=UTF-8 \
 -Dnetlogo.models.dir=app/models \
 -Dnetlogo.docs.dir=app/docs \
 -Dnetlogo.extensions.dir=app/extensions \
 -classpath app/netlogo-X.Y.Z.jar org.nlogo.app.App "$@"

Where X.Y.Z is the version of NetLogo you are using (e.g. 6.2.0 for the most recent version).

You can use the same script to run HubNet by changing org.nlogo.app.App to org.nlogo.hubnet.client.App. In NetLogo 6 and later, netlogo-headless.sh is included in the distribution. netlogo-headless.sh contains basically the same information as the above file but runs netlogo headlessly instead of in GUI mode.

NetLogo/HubNet have the following limitations on ARM systems:

  • The launchers (the four binaries included in the tar) won't run as they've been compiled for x86/x86-64 architecture.
  • Neither NetLogo 3D nor the 3D view in NetLogo will work properly and will raise an exception when opened.
  • It's possible that OS-dependent features (like launching a browser to view help) will work strangely or not at all.

Please let us know your experience! We would be very interested in having community members build NetLogo for different ARM devices which would potentially allow us to get NetLogo 3D and the launcher binaries working on those platforms.

Netlogo on Java 9-Raspbian OpenJDK (not Oracle Java 1.8 or 8)

uname -m
armv7l   ; not any 64 bit
So I downloaded NetLogo-6.2.0-32.tgz, untarred into NetLogo-6.2.0 directory (tar -xvzf NetLogo-6.2.0-32.tgz extracts to "NetLogo 6.2.0" but renamed it)

NetLogo-6.2.0>java -version
openjdk version "9-Raspbian"
OpenJDK Runtime Environment (build 9-Raspbian+0-9b181-4bpo9rpt1)
OpenJDK Server VM (build 9-Raspbian+0-9b181-4bpo9rpt1, mixed mode)

The installed Java is not that of Oracle “1.8” but the 9-Raspbian an OpenJDK version. To first try on Java 9-Raspbian, recreated the netlogo.sh with X.Y.Z as 6.2.0. In .bash_aliases added alias netlogo='/home/pi/Downloads/NetLogo-6.2.0/netlogo.sh'

Now > netlogo comes up with the interface. I ran the Wolf-Sheep-Grass simulation. It works!

Clone this wiki locally