Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Windows does not create shared Boost.Numpy #98

Closed
dolfim opened this issue Jan 23, 2017 · 14 comments
Closed

Building on Windows does not create shared Boost.Numpy #98

dolfim opened this issue Jan 23, 2017 · 14 comments

Comments

@dolfim
Copy link

dolfim commented Jan 23, 2017

At conda-forge/boost-feedstock#32 we are trying to finalize the Boost Python package on Conda.
The build currently fails while copying boost_numpy-vc90-mt-1_63.lib, because the file does not exist.

The full log is at: boost_numpy-vc90-mt-1_63.lib
The build command is:

.\b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=msvc-%VS_MAJOR%.0 ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=static,shared ^
    --with-python ^
    -j%CPU_COUNT%

Is there something wrong in the build process, or did we find an issue in the Boost building process?

@jakirkham
Copy link
Contributor

I think the link to the log got lost. Linked below.

Note: This seems to happen with all Boost.Python builds on Windows, but not on Unix.

ref: https://ci.appveyor.com/project/conda-forge/boost-feedstock/build/1.0.97

@jakirkham
Copy link
Contributor

Any help on this would be greatly appreciated. We're kind of at a loss ATM.

@jhunold
Copy link
Contributor

jhunold commented Feb 9, 2017

It is the other way round. Building the shared libraries fails as the missing lib-prefix indicates the shared library. This is no wonder as the necessary dllexport/-import magic is completely missing from Boost.Numpy. The msvc linker thus refuses to create the empty boost_numpy-vc90-mt-1_63.lib stub which is needed by the installroutine.

@jakirkham
Copy link
Contributor

Yeah, sorry, we just realized we had it backwards earlier.

So what sort of change would we be looking at?

@XWarin
Copy link

XWarin commented Feb 14, 2017

Hi !

I stumbled on that issue yesterday trying to get rid of the old (independent) boost numpy.
Is this there something scheduled to correct this dynamic link problem ?
Best regards

@SPKorhonen
Copy link
Contributor

I also stumbled onto this problem when trying to update boost to 1.63 to get rid of separate boost::numpy dependency.

The problem is that, at least on windows, numpy generates empty shared libraries (the dll is generated but exports no symbols). This is due to the windows dll default settings. Everything that is not explicitly exported is private. As @jhunold stated the numpy is missing dllexport/-import magic words. I think that liberal sprinkling of BOOST_PYTHON_DECL before all symbols that are to be exported would help.

@dolfim dolfim changed the title Building on Windows does not create static Boost.Numpy Building on Windows does not create shared Boost.Numpy Feb 15, 2017
@SPKorhonen
Copy link
Contributor

I could make an effort on fixing this issue if nobody else has free time to devote to resolving this...

@XWarin
Copy link

XWarin commented Feb 15, 2017

Hi

It would be a good idea. I don't use much windows and i only port my work from linux.
Right now when on windows i still recompile the old boost numpy.
Best regards

@jakirkham
Copy link
Contributor

Seconding @XWarin. Some of us have limited knowledge of building on Windows and/or time to devote to this. As it sounds like you have both knowledge and time, @SPKorhonen, I'd say go for it. We would be very appreciative. Can help test patches if you would like.

@stefanseefeld
Copy link
Member

stefanseefeld commented Feb 15, 2017

I have just posted a PR at #108 in an attempt to fix this. I'd appreciate if someone could confirm, before I merge.

SPKorhonen added a commit to SPKorhonen/python that referenced this issue Feb 15, 2017
Fix for missing export symbols in shared library of boost::python::numpy
stefanseefeld pushed a commit that referenced this issue Feb 15, 2017
Fix for missing export symbols in shared library of boost::python::numpy
@jakirkham
Copy link
Contributor

So I guess this should be fixed by PR ( #110 ). Will try to test this and let you know how it goes.

@dolfim
Copy link
Author

dolfim commented Feb 15, 2017

We added the patch to the conda-forge package. Now it will try building here: https://ci.appveyor.com/project/conda-forge/boost-feedstock/build/1.0.109

Thanks a lot for the patch.

@dolfim
Copy link
Author

dolfim commented Feb 16, 2017

It seems to work correctly!

@dolfim dolfim closed this as completed Feb 16, 2017
@XWarin
Copy link

XWarin commented Feb 16, 2017 via email

bkpoon referenced this issue in cctbx/cctbx_project Apr 23, 2018
  Missed linking of boost numpy submodule
Anthchirp added a commit to cctbx/cctbx_project that referenced this issue Jun 3, 2018
This is due to a bug in 1.63 which means the boost_numpy.lib is not
created. boostorg/python#98
Anthchirp added a commit to cctbx/cctbx_project that referenced this issue Jun 3, 2018
This is a necessary prerequisite to #70.

Reason this failed was that BOOST_PYTHON_SOURCE was defined for the
boost::numpy components. This led to an attempt to export boost::python
in the boost::numpy library, which then failed during linking.

On Windows boost::numpy requires boost 1.64.
This is due to a bug in 1.63 which means the boost_numpy.lib is not
created. boostorg/python#98
bkpoon pushed a commit to cctbx/cctbx_project that referenced this issue Jun 8, 2018
This is a necessary prerequisite to #70.

Reason this failed was that BOOST_PYTHON_SOURCE was defined for the
boost::numpy components. This led to an attempt to export boost::python
in the boost::numpy library, which then failed during linking.

On Windows boost::numpy requires boost 1.64.
This is due to a bug in 1.63 which means the boost_numpy.lib is not
created. boostorg/python#98
ndevenish pushed a commit to ndevenish/cctbx_project that referenced this issue Jun 8, 2018
This is a necessary prerequisite to #70.

Reason this failed was that BOOST_PYTHON_SOURCE was defined for the
boost::numpy components. This led to an attempt to export boost::python
in the boost::numpy library, which then failed during linking.

On Windows boost::numpy requires boost 1.64.
This is due to a bug in 1.63 which means the boost_numpy.lib is not
created. boostorg/python#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants