Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/source/compilers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht

Distributed under the terms of the BSD 3-Clause License.

The full license is in the file LICENSE, distributed with this software.

Compiler workarounds
====================

This page tracks the workarounds for the various compiler issues that we
encountered in the development. This is mostly of interest for developers
interested in contributing to xtensor-python.

GCC and ``std::allocator<long long>``
-------------------------------------

GCC sometimes fails to automatically instantiate the ``std::allocator``
class template for the types ``long long`` and ``unsigned long long``.
Those allocators are thus explicitly instantiated in the dummy function
``void long_long_allocator()`` in the file ``py_container.hpp``.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ This software is licensed under the BSD-3-Clause license. See the LICENSE file f
.. toctree::
:caption: DEVELOPER ZONE

compilers
releasing

.. _NumPy: http://www.numpy.org
Expand Down
12 changes: 12 additions & 0 deletions include/xtensor-python/pycontainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,18 @@ namespace xt
}
#endif
}

#if defined(__GNUC__) && !defined(__clang__)
namespace workaround
{
// Fixes "undefined symbol" issues
inline void long_long_allocator()
{
std::allocator<long long> a;
std::allocator<unsigned long long> b;
}
}
#endif
}

#endif