[Mrtrix-discussion] installation error

Zhuang Song zhuang.song at gmail.com
Wed Mar 13 12:32:25 PDT 2013


Hi Donald,

Thank you for looking into this problem. It is really helpful to know the
problem is related to the setting of the environment
variable PKG_CONFIG_PATH. It is certainly a better solution than deleting
the fink libraries. In one of my Mac OSX Lion computer after using
MacPorts, the GTK package is installed in /opt/local/lib/pkgconfig/, but it
may be different in other computers. The PKG_CONFIG_PATH didn't show up
with the command 'evn' in the unix shell of my Mac (haven't tested in the
other), but I agree it will be effective if this environment variable is
set as you suggested.

Thanks again for your kind help.

Zhuang


On Tue, Mar 12, 2013 at 4:18 PM, Donald Tournier <d.tournier at brain.org.au>wrote:

> Hi Zhuang,
>
> Good to hear you got it to work. It sounds to me like the issue is either
> with your pkg-config installation, or with pkg-config itself. The
> pkg-config command is a little program whose job it is to tell you what
> compiler settings to use for a particular package (GTK or glib in this
> instance). I'm not sure how it's supposed to work, but it's disappointing
> that it gave you settings for a 32-bit install, when you were running a
> 64-bit install and clearly the 64-bit versions were available. From a quick
> Google search, it seems the way around this is to make sure your desired
> versions appear first in the PKG_CONFIG_PATH environment variable (see e.g. this
> page<http://hints.cross-lfs.org/index.php/Basics_of_Multilib#PKG_CONFIG_PATH>).
> The correct setup on a 64-bit system would be for the 64-bit versions to
> appear first in this variable, and the 32-bit version last. Clearly this
> was not the case for you.
>
> I'm not sure I can do anything to help with this issue from my end, since
> on MacOSX these are 3rd-party dependencies and could be installed into many
> different locations, depending on which installer was used (Fink, Macports
> or Homebrew), and the particular preferences of the user (since for most of
> these the default installation path can be changed by the user). Besides,
> sorting this out is the job pkg-config was designed to do in the first
> place, so I should not try to second-guess it - even though it is
> disappointing that it failed in this case.
>
> For reference, the way to sort this out in your case (without deleting the
> 32-bit Fink libraries) would probably be:
>
> $ export PKG_CONFIG_PATH=/opt/lib64/pkgconfig
> $ ./build
>
> I'm not sure what the correct location is for PKG_CONFIG_PATH, could
> be /opt/lib/pkgconfig, it really depends on how MacPorts works... In any
> case, this will hopefully give a hint to anyone else who might come across
> this problem.
>
> Cheers,
>
> Donald.
>
>
> On 13 March 2013 04:30, Zhuang Song <zhuang.song at gmail.com> wrote:
>
>> Hi Donald,
>>
>> Thank you so much for the advices and pointing out the conflicts between
>> fink installations and the 64-bit system. I did use fink to install some
>> packages a few months ago. But recently I only used MacPorts to install all
>> the dependencies (64-bit) by following the instructions in your webpage. It
>> looks like that MRtrix couldn't be built with coexisting 64-bit and 32-bit
>> versions of those GTK dependencies.
>>
>> By simply deleting the fink folder /sw, MRtrix has been installed
>> beautifully in my 2nd Mac. It seems to me the build program of MRtrix would
>> first look for the 32-bit version of Glib/GTK and then the 64-bit version
>> even in a 64-bit environment of MacOSX. Maybe this is something you may
>> like to look into.
>>
>> Many thanks and cheers,
>> Zhuang
>>
>>
>>
>>
>> On Mon, Mar 11, 2013 at 4:18 PM, Donald Tournier <d.tournier at brain.org.au
>> > wrote:
>>
>>> Hi Zhuang,
>>>
>>> It looks like the computer you're trying to build on has the wrong
>>> versions of the dependencies. The particular dependencies that are failing
>>> are libglib-2.0, libgobject-2.0, and libintl. The error message state that
>>> although these libraries were found, they are not 64-bit versions (i.e. not
>>> x86_64). I assume you're trying to build on a 64-bit system, and on this
>>> system you happen to have the 32-bit version of GTK installed (these
>>> libraries are all related to Glib/GTK). I'm not sure how they got onto your
>>> system, but presumably they were pulled in as part of an earlier install of
>>> some other 32-bit software package (probably using Fink, judging from where
>>> these libraries were installed).
>>>
>>> I guess you have two options:
>>>
>>>    - compile MRtrix in 32-bit mode. I'm not sure how you'd go about
>>>    doing this in MacOSX, but I'm guessing you'll probably need to set the
>>>    '-mtune' option in sysconf/darwin.py to something like 'i686'. That said,
>>>    the GCC compiler options are subtly different on MacOSX, so this might not
>>>    work, but a quick Google search on compiling 32-bit apps in a 64-bit
>>>    environment on MacOSX should give you the information pretty quickly. Note
>>>    that for this approach you'll also need 32-bit versions of all the other
>>>    dependencies, including GSL and OpenGL; if these are not already installed,
>>>    it'll require more work to get them installed too, in which case you'd be
>>>    better off going for the next option, which is the one I'd recommend
>>>    anyway...
>>>    - The better option would be to compile in 64-bit mode, but in this
>>>    case you'll need to install the 64-bit versions of all the dependencies.
>>>    This shouldn't be too hard, you should be able to use one of the approaches listed
>>>    in the documentation<http://www.brain.org.au/software/mrtrix/install/macosx.html>(which you've obviously already done on a different system). My guess is
>>>    you should be able install these dependencies alongside the existing ones,
>>>    without conflict. I think Fink will install in /sw/lib64 or similar, so it
>>>    shouldn't affect existing applications that might rely on the 32-bit
>>>    versions (the other approaches also install in different places, so
>>>    shouldn't conflict either).
>>>
>>> Hope this helps.
>>> Cheers,
>>>
>>> Donald.
>>>
>>>
>>>
>>> On 12 March 2013 04:42, Zhuang Song <zhuang.song at gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> After I installed MRtrix- 0.2.10 successfully in one Mac OSX
>>>> Lion computer, I got the following error when I tried to install it (by
>>>> running ./build) in another Mac OSX Lion computer. It seems to relate to
>>>> Xcode. Could you give me any clue how to fix it?
>>>>
>>>>
>>>> ------------------------------------------------------------------------------------------
>>>> ERROR: [LD] lib/libmrtrix-0_2_10.dylib
>>>>
>>>> g++ -shared -L/sw/lib lib/math/vector.o lib/math/matrix.o
>>>> lib/image/format/analyse.o lib/file/dicom/quick_scan.o
>>>> lib/image/format/list.o lib/file/dicom/image.o lib/file/config.o
>>>> lib/point.o lib/image/name_parser.o lib/image/format/xds.o lib/data_type.o
>>>> lib/args.o lib/file/dicom/patient.o lib/file/dicom/tree.o lib/image/fft.o
>>>> lib/image/header.o lib/file/dicom/mapper.o lib/file/dicom/select_cmdline.o
>>>> lib/math/linalg.o lib/file/dicom/study.o lib/file/dicom/element.o
>>>> lib/file/mmap.o lib/image/format/nifti1.o lib/file/dicom/dict.o
>>>> lib/image/format/mrtrix.o lib/image/format/base.o lib/image/axis.o
>>>> lib/image/interp.o lib/image/mapper.o lib/file/dicom/series.o lib/mrtrix.o
>>>> lib/image/format/mri.o lib/image/object.o lib/image/format/dicom.o
>>>> lib/app.o lib/file/key_value.o -L/opt/local/lib -lglibmm-2.4 -lgobject-2.0
>>>> -lsigc-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lgsl -lgslcblas -o
>>>> lib/libmrtrix-0_2_10.dylib
>>>>
>>>> failed with output:
>>>>
>>>> ld: warning: ignoring file /sw/lib/libgobject-2.0.dylib, file was built
>>>> for unsupported file format ( 0xfe 0xed 0xfa 0xce 0x 0 0x 0 0x 0 0x12 0x 0
>>>> 0x 0 0x 0 0x a 0x 0 0x 0 0x 0 0x 6 ) which is not the architecture being
>>>> linked (x86_64): /sw/lib/libgobject-2.0.dylibld: warning:
>>>> ld: warning: ignoring file /sw/lib/libgthread-2.0.dylib, file was built
>>>> for unsupported file format ( 0xfe 0xed 0xfa 0xce 0x 0 0x 0 0x 0 0x12 0x 0
>>>> 0x 0 0x 0 0x a 0x 0 0x 0 0x 0 0x 6 ) which is not the architecture being
>>>> linked (x86_64): /sw/lib/libgthread-2.0.dylibignoring file
>>>> /sw/lib/libglib-2.0.dylib, file was built for unsupported file format (
>>>> 0xfe 0xed 0xfa 0xce 0x 0 0x 0 0x 0 0x12 0x 0 0x 0 0x 0 0x a 0x 0 0x 0 0x 0
>>>> 0x 6 ) which is not the architecture being linked (x86_64):
>>>> /sw/lib/libglib-2.0.dylib
>>>> ld: warning:
>>>> ignoring file /sw/lib/libintl.dylib, file was built for unsupported
>>>> file format ( 0xfe 0xed 0xfa 0xce 0x 0 0x 0 0x 0 0x12 0x 0 0x 0 0x 0 0x a
>>>> 0x 0 0x 0 0x 0 0x 6 ) which is not the architecture being linked (x86_64):
>>>> /sw/lib/libintl.dylib
>>>> Undefined symbols for architecture x86_64:
>>>>   "_g_ascii_table", referenced from:
>>>>       MR::File::Dicom::select_cmdline(MR::File::Dicom::Tree const&)in
>>>> select_cmdline.o
>>>>       MR::(anonymous
>>>> namespace)::print_formatted_paragraph(std::basic_string<char,
>>>> std::char_traits<char>, std::allocator<char> > const&,
>>>> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>>>> const&, int, int, int)in app.o
>>>>   "_g_snprintf", referenced from:
>>>>       MR::Image::Header::description() constin header.o
>>>>   "_g_sprintf", referenced from:
>>>>       MR::Image::NameParser::name(std::vector<int, std::allocator<int>
>>>> > const&)in name_parser.o
>>>>   "_g_unlink", referenced from:
>>>>       MR::File::MMap::Base::~Base()in mmap.o
>>>>   "_g_vsnprintf", referenced from:
>>>>       MR::printf(char const*, ...)in matrix.o
>>>>       MR::printf(char const*, ...)in patient.o
>>>>       MR::printf(char const*, ...)in study.o
>>>>       MR::printf(char const*, ...)in element.o
>>>>       MR::printf(char const*, ...)in series.o
>>>>    "_glib_major_version", referenced from:
>>>>       MR::App::sort_arguments(int, char**)in app.o
>>>>   "_glib_micro_version", referenced from:
>>>>       MR::App::sort_arguments(int, char**)in app.o
>>>>   "_glib_minor_version", referenced from:
>>>>       MR::App::sort_arguments(int, char**)in app.o
>>>> ld: symbol(s) not found for architecture x86_64
>>>> collect2: ld returned 1 exit status
>>>>
>>>> Thanks,
>>>> Zhuang
>>>>
>>>> _______________________________________________
>>>> Mrtrix-discussion mailing list
>>>> Mrtrix-discussion at www.nitrc.org
>>>> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>>>>
>>>>
>>>
>>>
>>> --
>>> *Dr Jacques-Donald Tournier
>>> *
>>> Research Fellow
>>>
>>> The Florey Institute of Neuroscience and Mental Health
>>> Melbourne Brain Centre - Austin Campus
>>> 245 Burgundy Street
>>> Heidelberg  Vic  3084
>>> Ph:  +61 3 9035 7033
>>> Fax:  +61 3 9035 7307
>>> www.florey.edu.au
>>>
>>>
>>
>
>
> --
> *Dr Jacques-Donald Tournier
> *
> Research Fellow
>
> The Florey Institute of Neuroscience and Mental Health
> Melbourne Brain Centre - Austin Campus
> 245 Burgundy Street
> Heidelberg  Vic  3084
> Ph:  +61 3 9035 7033
> Fax:  +61 3 9035 7307
> www.florey.edu.au
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20130313/3cd90662/attachment.html


More information about the Mrtrix-discussion mailing list