Universal binary in 10.4?

Post Reply
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Universal binary in 10.4?

Post by jaambros »

Has anybody tried to build a NEURON universal binary for 10.4 ?

Is there reason that this will or will not work?

Presumably, adding the option "-arch ppc -arch i386" to gcc 4.0 should be enough. Is there a simple way of doing this when building NEURON from source?

Why do I want to do this?
I have a Mac cluster with both architectures, and universal binaries should simplify administration.

Thanks
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

You may very well be correct. I tried rebuilding the InterViews using

Code: Select all

"./configure" '--prefix=/Applications/NEURON-6.0/iv' '--enable-carbon' CFLAGS="-arch ppc -arch i386" CXXFLAGS="-arch ppc -arch i386"
and ended up with
-rwxr-xr-x 1 hines hines 3222500 Jul 21 11:51 libIVhines.3.0.3.dylib
instead of the old
-rwxr-xr-x 1 hines admin 1163084 Jul 20 13:27 libIVhines.3.0.3.dylib
However, I don't have a powerpc available this summer to see if
it works in the end as a universal. If you have built NEURON before on the mac, the above configure options should give you the hint you need to see if it carries through. If so let us know and I'll start doing that for all the
dmg distributions.
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

For the NEURON part of the build, there is a conflict between dependency tracking and multiple architectures, but the following works around that.

Code: Select all

"/Users/hines/neuron/releases/nrn6.0/configure" '--prefix=/Applications/NEURON-6.0/nrn' '--srcdir=/Users/hines/neuron/releases/nrn6.0' '--with-iv=/Applications/NEURON-6.0/iv' '--enable-carbon' CFLAGS="-arch ppc -arch i386" CXXFLAGS="-arch ppc -arch i386" --disable-dependency-tracking
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I'd appreciate it if someone could try
http://www.neuron.yale.edu/ftp/neuron/v ... 8.10.1.dmg
on their powerpc (OS 10.4). The only unusual aspect is that the unversal
binaries end up in i386 directories. Let me know if an icon or mknrndll
do not work. Notice that the dmg is 8MB instead of the normal 4.7 standard
distribution. That will only get worse when python is added but won't be as
bad as the 11MB python version for mswin
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

alpha/nrn-6.0.rel-4-i386-apple-darwin8.10.1.dmg

Post by jaambros »

I tested alpha/nrn-6.0.rel-4-i386-apple-darwin8.10.1.dmg

OS X Server 10.4.10 (intel)
installed in ~/Applications

Code: Select all

$ ~/Applications/NEURON-6.0/nrn/i386/bin/nrniv 
dyld: Library not loaded: /Applications/NEURON-6.0/nrn/i386/lib/libnrnoc.0.dylib
  Referenced from: /axon/d1/Users/jose/Applications/NEURON-6.0/nrn/i386/bin/nrniv
  Reason: image not found
Trace/BPT trap
I then removed from ~/Applications and installed in /Applications and the program performed well.

OS X 10.4.10 (ppc)
Installed in /Applications
All of the xxxx.app showed a cross sign over their icons and when double clicked gave a mesg "You can not open the application xxx.app because it's not supported in this system"

Execution of /Applications/NEURON-6.0/nrn/i386/bin/nrngui and nrniv from the Terminal worked fine when executed on the client. However, when logged remotely via ssh from an X window, nrngui did not create the GUI.
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

Building universal Interviews

Post by jaambros »

I tried your suggestion for building Interviews.
However, it failed to build a universal libIVhines.3.0.3.dylib

Code: Select all

$ IDIR=~/Software/bin/nrn-6.0-universal
$ cd iv-17/
$ ./configure --prefix=$IDIR/iv --with-x CFLAGS="-arch ppc -arch i386" CXXFLAGS="-arch ppc -arch i386"
$ make
This failed. I tracked the problem to this instruction

Code: Select all

g++ -dynamiclib -single_module -flat_namespace -undefined suppress -o .libs/libIVhines.3.0.3.dylib  [...] -install_name  /axon/d1/Users/jose/Software/bin/nrn-6.0-universal/iv/i686/lib/libIVhines.3.dylib -compatibility_version 4 -current_version 4.3
which did not have an "-arch ppc -arch i386" flag added.
You can verify a file (object or library) is universal by using the "file" command. Universals have both i386 and ppc components.
Is there a way to get the -arch flags to this instruction during configure?
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

Any svn repository sources on or after 1833 which I used to build http://www.neuron.yale.edu/ftp/neuron/v ... 0.4.10.dmg
should work on both ppc and intel macs.
The configure option for the NEURON part is --enable-UniversalMacBinary
(oops. I forgot to update the InterViews part of the repository and will do that this evening, that requires the same option.)
My experience is that one must start with
fresh sources or at least at the level of
"make distclean". Because automatic dependency checking must be turned off, if any .h files are changed it is best to rebuild after "make distclean".
I have not had problems when the library create steps mentioned above did not have the -arch flags but I'll look into that more closely.
Post Reply