Thanks Jon.<div><br></div><div>Just for the record, this issue is specific to Mac OS X. On Unix, only the basenames of the libraries are stored in the executable, so it makes no difference whether they're specified using absolute or relative paths at link time. </div>
<div><br></div><div>Cheers,</div><div><br></div><div>Donald.</div><div><br><div><br><div class="gmail_quote">On 1 August 2012 21:09, Clayden, Jonathan <span dir="ltr"><<a href="mailto:j.clayden@ucl.ac.uk" target="_blank">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">Hi Donald,<br>
<br>
Thanks. I guess I'm being awkward by preferring to run the binaries from the place they're compiled. Of course, your answer suggests a route which I really should have thought of, which is to manually symlink the dylib into /usr/lib or /usr/local/lib, and that works fine.<br>
<br>
However, FWIW, I've managed to get the binaries to link to the library using its full path using the following patch to the build script:<br>
<br>
@@ -111,7 +111,9 @@ Acceptable options are:<br>
# check if we are compiling a separate project:<br>
<br>
mrtrix_dir = os.path.dirname (os.path.realpath(sys.argv[0]))<br>
-if os.path.abspath(mrtrix_dir) == os.path.abspath(os.getcwd()): mrtrix_dir = None<br>
+if os.path.abspath(mrtrix_dir) == os.path.abspath(os.getcwd()):<br>
+ lib_dir = os.path.join (mrtrix_dir, lib_dir)<br>
+ mrtrix_dir = None<br>
else:<br>
if verbose:<br>
print 'compiling separate project against "' + mrtrix_dir + '"'<br>
<br>
I doubt this is an OS X specific issue, so I'm copying to the mailing list for posterity.<br>
<br>
All the best,<br>
Jon<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 1 Aug 2012, at 06:33, Donald Tournier <<a href="mailto:d.tournier@brain.org.au">d.tournier@brain.org.au</a>> wrote:<br>
<br>
> Hi Jon,<br>
><br>
> Not a lot of experience with MacOS I'm afraid, so can only make vague suggestions. My first suggestion would to install the executables using the "./build install" command (as root). This will place your executables and library into the /opt/mrtrix folder, and symbolic links to these into /usr/bin and /usr/lib respectively. Although this is really geared for a Unix install, as far as I can tell, these paths will be appropriate for MacOSX as well. You can tune either of these paths using a couple of options, as described here:<br>
> <a href="http://www.brain.org.au/software/mrtrix/install/unix.html#install" target="_blank">http://www.brain.org.au/software/mrtrix/install/unix.html#install</a><br>
><br>
> I'm guessing this way, you won't have to stuff around setting paths and library paths - which is the reason I eventually decided to add this feature to the install in the first place...<br>
><br>
> If that still doesn't work, I'd recommend you post your question on the mailing list anyway. There's a few Mac users out there who'll be monitoring it, so they might be able to help - not to mention the added benefit to future Mac users (and hence myself) of having that particular problem discussed and archived on the mailing list. ;)<br>
><br>
> Hope that helps.<br>
> Cheers,<br>
><br>
> Donald.<br>
><br>
><br>
> On 1 August 2012 01:13, Clayden, Jonathan <<a href="mailto:j.clayden@ucl.ac.uk">j.clayden@ucl.ac.uk</a>> wrote:<br>
> Hi Donald,<br>
><br>
> I hope all is well with you. Catching any of the Olympics?<br>
><br>
> I have a technical query/request for MRtrix which I thought might be too esoteric for the mailing list, so I hope you don't mind me getting in touch directly. (Feel free to copy any response to the mailing list if you see fit.)<br>
><br>
> It seems that MRtrix links its library to the binaries using a relative rather than absolute path:<br>
><br>
> $ otool -L ~/git/mrtrix/bin/mrinfo<br>
> /Users/jon/git/mrtrix/bin/mrinfo:<br>
> lib/libmrtrix-0_2_10.dylib (compatibility version 0.0.0, current version 0.0.0)<br>
> /usr/local/lib/libgsl.0.dylib (compatibility version 17.0.0, current version 17.0.0)<br>
> /usr/local/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)<br>
> /usr/local/lib/libglibmm-2.4.1.dylib (compatibility version 5.0.0, current version 5.0.0)<br>
> /usr/local/lib/libgobject-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.1.0)<br>
> /usr/local/lib/libsigc-2.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)<br>
> /usr/local/lib/libgthread-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.1.0)<br>
> /usr/local/lib/libglib-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.1.0)<br>
> /usr/local/Cellar/gettext/<a href="http://0.18.1.1/lib/libintl.8.dylib" target="_blank">0.18.1.1/lib/libintl.8.dylib</a> (compatibility version 10.0.0, current version 10.1.0)<br>
> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)<br>
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)<br>
><br>
> The practical upshot of this is that the binaries can't be run from outside the MRtrix directory...<br>
><br>
> $ mrinfo<br>
> dyld: Library not loaded: lib/libmrtrix-0_2_10.dylib<br>
> Referenced from: /Users/jon/git/mrtrix/bin/mrinfo<br>
> Reason: image not found<br>
><br>
> ... unless I explicitly set DYLD_LIBRARY_PATH. I've done that in the past, and it has had the desired effect, but in the new release of OS X it has started to pester about setting DYLD_* variables, which is becoming a bit of a nuisance (cf [1]).<br>
><br>
> So I was wondering whether (a) there is another way around this, or (b) there is a tweak I can make to the build script so that the binaries are linked against the dylib using its full path.<br>
><br>
> Thanks in advance.<br>
><br>
> All the best,<br>
> Jon<br>
><br>
> --<br>
> [1] <a href="http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/" target="_blank">http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> Jacques-Donald Tournier (PhD)<br>
> Brain Research Institute, Melbourne, Australia<br>
> Tel: +61 (0)3 9035 7033<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jacques-Donald Tournier (PhD)<br>Brain Research Institute, Melbourne, Australia<br>Tel: +61 (0)3 9035 7033<br>
</div></div>