carve icon indicating copy to clipboard operation
carve copied to clipboard

Update cmake to support win builds

Open ngodber opened this issue 4 years ago • 7 comments

@qnzhou and @folded I'd really appreciate a review on the changes I made to get carve building on msvc. This work is in prep for creating a conda-forge feedstock for this great library to hopefully make it and pymesh more accessible.

ngodber avatar Jun 25 '21 07:06 ngodber

I'm not certain that I trust building windows DLLs. Generally speaking C++ dynamic objects on all platforms need careful thought. I'm also not sure I know why you would want to do this, unless PyMesh uses ctypes to access carve. It would be better to statically compile carve into the python module that is itself a DLL, but only has to expose C symbols.

folded avatar Jun 25 '21 16:06 folded

@folded thanks for the feedback. Assuredly this is fairly new ground for me so I can't comment on static vs dynamic. Am I right in thinking the issue is around ABI? The last package I submitted to conda forge the reviewer indicated that conda forge prefers dynamic libs. My guess is that given packages are all built using the same compiler architecture ABI isn't a concern. Although im doing this in order to package pymesh, carve will be packaged independently so that other projects can make us of it. I can setup the build to provide static and dynamic libs in the package.

ngodber avatar Jun 25 '21 22:06 ngodber

https://github.com/PyMesh/PyMesh/issues/302 the broader effort is here.

ngodber avatar Jun 25 '21 22:06 ngodber

@folded, beyond static vs dynamic, do you see any issues with the modifications made (most of which were around compiling with modern msvc)?

ngodber avatar Jun 28 '21 01:06 ngodber

I've considered switching carve to using bazel to build. Would that be of interest? I feel like - especially for c++ code - hermetic builds are a very sensible approach.

folded avatar Jun 29 '21 10:06 folded

@folded unfortunately bazel isn't support in conda-forge at this time though I am sure it will be added in time.

My primary goal is to substantially improve access to solid geometry libs from within python which, at time of writing, is poor. I just managed to get builds going though it ended up taking substantially more time than I had planned. I would hugely appreciate your review of the builds at https://github.com/conda-forge/staged-recipes/pull/15430. Unfortunately I've run out of time to finish pymesh build itself but I'm hoping another is willing to carry the ball forward!

ngodber avatar Jun 29 '21 13:06 ngodber

@folded are you interested in merging this? otherwise I'll nuke this branch and its associated conda-forge repo.

ngodber avatar Oct 20 '22 05:10 ngodber