Marcello-Sega / pytetgen

python interface to tetgen
GNU Affero General Public License v3.0
9 stars 1 forks source link

Unable to build on Windows 10, VS 14 #3

Closed thomasaarholt closed 3 years ago

thomasaarholt commented 3 years ago

I'm getting a rather large error when trying to build this by pip install pytetgen on python 3.8, windows 10 and Visual Studio 14. Cython is installed.

I'm specifically looking for a drop-in replacement of scipy's Delaunay function for use with the scipy point cloud interpolation functions (LinearNDInterpolator and similar). Just in case you have any ideas :)

The full error log is here, should you be interested.

Marcello-Sega commented 3 years ago

Hi,

I never tested it on a window machine, but from the error messages it looks like it might be a cython problem. Could you try updating your cython?

M

thomasaarholt commented 3 years ago

I'd originally installed it from conda today, and tried uninstalling and reinstalling it using pip, but I get the same error.

Marcello-Sega commented 3 years ago

Mhhh... I'm using py3.6 on my machine. I will have it tested on travis and will let you know asap.

Marcello-Sega commented 3 years ago

Bad luck:

Worker information

The language 'python' is currently unsupported on the Windows Build Environment.

I'll try something else.

Marcello-Sega commented 3 years ago

Still haven't managed to try it on a windows machine, but now it behaves well with python3.x. The old implementation had a problem with the GIL and memory management.

Could you try upgrading with pip install --upgrade pytetgen ? The new version should be 0.2.0

Most likely the problem was the old .cpp source included in the package, which was definitely not compatible with python3.x. Another option, if still it does not work, would be to install from source to generate the .cpp source from .pyx directly on your machine ( pip install --compile . from within the source directory)

thomasaarholt commented 3 years ago

Yes! That built and installed!

thomasaarholt commented 3 years ago

Wahey! And it's twice as fast as scipy's implementation on my computer!

thomasaarholt commented 3 years ago

That was for 1 million 2D points:

import numpy as np
points = np.random.random((1000000, 2)) * (1000, 1000) # spread over 0-1000 bc we could run into floating point errors

import pytetgen
from scipy.spatial import Delaunay
%timeit Delaunay(points)
%timeit pytetgen.Delaunay(points)

6.34 s ± 20.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
3.04 s ± 14.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Marcello-Sega commented 3 years ago

I guess this can be closed.