Hey Jon,<div><br></div><div>Thanks for your instructions, I'm sure others will find them useful. I'll include these along with Michael's in the documentation for the next release, along with a ready to use darwin.py config file and the patch you included. </div>
<div><br></div><div>Also glad to hear that I'm not alone in finding it fiendishly difficult to compile GTK and dependencies from source... </div><div><br></div><div>On the topic of building command-line only applications, if anyone wants to do that, you can simply remove the mrview.cpp and disp_profile.cpp files from the cmd/ folder before invoking ./build (they're the only GUI applications in MRtrix). However, since the remaining programs still rely on glibmm and gsl, so you'll still need to install some dependencies, so not sure how much work you'll be saving yourself by doing this...</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Donald.</div><div><br><br><div class="gmail_quote">On 19 May 2011 14:40, Jon Clayden <span dir="ltr"><<a href="mailto:j.clayden@ucl.ac.uk">j.clayden@ucl.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear all,<br>
<br>
Just to follow up on the earlier thread quoted below (I wasn't on the mailing list when it was sent, so I can't directly continue it), I thought it might be useful to post my experiences of compiling MRtrix on Mac OS X.<br>
<br>
I've had problems with Fink in the past, and I don't particularly like its approach of creating a whole software ecosystem separate from the rest of the system, so instead I used Homebrew <<a href="http://mxcl.github.com/homebrew/" target="_blank">http://mxcl.github.com/homebrew/</a>> to sort out the dependencies, which I find much cleaner. (I did - foolishly - attempt to build the dependencies by hand initially, but got stuck with pango and gave up.) So the steps were<br>
<br>
1. Install Homebrew as per <<a href="https://github.com/mxcl/homebrew/wiki/installation" target="_blank">https://github.com/mxcl/homebrew/wiki/installation</a>>:<br>
<br>
$ ruby -e "$(curl -fsSLk <a href="https://gist.github.com/raw/323731/install_homebrew.rb" target="_blank">https://gist.github.com/raw/323731/install_homebrew.rb</a>)"<br>
<br>
(Xcode and X11 from the OS X install DVD are also needed, if they're not already installed.)<br>
<br>
2. Get and build the dependencies:<br>
<br>
$ brew install gtkglext gtkmm gsl<br>
<br>
(The rest should be picked up automagically as dependencies of these three.)<br>
<br>
3. Patch MRtrix. A sysconf/darwin.py file needs to be created, as Michael says (mine is attached - it only includes the "-mtune" change), and since I'm using the system OpenGL library rather than something provided by Fink, some .cpp/.h files need modifying. A patch using conditional compilation directives (to avoid breaking other platforms) is at the end of this e-mail. It should be safe to incorporate this into the main code-base.<br>
<br>
4. Run ./build and proceed as normal.<br>
<br>
This seems to result in working binaries. Naturally, most OS X systems won't have the run-time dependencies installed, so unless the whole lot gets bundled up together I wouldn't expect the binaries to be portable.<br>
<br>
If it's not too much work, though, it might be helpful to provide an alternative to the "build" script which only builds the command-line applications. Presumably the dependencies are far fewer in that case, so it might represent a simple "way in" for OS X users...<br>
<br>
All the best,<br>
<font color="#888888">Jon<br>
<br>
</font><br><br>
<br>
--<br>
diff -r mrtrix-0.2.9/src/dwi/render_frame.cpp mrtrix-0.2.9-patched/src/dwi/render_frame.cpp<br>
27a28,30<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/glu.h><br>
> #else<br>
28a32<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/pane.cpp mrtrix-0.2.9-patched/src/mrview/pane.cpp<br>
22a23,25<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/glu.h><br>
> #else<br>
23a27<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/pane.h mrtrix-0.2.9-patched/src/mrview/pane.h<br>
25a26,28<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/glu.h><br>
> #else<br>
26a30<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/sidebar/tractography/roi_list.cpp mrtrix-0.2.9-patched/src/mrview/sidebar/tractography/roi_list.cpp<br>
27a28,30<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/glext.h><br>
> #else<br>
28a32<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/sidebar/tractography/track_list_item.cpp mrtrix-0.2.9-patched/src/mrview/sidebar/tractography/track_list_item.cpp<br>
30a31,34<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/gl.h><br>
> #include <OpenGL/glext.h><br>
> #else<br>
32a37<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/sidebar/tractography/track_list_item.h mrtrix-0.2.9-patched/src/mrview/sidebar/tractography/track_list_item.h<br>
41a42,44<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/gl.h><br>
> #else<br>
42a46<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/mrview/texture.h mrtrix-0.2.9-patched/src/mrview/texture.h<br>
26a27,29<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/gl.h><br>
> #else<br>
27a31<br>
> #endif<br>
diff -r mrtrix-0.2.9/src/use_gl.h mrtrix-0.2.9-patched/src/use_gl.h<br>
25a26,28<br>
> #ifdef __APPLE__<br>
> #include <OpenGL/gl.h><br>
> #else<br>
26a30,31<br>
> #endif<br>
><br>
<br>
<br>
<br>
> Hi Michael,<br>
><br>
> This is great news, and doesn't even sound too complicated! I'll add your<br>
> instructions to the documentation and make sure they're available for the<br>
> next release. In the meantime, I'd be interested to hear how things are<br>
> going with the Mac version, and whether you've encountered any issues with<br>
> it so far.<br>
><br>
> Thanks,<br>
><br>
> Donald.<br>
><br>
><br>
> On 26 February 2011 13:19, Michael Zeineh <mmzeineh at <a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
><br>
>> Got it working! At least the basics ... mrview and mrconvert etc. Didn't test tractography yet ..<br>
>><br>
>> I tried copying from one machine (10.6.5) to another (10.6), but this didn’t work, so I don’t think it is worth putting binaries anywhere ...<br>
>><br>
>> Here is what I had to do<br>
>><br>
>> Install fink per webpage in /sw64<br>
>><br>
>> Download tarball<br>
>><br>
>> tar -xvzf fink-0.29.19.tar.gz<br>
>><br>
>> cd fink-0.29.19<br>
>><br>
>> ./bootstrap sw64 (puts fink in /sw64)<br>
>><br>
>> fink install python glib gtk+ glibmm2.4 gtkmm2.4 gtkglext1 gsl<br>
>><br>
>> at some point it bottoms out, so just repeat it, and it works<br>
>><br>
>> copy linux.py Darwin.py<br>
>><br>
>> modify Darwin.py cpp flags to read –mtune=native rather than –march=native<br>
>><br>
>> modify darwin.py to add to the cpp flags: '-L/sw64/lib', '-I/sw64/include'<br>
>><br>
>> ./build<br>
>><br>
>> copy to /usr/local/mri<br>
>><br>
>> change permissions so all users can read<br>
>><br>
>> change path to include /usr/local/mri/bin<br>
>><br>
>> export DYLD_LIBRARY_PATH="/usr/local/mrtrix/lib"<br>
>><br>
>> Then things work!<br>
>><br>
>> One time, it was complaining regarding the freetype library, and this required copying the /usr/x11/bin/libfreetype.6.dylib to /sw64/lib/freetype219/lib, though it didn’t require it the second time.<br>
<br>
<br>_______________________________________________<br>
Mrtrix-discussion mailing list<br>
<a href="mailto:Mrtrix-discussion@www.nitrc.org">Mrtrix-discussion@www.nitrc.org</a><br>
<a href="http://www.nitrc.org/mailman/listinfo/mrtrix-discussion" target="_blank">http://www.nitrc.org/mailman/listinfo/mrtrix-discussion</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jacques-Donald Tournier (PhD)<br>Brain Research Institute, Melbourne, Australia<br>Tel: +61 (0)3 9035 7033<br>
</div>