Bug 1596468 - Python3 interpriter failed to importing a module using boost/numpy.hpp
Summary: Python3 interpriter failed to importing a module using boost/numpy.hpp
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: 28
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonathan Wakely
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-29 04:56 UTC by dolgorbie.kirby19
Modified: 2018-08-01 17:54 UTC (History)
4 users (show)

Fixed In Version: boost-1.66.0-8.fc28 boost-1.64.0-7.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-23 02:03:23 UTC
Type: Bug


Attachments (Terms of Use)

Description dolgorbie.kirby19 2018-06-29 04:56:00 UTC
Description of problem:

I made a python module with boost/python.hpp and boost/numpy.hpp.
Compiling its c++ source succeeded, but, in Python3, importing it failed.
The error message was 'RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime.'
It was fully successful without boost/numpy.hpp.

I was tried building boost and numpy from source and 
made the same module but it was failed and show the same error message.

The similar issue reports were found in boost, Ubuntu, and Arch communities.
Boost community says it is the packager's fault, because endian is automatically decided by compiler.
Boost does't change it.
For Ubuntu and Arch, they were able to do with downgrading boost and numpy.
But I was not in Fedora.

Version-Release number of selected component (if applicable):
Fedora 28, 
boost from 1.65.1 to 1.67.0
numpy from 1.12.1 to 1.14.5

How reproducible:
I don't know, because there is just one Fedora machine. 

Steps to Reproduce:
## mod.cpp --------
#include <boost/python.hpp>
#include <boost/python/numpy.hpp>

BOOST_PYTHON_MODULE(mod) {
    Py_Initialize();
    boost::python::numpy::initialize();
}
--------

## main.py --------
import mod
--------

step1. g++ -shared -fpic -o mod.so -lboost_python3 -lboost_numpy3
step2. python3 main.py

Actual results:
RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime.

Expected results:
do nothing

Additional info:

Comment 1 Jonathan Wakely 2018-06-29 09:49:40 UTC
(In reply to dolgorbie.kirby19 from comment #0)
> I was tried building boost and numpy from source and 
> made the same module but it was failed and show the same error message.
> 
> The similar issue reports were found in boost, Ubuntu, and Arch communities.
> Boost community says it is the packager's fault, because endian is
> automatically decided by compiler.
> Boost does't change it.

And neither does the Fedora package (nor the Arch package, nor the Ubuntu package, and neither did you when you built it from source).

This seems like an upstream bug to me.

Comment 2 Moritz Wanzenböck 2018-07-11 21:09:13 UTC
I've hit this bug too. I think I have found the upstream issue and fixed it. 
The patch has already been accepted upstream, see https://github.com/boostorg/python/pull/218 - I guess it will be included in the next release.

It would be nice to have the package in working order. The patch itself should be quite easy to backport to boost 1.66

Comment 3 Jonathan Wakely 2018-07-18 16:26:12 UTC
Fixed for rawhide and f28

Comment 4 Fedora Update System 2018-07-18 19:45:02 UTC
boost-1.64.0-7.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-01441e6ea8

Comment 5 Fedora Update System 2018-07-18 19:45:08 UTC
boost-1.66.0-8.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-031ea94959

Comment 6 Fedora Update System 2018-07-19 17:29:36 UTC
boost-1.64.0-7.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-01441e6ea8

Comment 7 Fedora Update System 2018-07-19 20:21:08 UTC
boost-1.66.0-8.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-031ea94959

Comment 8 Fedora Update System 2018-07-23 02:03:23 UTC
boost-1.66.0-8.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2018-08-01 17:54:52 UTC
boost-1.64.0-7.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.