cannot use mknrndll on mac

Post Reply
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

cannot use mknrndll on mac

Post by anniechen »

HI,all,

I just recently switch from windows to mac, and download the newest version of NEURON and xcode. However, I can't use mknrndll on mac. Is there someone who can help? Thank you in advance!

When I tried to open the mknrndll by double-click it, it crashed, and here is the error message, mknrndll quit unexpectedly,
Process: a.out [198]
Path: /Volumes/NEURON-7.1/NEURON-7.1/mknrndll.app/Contents/MacOS/a.out
Identifier: edu.yale.neuron.mknrndll
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [75]

Date/Time: 2010-03-03 17:28:40.993 +0000
OS Version: Mac OS X 10.6.2 (10C540)
Report Version: 6

Interval Since Last Report: 44424 sec
Crashes Since Last Report: 21
Per-App Crashes Since Last Report: 17
Anonymous UUID: C7247EE6-38CC-4FE2-841A-DE1AB4B103E4

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000020b5a3b0
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: isEqual:


Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x9681cee4 objc_msgSend + 36
1 com.apple.CoreFoundation 0x91e27564 __CFDictionaryCallback + 420
2 com.apple.CoreFoundation 0x91e27919 ___CFBasicHashFindBucket1 + 537
3 com.apple.CoreFoundation 0x91e2faac CFBasicHashFindBucket + 252
4 com.apple.CoreFoundation 0x91e2f973 CFDictionaryGetValue + 131
5 com.apple.CoreFoundation 0x91e251a8 _CFBundleCopyDirectoryContentsAtPath + 216
6 com.apple.CoreFoundation 0x91e6869c _CFBundleTryOnePreferredLprojNameInDirectory + 268
7 com.apple.CoreFoundation 0x91e67c67 _CFBundleAddPreferredLprojNamesInDirectory + 1015
8 com.apple.CoreFoundation 0x91e67460 _CFBundleGetLanguageSearchList + 160
9 com.apple.CoreFoundation 0x91e672aa CFBundleCopyResourceURL + 26
10 com.apple.CoreFoundation 0x91e71854 CFBundleGetLocalInfoDictionary + 84
11 com.apple.CoreFoundation 0x91e717b2 CFBundleGetValueForInfoDictionaryKey + 34
12 ...ple.CoreServices.CarbonCore 0x9194f7f5 GetBugsForOurBundleIDFromCoreservicesd + 334
13 ...ple.CoreServices.CarbonCore 0x9194f64c _CSCheckFix + 20
14 com.apple.CoreGraphics 0x94b7feae CGSServerPort + 323
15 com.apple.CoreGraphics 0x94b7fd1b CGSScoreboard + 28
16 com.apple.CoreGraphics 0x94b7fafb initCGDisplayState + 242
17 com.apple.CoreGraphics 0x94b7f936 initCGDisplayMappings + 30
18 com.apple.CoreGraphics 0x94b7f171 cg_setup + 50
19 libSystem.B.dylib 0x94468090 pthread_once + 82
20 com.apple.CoreGraphics 0x94b7f139 CGSInitialize + 46
21 com.apple.QD 0x925b9500 GetCGSConnectionID + 28
22 com.apple.QD 0x925be36a InitCursor + 18
23 edu.yale.neuron.mknrndll 0x00002d0d install_handlers + 17
24 edu.yale.neuron.mknrndll 0x00002988 mac_args + 50
25 edu.yale.neuron.mknrndll 0x0000269e main + 312
26 edu.yale.neuron.mknrndll 0x0000250e _start + 228 (crt.c:272)
27 edu.yale.neuron.mknrndll 0x00002429 start + 41

Thread 1:
0 libSystem.B.dylib 0x9446f182 __workq_kernreturn + 10
1 libSystem.B.dylib 0x9446f718 _pthread_wqthread + 941
2 libSystem.B.dylib 0x9446f336 start_wqthread + 30

Thread 2: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x944700ea kevent + 10
1 libSystem.B.dylib 0x94470804 _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x9446fcc3 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x9446fa68 _dispatch_worker_thread2 + 234
4 libSystem.B.dylib 0x9446f4f1 _pthread_wqthread + 390
5 libSystem.B.dylib 0x9446f336 start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00105f20 ebx: 0x91e23324 ecx: 0x9916ea98 edx: 0x20058a20
edi: 0xa09f7b28 esi: 0xa09fcf28 ebp: 0xbfffe068 esp: 0xbfffe014
ss: 0x0000001f efl: 0x00010202 eip: 0x9681cee4 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x20b5a3b0
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

When you double click the mknrndll icon it is merely supposed to open a terminal window with a message like:
Drag a folder containing mod files or a set of mod files onto the icon. Press return to close this window.

Try dragging your folder onto the icon and see if it works or if you get the same error.
Does neurondemo work?

What is your os version and machine type?
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

Re: cannot use mknrndll on mac

Post by anniechen »

No message shows up in the terminal window after I double-click nknrndll.
If I drag my folder onto the icon, there is a prohibited sign showing up, so no compiling.

Neurondemo works ok.

os version is Mac OS X 10.6.2 (10C540) ; machine type is Macbook pro
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

I just updated to OSX 6.2 (darwin 10.2.0) on my i686 machine (which also updated xcode)
and built an installer using the latest alpha sources.
Throw your present version into the trash and try
http://www.neuron.yale.edu/ftp/neuron/v ... 10.2.0.dmg
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

Re: cannot use mknrndll on mac

Post by anniechen »

I still got the same error. mknrndll still doesn't work.

Again, neurondemo is fine, but when I double click nrngui, in terminal window, there are some error message,
-e
NEURON -- VERSION 7.2 (424:d4966c890ebf) d4966c890ebf
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

nrniv(422,0xa0646500) malloc: *** error for object 0x1920f94: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
nrniv(422,0xa0646500) malloc: *** error for object 0x1920f90: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

Fortunately, I also started getting the malloc error on my 6.2.0 mac when launching nrngui
and so was able to debug it.
The problem is a broken memalign function on the mac. ie memalign exists but does not
work properly. I qguess they have gone backwards in this respect with the newest update.
Get
http://www.neuron.yale.edu/ftp/neuron/v ... 10.2.0.dmg
and see if that fixes the your nrngui launch problem. If we are fortunate, perhaps mknrndll will work as well.
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

Re: cannot use mknrndll on mac

Post by anniechen »

I am able to drag .moc files to mknrndll icon and generate i386 folder after compile, if I drag Neuron-7.2 folder out of the virtual folder to the desktop. But nrngui crashed when I try to run it.
If I leave the folder of neuron-7.2 in the virtual folder, I can open nrngui when I double-click it, but mknrndll crashed in the virtual folder.
Then I tried to use mknrndll on the desktop to compile the .moc files, and run the program that I have tested before successfully in windows, on the nrngui in the virtual folder by deleting the one on the desktop (since the one on the desktop doesn't work), error shows up as follows, it seems to me that dllopen failed.
So I think the problem is still that whether I can run both mknrndll and nrngui properly when the folder of Neuron-7.2 on the desktop or somewhere else.

NEURON -- VERSION 7.2 (424+:d4966c890ebf+) d4966c890ebf
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

loading membrane mechanisms from /Users/Guifen/model/code/i386/.libs/libnrnmech.so
dlopen failed -
dlopen(/Users/Guifen/model/code/i386/.libs/libnrnmech.so, 2): no suitable image found. Did find:
/Users/Guifen/model/code/i386/.libs/libnrnmech.so: mach-o, but wrong architecture
1
0
1
1
/Volumes/NEURON-7.2/NEURON-7.2/nrn/i386/bin/nrniv.app/Contents/MacOS/nrniv: syntax error
in theta.hoc near line 58
insert hd ghdbar_hd=ghd
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

If you drag NEURON-7.2 to /Applications, do both nrngui and mknrndll work there?

I believe the 'dlopen failed' is because the libnrnmech.so on your machine was compiled
as an x86_64 library, but the software built on my machine was for i386 and powerpc. The fix would be
to make sure the options -arch i386 are given to the compiler in the
/Application/NEURON-7.2/nrn/i386/bin/nrnmech_makefile
You can add them in the CFLAGS = ...
line so it reads
CFLAGS = -g -O2 -arch i386

Let me know if it all finally works.
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

Re: cannot use mknrndll on mac

Post by anniechen »

Yes, both work when I drag NEURON-7.2 to /Applications. But dlopen still failed as followed.
I changed the code in nrnmech_makefile: CFLAGS = -g -O2 -arch i386 (comment the original bit # $(PTHREAD_CFLAGS)), and recompile the files, it generates i386 folder as before. When I run .hoc file, the same error shows up:

loading membrane mechanisms from /Users/Guifen/model/theta2/i386/.libs/libnrnmech.so
dlopen failed -
dlopen(/Users/Guifen/model/theta2/i386/.libs/libnrnmech.so, 2): no suitable image found. Did find:
/Users/Guifen/model/theta2/i386/.libs/libnrnmech.so: mach-o, but wrong architecture
1
0
1
1
/Applications/NEURON-7.2/nrn/i386/bin/nrniv.app/Contents/MacOS/nrniv: syntax error
in theta.hoc near line 58
insert hd ghdbar_hd=ghd
^
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

Are you sure your recompiled the files with those flags? That would happen only if you completely removed the i386 folder
or made the mod files more recent than the c files in i386. Also, when you run mknrndll after removing the i386 folder,
check to see that the flags are on the compile lines and on the final link line.
The message:
dlopen(/Users/Guifen/model/theta2/i386/.libs/libnrnmech.so, 2): no suitable image found. Did find:
/Users/Guifen/model/theta2/i386/.libs/libnrnmech.so: mach-o, but wrong architecture
with regard to architecture seems to indicate that libnrnmech.so was compiled for the x86_64.
I assume your processor type is a Core2 duo and we need to force the compile to cross compile for
an i386.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: cannot use mknrndll on mac

Post by hines »

If removing the i386 folder and then doing mknrndll does not work with the -arch i386 flags
please send me the output of the mknrndll program to michael dot hines at yale dot edu
anniechen
Posts: 6
Joined: Wed Mar 03, 2010 12:09 pm
Location: UCL, London

Re: cannot use mknrndll on mac

Post by anniechen »

It still doesn't work, so I've sent the zip file to your emailbox. Please let me know if you can't receive it. Thank you so much!
Post Reply