Page 1 of 1

nrngui not opening main menu GUI on startup on M1 Mac

Posted: Sun Nov 07, 2021 8:21 pm
by was2be
I recently set up a new M1 MacBook Pro, installing XQuartz (2.8.1) and NEURON 8.0.0 for ARM. Each individually works fine. But opening nrngui does not trigger X11 to open or the main menu to pop up. Opening nrngui.hoc, either directly or in Python 3.9.8, returns "1.0", but no GUI (main menu). Running hoc code on nrngui works fine, and outputs data, but never triggers Main Menu. Anyone else experiencing this issue? How to solve? Thanks.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 1:52 pm
by hines
I believe the problem is that the NEURON installation attempts to find libX11.dylib in /opt/homebrew/opt/libx11/lib/libX11.6.dylib
If you try to launch /Applications/NEURON/idraw, I expect you will see the error:

Code: Select all

dyld: Library not loaded: /opt/homebrew/opt/libx11/lib/libX11.6.dylib
Do you happen to have an /opt/X11 folder? (That is where the XQuartz.org package installed (/opt/X11/lib/libX11.dylib) on my M1)
If so

Code: Select all

mkdir -p /opt/homebrew/opt
ln -s /opt/X11 /opt/homebrew/opt/libx11
may work around the problem.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 3:45 pm
by was2be
I tried the suggestion below (there is a /opt/X11 folder). nrngui and neurodemo continue to open without GUI, regardless of whether X11 is already open or not; X11 is not opened by nrngui or neurondemo if it is not open).

I also tried totally restoring my computer, and afterward installing only Xcode (1st), then python 3 (via homebrew; 2nd), then Xquartz (3rd), then NEURON (4th). I installed nothing else. Same issue. Could this be because MacOS12 uses zsh rather than bash (as my old 10.14 used)?

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 5:17 pm
by hines
Look at the output of

Code: Select all

otool -L /Applications/NEURON/bin/idraw 
and note the location it expects to find libX11.6.dylib
On my machine that is /opt/homebrew/opt/libx11/lib/libX11.6.dylib
Also is that the error generated in the terminal that is popped up when you launch

Code: Select all

/Applications/NEURON/bin/idraw
On my machine also I see:

Code: Select all

ls -l /opt/homebrew/opt/libx11/lib/libX11.6.dylib
-r--r--r-- 1 hines  admin  1027792  Jul  15 08:22  /opt/homebrew/opt/libx11/lib/libX11.6.dylib
My hope with the symbolic link in my previous comment is that you would see the same thing. What is it that you actually do see?
I note that the symbolic link seems to work on my machine as I tested with

Code: Select all

cd /opt/homebrew/opt
mv libx11 libx11.orig
ln -s /opt/X11 libx11

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 5:40 pm
by was2be
Below is the output for "otool -L /Applications/NEURON/bin/idraw". Seems the same location as yours.



Layer5 ~ % otool -L /Applications/NEURON/bin/idraw
/Applications/NEURON/bin/idraw:
/opt/homebrew/opt/libx11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/homebrew/opt/libxext/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)
Layer5 ~ %

When opening nrngui (or neurondemo, as below), I get no errors. Below is the output, and neuron is ready-to-go. But no GUI.

-e
NEURON -- VERSION 8.0.0 release/8.0 (429d11ef) 2021-04-30
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /Applications/NEURON//share/nrn/demo/release/arm64/.libs/libnrnmech.so
Additional mechanisms from files
"cabpump.mod" "cachan1.mod" "camchan.mod" "capump.mod" "invlfire.mod" "khhchan.mod" "mcna.mod" "nacaex.mod" "nachan.mod" "release.mod"
oc>

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 7:48 pm
by hines
I asked that you launch idraw. Also I wondered if you had made the symbolic link and so asked for what was printed by

Code: Select all

ls -l /opt/homebrew/opt/libx11/lib/libX11.6.dylib
But no matter, I think it is necessary that I create a new installer where idraw and nrniv look in /opt/X11/lib for the X11 library.
When that happens I'll comment here on where it can be downloaded.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Wed Nov 10, 2021 8:05 pm
by was2be
Thanks. For what it's worth, tonight I again "restored" my Mac back to factory settings. After setting up my account from scratch (logging into iCloud), I did the following:

1. Installed Command Line Tools via terminal command line (MacOS volunteered this after I entered python3 to see if 3.9.8 is installed in Monterey at base, or if it is installed only later with Xcode... it is installed only later, as was present after install of command line tools).

2. Installed Xquartz.

3. Installed NEURON.

No other software was installed, and I didn't go via homebrew to install other versions of python (i.e., no /opt/homebrew folder in this install). Same issue... no GUI.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Thu Nov 11, 2021 7:22 pm
by hines
Please drag the /Applications/NEURON folder to the trash to uninistall and install the file https://github.com/neuronsimulator/nrn/ ... -38-39.pkg
1) This will look under /opt/X11 for the xquartz libraries instead of /opt/homebrew/opt/libx11.
2) On pkg installation, PYTHONPATH and PATH will be set in $HOME/.zprofile
3) NEURONMainMenu/Files/workingdir after moving to the desired working directory will dynamically load arm64/libnrnmech.dylib if it exists.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Thu Nov 11, 2021 7:50 pm
by was2be
This installation works! Thanks for helping fix this.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Fri Sep 16, 2022 10:03 pm
by mkap
Hi Hines,
Would you mind posting that install file again? I think I may be having the same problem that was2be had.
Thanks much,
-mk

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Sat Sep 17, 2022 2:45 pm
by hines
On Aug 25, 2021 the master was modified so that on the Mac, X11 is looked for at /usr/X11 instead of in /opt/homebrew. I see that version 8.1.0
and more recent versions contain this fix.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Sat Sep 17, 2022 2:59 pm
by mkap
Thanks. I'm still having an issue, unfortunately - I went through a fresh install, including X11 and anaconda and command line tools, and the test recommended in the Quick Start guide worked fine, giving me the main menu bar....but doubleclicking nrngui, or neurondemo, gives me an error:

Attempt to fix nrniv failure using: eval "`mk_nrnpyenv.sh`" failed.
NEURON -- VERSION 8.2.0 HEAD (156b9dee3) 2022-07-01
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

Could not dlopen NRN_PYLIB: /Users/mkap/opt/anaconda3/lib/libpython3.9.dylib
libnrniv.dylib running as arm64
but /Users/mkap/opt/anaconda3/lib/libpython3.9.dylib can only run as x86_64

Does this message suggest a fix? I'm stumped.
Thanks again,
-mk

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Sat Sep 17, 2022 3:18 pm
by hines
Please see https://nrn.readthedocs.io/en/latest/in ... tml#mac-os with special attention to the information that begins
Universal2 installers generally “just work” on either an x86_64 or arm64 architecture.
Your problem is that nrniv is a universal program that starts up by default as an arm64 program but your anaconda python is exclusively x86_64.
You can start nrniv as an x86_64 program but I'm kind of surprised that anaconda still does not have an arm64 version for the M1.

Re: nrngui not opening main menu GUI on startup on M1 Mac

Posted: Sat Sep 17, 2022 3:26 pm
by hines
Hmmm. Maybe anaconda does now have an M1 version.
https://www.anaconda.com/blog/new-relea ... porting-m1
But it is surprising that the filename of the download is Anaconda3-2022.05-MacOSX-x86_64.pkg. so I guess I'm skeptical that that is a universal2 installer.