xtensor-stack / xtensor-python

Python bindings for xtensor
BSD 3-Clause "New" or "Revised" License
347 stars 58 forks source link

Include directories from conda package are incorrect #189

Closed tkloczko closed 5 years ago

tkloczko commented 5 years ago

Hi guys,

When installing xtensor-python using either conda-forge or quanstack channel, it appears that the variable INTERFACE_INCLUDE_DIRECTORIES in xtensor-pythonTargets.cmake contains an extra conda path. For instance, with the quantstack channel, one gets at line 56:

set_target_properties(xtensor-python PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/home/conda/feedstock_root/build_artifacts/xtensor-python_1544049780055/work/;${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "xtensor"
)

Removing the extra directory solves our problem. I checked that the xtensor target file only contains ${_IMPORT_PREFIX}/include.

Anyway, I used xtensor-python to wrap a c library, and it works like a charm :-) !

Thanks a lot again for this great job !

Sincerely, Thibaud. #

JohanMabille commented 5 years ago

Hi Thibaud,

indeed, I can confirm the existence of this extra conda path. This looks like a relocation problem due to the includes of Numpy or python.

What kind of errors do you have with this extra path? It should be ignored by the compiler if it does not exist.

SylvainCorlay commented 5 years ago

Thanks @tkloczko we found the root cause of the issue. Actually, this impacts at least of a couple of other QuantStack packages. This sould be fixed in #190.

tkloczko commented 5 years ago

Nice Thanks a lot !

To be complete, here is the error I got at the configuration step with cmake:

Imported target "xtensor-python" includes non-existent path
    "/feedstock_root/build_artefacts/xtensor-python_1544050623774/work/xtensor-python-0.22.0/"
  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not
  provide

So for compilation it was indeed not a real problem but for the install step, it could :-) !

Once again thank you very much !

A+ Thibaud.

SylvainCorlay commented 5 years ago

@tkloczko we just pushed out a patch release of xtensor-python (0.22.1) fixing that issue.