Menu

#171 r 4133 breaks pymol builds on legacy system libstdc++ of OS X <= 10.8

v1.7.1.0
closed-fixed
None
5
2015-11-12
2015-10-26
No

Discussion

  • Thomas Holder

    Thomas Holder - 2015-10-29

    compatibility with old compilers is not high priority, but will be considered if feasable. What is __cplusplus set to on your system?

     
  • Jack Howarth

    Jack Howarth - 2015-10-29

    The proposed patch is incomplete for restoring the legacy libstdc++ build. Testing on 10.7 against Apple clang from Xcode 4.6 fails with...

    :info:destroot /usr/bin/clang++ -std=c++0x -D_PYMOL_LIBPNG -D_PYMOL_INLINE -D_PYMOL_VMD_PLUGINS -D_HAVE_LIBXML -D_PYMOL_FREETYPE -DNO_MMLIBS -D_PYMOL_NO_CXX11 -D_P
    YMOL_NUMPY -Iov/src -Ilayer0 -Ilayer1 -Ilayer2 -Ilayer3 -Ilayer4 -Ilayer5 -Imodules/cealign/src -Ibuild/generated -Icontrib/uiuc/plugins/include -Icontrib/uiuc/plu
    gins/molfile_plugin/src -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include -I/opt/lo
    cal/include/freetype2 -I/opt/local/include/libxml2 -I/usr/include -I/usr/include/libxml2 -I/usr/X11/include -I/usr/X11/include/freetype2 -I/opt/local/Library/Frame
    works/Python.framework/Versions/2.7/include/python2.7 -c layer2/AtomInfo.cpp -o build/temp.macosx-10.7-x86_64-2.7/layer2/AtomInfo.o -Wno-narrowing -Werror=implicit
    -function-declaration -Werror=declaration-after-statement -Wno-write-strings -Wno-unused-function -Wno-empty-body -Wno-char-subscripts -ffast-math -funroll-loops -
    O3 -g -fcommon
    :info:destroot layer2/AtomInfo.cpp:1166:12: error: no member named 'copy_n' in namespace 'std'; did you mean 'copy'?
    :info:destroot       std::copy_n(u, 6, I->get_anisou());
    :info:destroot       ~~~~~^~~~~~
    :info:destroot            copy
    :info:destroot /usr/include/c++/4.2.1/bits/stl_algobase.h:389:5: note: 'copy' declared here
    :info:destroot     copy(_InputIterator __first, _InputIterator __last,
    :info:destroot     ^
    :info:destroot layer2/AtomInfo.cpp:1166:7: error: no matching function for call to 'copy'
    :info:destroot       std::copy_n(u, 6, I->get_anisou());
    :info:destroot       ^~~~~~~~~~~
    :info:destroot /usr/include/c++/4.2.1/bits/stl_algobase.h:389:5: note: candidate template ignored: deduced conflicting types for parameter '_InputIterator' ('float
     *' vs. 'int')
    :info:destroot     copy(_InputIterator __first, _InputIterator __last,
    :info:destroot     ^
    :info:destroot layer2/AtomInfo.cpp:1199:10: error: no member named 'copy_n' in namespace 'std'layer1/CGO.cpp:; did you mean8535: 'copy'?
    :info:destroot     std::copy_n(src->anisou, 6, dst->get_anisou());
    :info:destroot     ~~~~~^~~~~~
    :info:destroot          copy
    :info:destroot /usr/include/c++/4.2.1/bits/stl_algobase.h:389:5: note: 'copy' declared here
    :info:destroot     copy(_InputIterator __first, _InputIterator __last,
    :info:destroot 5: warning: expression result unused    ^
    :info:destroot layer2/AtomInfo.cpp:1199:5: error: no matching function for call to 'copy'
    :info:destroot     std::copy_n(src->anisou, 6, dst->get_anisou());
    :info:destroot     ^~~~~~~~~~~
    :info:destroot /usr/include/c++/4.2.1/bits/stl_algobase.h:389:5: note: candidate template ignored: deduced conflicting types for parameter '_InputIterator' ('float
     *' vs. 'int')
    :info:destroot     copy(_InputIterator __first, _InputIterator __last,
    :info:destroot     ^
    :info:destroot  [-Wunused-value]
    :info:destroot     CGO_read_int(pc);
    :info:destroot     ^~~~~~~~~~~~~~~~
    :info:destroot layer1/CGO.h:34:26: note: expanded from macro 'CGO_read_int'
    :info:destroot #define CGO_read_int(p) (*((int*)((p)++)))
    :info:destroot                          ^~~~~~~~~~~~~~~~
    :info:destroot 4 errors generated.
    
     
  • Thomas Holder

    Thomas Holder - 2015-10-29

    have you tried
    export CXXFLAGS="-stdlib=libc++"

     
    • Jack Howarth

      Jack Howarth - 2015-10-29

      Using...

      export CXXFLAGS="-stdlib=libc++"

      isn't appropriate prior to OS X 10.9 as the libc++ present in 10.7/10.8 lacks complete c++-11 support.

       
  • Thomas Holder

    Thomas Holder - 2015-10-30

    I successfully compiled pymol on OS X 10.7.5 with /usr/bin/python2.7, using /usr/bin/clang++ and CXXFLAGS="-stdlib=libc++"

    No modification on the C++11 code. I had to modify the files "monkeypatch_distutils.py" and "setup.py" and do some trickery to force distutils to use clang++ instead of llvm-g++-4.2

     
  • Jack Howarth

    Jack Howarth - 2015-10-30

    This approach only works because pymol currently doesn't link against any additional c++-based support libraries. While some of the current dependencies like scipy currently build as c++, that code is isolated into its own python modules so there is no mixing of the two c++ libraries. See...

    https://wiki.freebsd.org/NewC++Stack

    on the issues with mixing the two c++ ABI's.

     
  • Thomas Holder

    Thomas Holder - 2015-11-12

    thanks for clarifying.

    Backport patch applied to SVN 4141.

     
  • Thomas Holder

    Thomas Holder - 2015-11-12
    • status: open --> closed-fixed
    • assigned_to: Thomas Holder
     

Log in to post a comment.