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

is there a procedure to install xtensor-python via standard pip on windows ? #96

Open
stonebig opened this issue May 11, 2017 · 16 comments
Open
Labels

Comments

@stonebig
Copy link
Contributor

@stonebig stonebig commented May 11, 2017

maybe it's impossible...

@SylvainCorlay
Copy link
Member

@SylvainCorlay SylvainCorlay commented May 11, 2017

At the moment we have not provided one. We could do this via the install_headers directive.

My idea on this was to create an xtensor-pip package that would vendor xtensor and xtensor-python and install the headers the install_headers pip directive.

The drawback is that the headers are then (typically) installed under the python include directory - which is genrally different from the general include directory of the prefix (include vs include/pythonX.Y).

Maybe we could do this with python wheels' data files instead. If you have a suggestion, that would be great?

@SylvainCorlay
Copy link
Member

@SylvainCorlay SylvainCorlay commented May 11, 2017

cc @ghisvail .

If there is a reliable means with python wheels to install into the prefix include directory, that might be the solution, and we could simply add a setup.py to the repository.

@brilhana
Copy link

@brilhana brilhana commented Feb 11, 2020

Any update on this?

@PerretB
Copy link
Contributor

@PerretB PerretB commented Feb 12, 2020

One could do it in pybind11 or numpy style. First, define header files as package data : they will be copied in the package directory during install. Then define a method get_include that returns the path to the local include files, see eg. get_include in pybind11.

Of course this does not follow the classical system way to do it, but it is indeed pretty convenient and OS independent in a python context.

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Apr 4, 2020

Hi, I created a pull request where I copied the respective files from pybind11. Not finished yet but works for me already: #236

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Apr 5, 2020

I drafted a meta package that provides the headers.

https://github.com/StefanUlbrich/xtensor-cpp

Maybe this is a useful extension to the xtensor-stack?

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Apr 6, 2020

Hi @StefanUlbrich ,

Thank you for tackling this! I'm not sure yet, but I wonder if building the wheel with scikit-build and CMake could simplify the process:

  • the wheel can be done in a dedicated repo (no need to add specific packaging stuff here)
  • all the files to install would be get from CMake, no need to duplicate.
  • we could use CMake external projects mechanism and avoid relying on git submodules.

@SylvainCorlay any thought on this?

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Apr 6, 2020

@JohanMabille what about conan? most of the xtensor stack is already there

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Apr 6, 2020

I am not sure if these packages are still maintained. Anyway this is orthogonal to pip, right? I mean, having a package for conan is independent from having / building a wheel for pip, or is there some bridge that makes it easy to have one when we already have the other?

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Apr 6, 2020

@JohanMabille The packages are still maintained but you are right. My idea was to have a simple package that can be installed and a numeric extension can be set up with minimal effort using setuptools. CMake is of course standard but might be overkill for those not familiar with it–I personally never became comfortable with it when I met it 10yrs ago. In addition, some projects might require lapack and blas installation and static linking (xtensor-blas).
Do you think a cookie cutter would be more adequate? I am more than willing to contribute to an "official" endorsed "starter kit"

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Apr 6, 2020

Maybe this thread is a good way to start?

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Apr 6, 2020

CMake is of course standard but might be overkill for those not familiar with it

I totally agree, especially for people coming from Python and not having a lot of experience with C++ projects. What I meant is that we (developers and package maintainers) should leverage on existing CMake to build packages in order to make the process easier to maintain (no need to duplicate list of files, build flags, etc).

Do you think a cookie cutter would be more adequate?

We already provide a [cookie cutter] for authoring python extensions based on xtensor, but it might be broken (I haven't tried it for a while) and anyway it deserves some love ;). I think this (cookie cutter) and a wheel are complementary since the cookie cutter does not vendor the dependencies.

I am more than willing to contribute to an "official" endorsed "starter kit"

Thanks that is much appreciated! We have already experienced with scikit-build for building a more complicated stack. The process should be simpler for xtensor since it's a header-only library an it as fewer dependencies.

We split the R-bindings and Julia bindings in two packages, one pure C++ package, and one that vendors the C++ package and its dependencies (see https://github.com/xtensor-stack/Xtensor.R and https://github.com/xtensor-stack/xtensor-r for instance). As per in person conversation with @SylvainCorlay, we should do the same with xtensor-python: keep the headers and pure C++ stuff in xtensor-python and move the Python-related stuff in a new repo xtensor.py, that would vendor the dependencies and build the wheel based on scikit-build

Let us know what you prefer, you can create this xtensor.py repo and iterate on it until you have soething that works, then transfer it to the xtensor-stack organization, or we can create it directly here. In both cases I would be super happy to help with CMake and scikit-build.

@SylvainCorlay
Copy link
Member

@SylvainCorlay SylvainCorlay commented Apr 6, 2020

We already provide a [cookie cutter] for authoring python extensions based on xtensor, but it might be broken (I haven't tried it for a while) and anyway it deserves some love ;)

CI is set up for the cookiecutters. We should definitely give it a run.

We should do the same with xtensor-python: keep the headers and pure C++ stuff in xtensor-python and move the Python-related stuff in a new repo xtensor.py, that would vendor the dependencies and build the wheel based on scikit-build.

👍 we have done this for both Julia and R.

@Coderx7
Copy link

@Coderx7 Coderx7 commented Jun 3, 2020

Hey everyone,
Any update on this?

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Jun 3, 2020

We are swamped with a lot of other tasks and don't have the time to implement it for now. We can provide some guidance if you want to tackle this.

@StefanUlbrich
Copy link

@StefanUlbrich StefanUlbrich commented Jun 3, 2020

Just switched jobs. I'd love to continue within the next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.