Compiling Mod Files on Catalina

The basics of how to develop, test, and use models.
Post Reply
landoskape
Posts: 3
Joined: Sat Oct 17, 2020 3:08 pm

Compiling Mod Files on Catalina

Post by landoskape »

Hi. I just downloaded NEURON on Mac Catalina (10.15.7) and am trying to compile mod files from modeldb.

I have tried two ways, dragging a mod folder (with a list of .mod files in it) to the mknrndll application. I have also tried navigating to the mod folder in a terminal and running mknrndll directly.

Afterwards, an x86_64 folder is successfully created that contains .mod files, .c files, .o files, and an empty x86_64 folder. There are no hidden files present. Both methods throw the following error:

Code: Select all

clang-4.0: error: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libreadline.tbd'
make: *** [x86_64/libnrnmech.dylib] Error 1
I've tried reinstalling command line tools (I had to download it from a dmg file on developer.apple.com, I downloaded "Command Line Tools for XCode 12".

Seems like I'm missing a file that is needed to make some of the mod files. Any thoughts?
landoskape
Posts: 3
Joined: Sat Oct 17, 2020 3:08 pm

Re: Compiling Mod Files on Catalina

Post by landoskape »

Problem solved. Running mknrndll called the libreadline function from the Xcode.app directory in applications. That folder doesn't exist without downloading Xcode, which I did from the app store. After downloading XCode (12.1), I compiled the mod directory again and it was successful.
ted
Site Admin
Posts: 5839
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Compiling Mod Files on Catalina

Post by ted »

Thank you for reporting how you fixed the problem.

So "Command Line Tools for XCode 12", which you installed first, isn't the same as "Xcode 12.1", which fixed the problem?
aplainbee
Posts: 2
Joined: Sun Nov 15, 2020 5:43 pm

Re: Compiling Mod Files on Catalina

Post by aplainbee »

Hi! I ran into the exact same problem as landoskape when I was attempting to run the 2002 MRG axon model(Accessible at https://senselab.med.yale.edu/ModelDB/s ... 810#tabs-1). I was wondering if anyone could suggest any other tips on how to configure my computer to successfully compile the mod file. I've made sure that I've downloaded XQuartz, Xcode 12.2, and the Command Line Tools for 12.2. Additionally, I can run NEURON fine by itself, but running the model is proving to be a challenge. I'd appreciate any insight, thank you in advance!

Here is the error I get when I try compiling AXNODE.mod.

Code: Select all

[-e 
/usr/bin/xcrun
Creating x86_64 directory for .o files.

/Users/p.bhat/Desktop/MRGaxon
AXNODE.mod
AXNODE.mod
mkdir -p x86_64
 -> Compiling mod_func.c
cc -g  -O2   -I. -I..   -I/Applications/NEURON-7.8//include  -I/usr/local/Cellar/open-mpi/4.0.1_1/include -fPIC -c mod_func.c -o mod_func.o
 -> NMODL AXNODE.mod
MODLUNIT=/Applications/NEURON-7.8//share/nrn/lib/nrnunits.lib \
	  /Applications/NEURON-7.8//bin/nocmodl AXNODE.mod
Translating AXNODE.mod into AXNODE.c
Thread Safe
 -> Compiling x86_64/AXNODE.c
(cd .. ; cc -g  -O2   -I. -I..   -I/Applications/NEURON-7.8//include  -I/usr/local/Cellar/open-mpi/4.0.1_1/include -fPIC -c x86_64/AXNODE.c -o x86_64/AXNODE.o)
 => LINKING library x86_64/libnrnmech.dylib Mod files: AXNODE.mod
(cd .. ; c++ -g  -O2  -std=c++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -fPIC  -I /Applications/NEURON-7.8//include -o x86_64/libnrnmech.dylib -Wl,-install_name,@rpath/libnrnmech.dylib \
	  x86_64/mod_func.o x86_64/AXNODE.o -L/Applications/NEURON-7.8//lib -lnrniv -Wl,-rpath,/Applications/NEURON-7.8//lib    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libreadline.tbd -lcurses -lform)
clang: [color=#FF0000]error[/color]: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libreadline.tbd'
make: *** [x86_64/libnrnmech.dylib] Error 1
Press 'return' key to close]
cbutson
Posts: 5
Joined: Mon Nov 02, 2009 4:54 pm

Re: Compiling Mod Files on Catalina

Post by cbutson »

I am having the same problem: compiling mod files using mknrndll fails because of a missing file in Xcode:
clang: error: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libreadline.tbd'

I am running OSX 10.15.7 and the latest versions of Xcode (12.2) and NEURON (7.8.1). Both were installed today, and I confirmed that Command Line Tools are installed in Xcode (I checked in Preferences->Locations).

I noticed that the directory /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
doesn't exist, so I created an alias for this directory that points to the directory that does exist:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

Addendum and possible solution (added later): I solved this problem by installing NEURON 7.7.

Thanks for any ideas about how to get this working with NEURON 7.8,
Chris
aplainbee
Posts: 2
Joined: Sun Nov 15, 2020 5:43 pm

Re: Compiling Mod Files on Catalina

Post by aplainbee »

Hi Chris,

I'm glad installing the older version worked for you :)
I will give that a try. Can you please share how to created an alias to change the directory NEURON was looking at? Thank you!
hines
Site Admin
Posts: 1609
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling Mod Files on Catalina

Post by hines »

Because of these perennial problems with readline when binary distributions are installed, we will be taking the tack during build of compiling a recent version of readline ourselves as a libreadline.a file along with ncurses and incorporating that into the libnrniv.dylib. I hope after that I'll never see another issue about readline again. This strategy has already been taken with the neuron wheel installation files and now needs to be applied to the pkg files that I publish.
hines
Site Admin
Posts: 1609
Joined: Wed May 18, 2005 3:32 pm

Re: Compiling Mod Files on Catalina

Post by hines »

A work around for now for readline problems is to try
nrn-7.8.1-2-gdfe33e60-osx-27-36-37-38-39.pkg
or
nrn-8.0.dev-239-g8f2aaaa9.w64-mingw-py-27-36-37-38-39-setup.exe
at
https://neuron.yale.edu/ftp/neuron/versions/alpha/
These use NEURON's internal readline sources.
landoskape
Posts: 3
Joined: Sat Oct 17, 2020 3:08 pm

Re: Compiling Mod Files on Catalina

Post by landoskape »

ted wrote: Wed Oct 28, 2020 12:44 pm Thank you for reporting how you fixed the problem.

So "Command Line Tools for XCode 12", which you installed first, isn't the same as "Xcode 12.1", which fixed the problem?
Sorry for the delayed reply, glad to see that this conversation was useful.

That's right -Command Line Tools is a subset of Xcode 12.1, and although only a few lines of code from Xcode 12.1 were needed, I had to download the whole package to access them.
Post Reply