[ITK-users] SimpleITK build fail with R 3.3.1

Richard Beare richard.beare at gmail.com
Sun Oct 30 05:04:47 EDT 2016


I'm seeing different failures on 3.3.1. Stuff to do with redefining length
in Rdefines.h. These problems seem to relate to sitkRArray.cxx.

It is a bit strange, but the fix for me is to add
#include <iostream>

before
#include <Rdefines.h>

in sitkRArray.cxx

This successfully builds the R package, but I get lots of link warnings
like this:

ld: warning: direct access in itk::LabelMap<itk::ShapeLabelObject<unsigned
long long, 2u> >::Graft(itk::DataObject const*) to global weak symbol
typeinfo name for itk::DataObject const* means the weak symbol cannot be
overridden at runtime. This was likely caused by different translation
units being compiled with different visibility settings.

On Sat, Oct 29, 2016 at 7:51 PM, Mathew Guilfoyle <mrguilfoyle at gmail.com>
wrote:

> Hi Richard
>
> I've tried using the patched swig you provided several months ago and the
> latest swig from git option - SimpleITK compiles without error against R
> 3.2.5 and earlier with either swig and R 3.3.0 fails the same way with
> either.  The problem previously was not failing to build but
> string-handling errors generated using certain R-SimpleITK functions.  As
> mentioned there has been a change in certain header files since 3.3.0 which
> presumably relates to the problem?  Happy to do any further testing you
> suggest.
>
>
> > On 28 Oct 2016, at 22:31, Richard Beare <richard.beare at gmail.com> wrote:
> >
> > A while back I made an update to swig to do with the way the various R
> header files were included in the swig generated code. The errors prompting
> that change seemed similar to what you were seeing. Those changes have been
> merged into the master swig, but probably haven't made it into a release
> yet. You could try giving the superbuild a go with the "system" swig you've
> built by hand, or possibly use the "swig from git" option in superbuild.
> Note that this last option requires an automake installation too - the brew
> version works OK.
> >
> > On Sat, Oct 29, 2016 at 2:36 AM, Mathew Guilfoyle <mrguilfoyle at gmail.com>
> wrote:
> > Xcode 8.1 (updated yesterday)
> > I've checked both R 3.2.5 and R 3.3.1 and they both report
> LC_VERSION_MIN_MACOSX version=10.9 sdk=10.9 for the main R binary.
> >
> > Looking at the differences in the Rdefines.h header file  (mentioned in
> the error report) between R versions it is documented that this has been
> changed from R 3.3.0 onwards.  Several of the definitions at the top of the
> file are now prepended with Rf_ .  I don't pretend to understand the
> reasons for or implications of this but seems likely to be at least part of
> the problem?
> >
> >
> >
> > > On 28 Oct 2016, at 15:27, Lowekamp, Bradley (NIH/NLM/LHC) [C] <
> blowekamp at mail.nih.gov> wrote:
> > >
> > > Hello,
> > >
> > > Do you know what version of Xcode you are using? What OS X SDK is
> being used? or CMAKE_OSX_DEPLOYMENT_TARGET? What SDK did R use[1]?
> > >
> > > This seems like it is some type of incompatibility with versions of
> Xcode, OS X SDK, libc++ vs libstdc++ or even C++ versions.
> > >
> > > I am not certain what R compiler flags are passed to the SimpleITK
> build with the “devtools” method, but some of the above may not match the
> way the old R was compiled.
> > >
> > > HTH,
> > > Brad
> > >
> > > [1] http://stackoverflow.com/questions/17461196/
> determining-os-x-sdk-and-deployment-target-versions-from-framework
> > >
> > >> On Oct 28, 2016, at 10:11 AM, Mathew Guilfoyle <mrguilfoyle at gmail.com>
> wrote:
> > >>
> > >> Hi
> > >>
> > >> SimpleITK with R wrapping does not build successfully against R 3.3.1
> on OS X 10.11.6 ElCapitan
> > >>
> > >> This fails both using the devtools method from within R, and when
> trying to build the SuperBuild via Cmake with R wrapping turned on.
> > >>
> > >> Both methods work fine against the most recent prior R release
> 3.2.4-revised (subsequently relabelled 3.2.5).
> > >>
> > >> Not an immediate problem as working with R 3.2.5 is ok.
> > >>
> > >> The error message I get is:
> > >>
> > >> In file included from /private/var/folders/qy/
> 0txzmt9n7mvcfrp4g2w14h8m0000gn/T/RtmpKGZyJo/devtools25f45d3de0c1/
> SimpleITK-SimpleITKRInstaller-68fadd1/SITK/Build/SimpleITK-
> build/Wrapping/R/SimpleITKR_wrap.cxx:757:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/Rdefines.h:33:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/R_ext/RS.h:27:
> > >> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:98:46: error:
> conflicting types for 'strchr'
> > >> inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s,
> int __c) {return ::strchr(__s, __c);}
> > >>                                            ^
> > >> /usr/include/string.h:76:7: note: previous declaration is here
> > >> char    *strchr(const char *, int);
> > >>        ^
> > >> In file included from /private/var/folders/qy/
> 0txzmt9n7mvcfrp4g2w14h8m0000gn/T/RtmpKGZyJo/devtools25f45d3de0c1/
> SimpleITK-SimpleITKRInstaller-68fadd1/SITK/Build/SimpleITK-
> build/Wrapping/R/SimpleITKR_wrap.cxx:757:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/Rdefines.h:33:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/R_ext/RS.h:27:
> > >> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:99:46: error:
> conflicting types for 'strpbrk'
> > >> inline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char*
> __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
> > >>                                            ^
> > >> /usr/include/string.h:86:7: note: previous declaration is here
> > >> char    *strpbrk(const char *, const char *);
> > >>        ^
> > >> In file included from /private/var/folders/qy/
> 0txzmt9n7mvcfrp4g2w14h8m0000gn/T/RtmpKGZyJo/devtools25f45d3de0c1/
> SimpleITK-SimpleITKRInstaller-68fadd1/SITK/Build/SimpleITK-
> build/Wrapping/R/SimpleITKR_wrap.cxx:757:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/Rdefines.h:33:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/R_ext/RS.h:27:
> > >> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:100:46: error:
> conflicting types for 'strrchr'
> > >> inline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s,
> int __c) {return ::strrchr(__s, __c);}
> > >>                                            ^
> > >> /usr/include/string.h:87:7: note: previous declaration is here
> > >> char    *strrchr(const char *, int);
> > >>        ^
> > >> In file included from /private/var/folders/qy/
> 0txzmt9n7mvcfrp4g2w14h8m0000gn/T/RtmpKGZyJo/devtools25f45d3de0c1/
> SimpleITK-SimpleITKRInstaller-68fadd1/SITK/Build/SimpleITK-
> build/Wrapping/R/SimpleITKR_wrap.cxx:757:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/Rdefines.h:33:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/R_ext/RS.h:27:
> > >> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:101:46: error:
> conflicting types for 'memchr'
> > >> inline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s,
> int __c, size_t __n) {return ::memchr(__s, __c, __n);}
> > >>                                            ^
> > >> /usr/include/string.h:70:7: note: previous declaration is here
> > >> void    *memchr(const void *, int, size_t);
> > >>        ^
> > >> In file included from /private/var/folders/qy/
> 0txzmt9n7mvcfrp4g2w14h8m0000gn/T/RtmpKGZyJo/devtools25f45d3de0c1/
> SimpleITK-SimpleITKRInstaller-68fadd1/SITK/Build/SimpleITK-
> build/Wrapping/R/SimpleITKR_wrap.cxx:757:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/Rdefines.h:33:
> > >> In file included from /Library/Frameworks/R.
> framework/Headers/R_ext/RS.h:27:
> > >> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:102:46: error:
> conflicting types for 'strstr'
> > >> inline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1,
> const char* __s2) {return ::strstr(__s1, __s2);}
> > >>                                            ^
> > >> /usr/include/string.h:89:7: note: previous declaration is here
> > >> char    *strstr(const char *, const char *);
> > >>        ^
> > >> 5 errors generated.
> > >> make[5]: *** [Wrapping/R/CMakeFiles/SimpleITK_R.dir/SimpleITKR_wrap.cxx.o]
> Error 1
> > >> make[4]: *** [Wrapping/R/CMakeFiles/SimpleITK_R.dir/all] Error 2
> > >> make[3]: *** [all] Error 2
> > >> make[2]: *** [SimpleITK-prefix/src/SimpleITK-stamp/SimpleITK-build]
> Error 2
> > >> make[1]: *** [CMakeFiles/SimpleITK.dir/all] Error 2
> > >> make: *** [all] Error 2
> > >> + exit 1
> > >> ERROR: configuration failed for package ‘SimpleITK’
> > >> * removing ‘/Library/Frameworks/R.framework/Versions/3.3/
> Resources/library/SimpleITK’
> > >> Error: Command failed (1)
> > >> _____________________________________
> > >> Powered by www.kitware.com
> > >>
> > >> Visit other Kitware open-source projects at
> > >> http://www.kitware.com/opensource/opensource.html
> > >>
> > >> Kitware offers ITK Training Courses, for more information visit:
> > >> http://www.kitware.com/products/protraining.php
> > >>
> > >> Please keep messages on-topic and check the ITK FAQ at:
> > >> http://www.itk.org/Wiki/ITK_FAQ
> > >>
> > >> Follow this link to subscribe/unsubscribe:
> > >> http://public.kitware.com/mailman/listinfo/insight-users
> > >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/insight-users
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161030/15396cff/attachment.html>


More information about the Insight-users mailing list