Apple has released the latest Command Line Tool which is compatible with the latest macOS 13 Ventura. To update, do the following steps:
- Click "" icon from the top left corner, select "System Settings...".
- Navigate to "General" -- "Software Update".
- Update Command Line Tool.
- Open "terminal".
- Run the following command:
xcode-select --install
- Select "Install" to finish installation.
- After installed SUMO instructed by official doc. You need to add following line in ".zshrc" file:
# on Apple Silicon Mac
echo "export SUMO_HOME=/opt/homebrew/opt/sumo/share/sumo" >> ~/.zshrc
# on Intel Mac, depends on your SUMO version
echo "export SUMO_HOME=/usr/local/Cellar/sumo/1.14.1/share/sumo/" >> ~/.zshrc
- Steps to open "sumo-gui" if you have installed GUI apps from brew:
- Open "Finder", from left side column, navigate to "Applications" folder (located at /Applications).
- Find
SUMO GUI.app
, right click, select "Open". And choose "Open" in the warning dialogue. - If you don't see the warning dialogue above. Right click again, and "Open" again until you see the warning dialogue.
- Do the same for other SUMO GUI apps.
- If the above method doesn't work sometimes, run command:
xattr -cr /path/to/sumo_application.app
- SUMO Docker Installation Guide
This Dockerfile has only been tested on Apple Silicon Mac with macOS 13.0 Ventura, but generally the Dockerfile should be useful for others who wants to build SUMO docker on their own. It is created as a workaround for Mac users with the latest macOS because of lack of the compatible Command Line Tool (CLT) to compile sumo packages. This guide contains the latest method of connecting X11 app and enable OpenGL via docker, while the old socket-passing way doesn't work and will not work in the near future.
- Dockerfile - docker file instructions for creating container image
- README.md - this file as a manual for installation
- sumo-gui.sh - startup file used to launch app after building the SUMO image
- macOS (Other OS not tested, you can use this Dockerfile as a base for other OS though)
- Apple Silicon Mac (X11 forwarding and Xquartz only tested on these Macs, Intel Mac not tested but could try)
- Docker installed: see doc from here.
- XQuartz.app installed: from Homebrew. Make sure "/opt/X11/bin" or "/usr/X11/bin" is in your "PATH" environmental variable (You may need to logout/login or restart your Mac to make the settings take effect).
- A text editor at your choice.
- A terminal at your choice.
All steps will take approx. 3-10 mins.
- Download "Dockerfile" and "sumo-gui.sh" to your local disk.
- Launch XQuartz. Under the XQuartz menu, select Preferences
- Go to the security tab and ensure "Allow connections from network clients" is checked. Close Preferences window.
- Open a terminal.
- Type "defaults write org.xquartz.X11 enable_iglx -bool true" and hit enter key. This will write settings to enable OpenGL for XQuartz, which is used in SUMO. Close terminal.
- Logout and login again, or fully restart your Mac.
- open "Dockerfile" in a text editor.
- Modify username to your preferred one at line 5. Save the modified file.
- Open a terminal and navigate to the directory where the Dockerfile is located.
- Run command "docker build -t sumo-docker ." (NOTE: there is a dot in the end of the command). It will take some time to build the image.
- During the waiting time, we can continue to the following steps.
- Copy or move "sumo-gui.sh" to the working directory where you store your sumo configurations. (e.g. your local sumo folder holding configurations)
- Open "sumo-gui.sh" in a text editor.
- Modify "SUMO_USER" (at line 3) to the username you have set for the Dockerfile.
- Modify "WORKING_DIR" (at line 4) to the working directory you have chosen. The file in this directory will be visible to SUMO in the docker container at "/home/username/sumo".
- Save the modified file.
- Check whether the docker image has been built. If it's done, proceed to the following steps.
Run command:
zsh sumo-gui.sh
- Modify "CMD" (at line 5) from "sumo-gui" to "netedit" in "sumo-gui.sh". Then run command:
zsh sumo-gui.sh
For other apps, do the same as above.
In any SUMO app, when you opening an existing file or saving a file, choose from "/home/username/sumo" in the container. On your host machine, all necessary files/folders should be available in the same working directory set in the "sumo-gui.sh".
- [flexible start, suggested] In order to run any command in the docker container, modifty "CMD" (at line 5) from "sumo-gui" to "/bin/bash" in "sumo-gui.sh". This will open an interactive terminal session for the container where you can run any command like "sumo-gui" and "netedit" without rerunning the script again when switching app.
- [keeping container, not suggested] If you want to keep the created container for next time (although it's not suggested since the image has the SUMO installed and the persisting data is store on the host Mac, except that you have modified/added new libs/packages to the existing container), you can remove "--rm" flag at line 11 in "sumo-gui.sh". From next launch, you need to run line 8 & 9 from the script first, then run the existing container.
- Feel free to make your own customized lauchning script.
- In macOS Ventura, when you close a secondary window (e.g. saving window, config window), the main window will disappear. The application is actually still running, it's a bug in latest macOS. Activate mission control (control+up, or swipe up with 3 fingers, or Mission Control Key on Magic Keyboard if has), you will see a transparent XQuartz window, clicking on the window will bring it back.
- If you just want to make X11 forwarding work on Mac Docker, go through this comprehensive tutorial: https://gist.github.com/paul-krohn/e45f96181b1cf5e536325d1bdee6c949
- If your docker X11 app needs to enable OpenGL, do the following steps on your Mac:
- Follow the steps in section 2.2.1 Set up XQuartz
- Run the following lines every time before starting your docker app (you can make it automatic):
# enable connection from localhost
xhost +localhost
# specify the correct DISPLAY variable
export DISPLAY=:0
- Add the following arg when using "docker run":
-e LIBGL_ALWAYS_INDIRECT=1
- Further reading, see original posts here: XQuartz/XQuartz#144 (comment)