Code Monkey home page Code Monkey logo

Comments (24)

flothesof avatar flothesof commented on May 24, 2024 1

I passed that step by adding eigen and cgal to the build step, not the host step as you did.

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024 1

@flothesof Try again with 0.6.6.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024 1

conda-forge build passes on all three platforms! https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=153819&view=results

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

Hi @nschloe
Here's my first try.
https://github.com/flothesof/staged-recipes/blob/pygalmesh_recipe/recipes/pygalmesh/meta.yaml

It's not yet ready since it doesn't properly build locally with CONFIG=osx64 ./.circleci/run_docker_build.sh.

But hopefully I'll get there. Have you been able to make it work?

Regards,
Florian

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

Got something similar at https://github.com/nschloe/staged-recipes/blob/pygalmesh/recipes/pygalmesh/meta.yaml, but also doesn't build yet. Cannot find Eigen/Dense, ha!

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

Not working for me.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

Sorry, I thought I had passed the build step but I was wrong. Doesn't work for me either.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

I believe the error is then due to the fact that the build environment doesn't include the Eigen headers in the right place. What I'm thinking is that this following line in setup.py needs to be fixed to point to the right place somehow:

os.environ.get("EIGEN_INCLUDE_DIR", "/usr/include/eigen3/"

It seems that the Eigen recipe.yaml checks for existence of the headers and generated code using:

commands:
    - test -d ${PREFIX}/include/eigen3  # [unix]
    - if not exist %PREFIX%\\Library\\include\\eigen3 exit 1  # [win]
    - if not exist %PREFIX%\\Library\\share\\pkgconfig\\eigen3.pc exit 1  # [win]

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

I was able to move a little bit more by removing the pip install from the recipe.yaml file and adding it to a build.sh file. See here: https://github.com/flothesof/staged-recipes/blob/pygalmesh_recipe/recipes/pygalmesh/build.sh

However, I now get this compilation error:

class Mesh_cell_criteria_3

^~~~~~~~~~~~~~~~~~~~

/home/conda/staged-recipes/build_artifacts/pygalmesh_1588442055213/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/include/CGAL/Mesh_cell_criteria_3.h:35:7: note: candidate expects 1 argument, 2 provided

error: command '/home/conda/staged-recipes/build_artifacts/pygalmesh_1588442055213/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit status 1

Building wheel for pygalmesh (PEP 517): finished with status 'error'

ERROR: Failed building wheel for pygalmesh

Failed to build pygalmesh

Any ideas @nschloe ?
This is when building from the Docker container of conda-forge, and I had not encountered this error while building locally earlier without the whole conda-forge infrastructure.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

Dear @nschloe
In the last CI build over at conda-forge, two unit tests are failing on osx, see log here: https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/152429/logs/38
And on is failing on linux: https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/152429/logs/34

Do you think this can be fixed by changing the tolerances for the unit tests? Or is something else the matter?
Thank you for your input.
Regards
Florian

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

Lets's just relax test dependencies until they fit.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

Do you mean that we should remove the tests from the conda forge build script?

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

I meant 7c974a6. Done now.

from pygalmesh.

montallban avatar montallban commented on May 24, 2024

Is there a way to install pygalmesh using conda-forge? I am still trying to build pygalmesh using pip install pygalmesh, but it fails on Eigen/Dense (as you've mentioned).

Or will this require me to edit specific files like setup.py?

Thanks very much for looking into this issue.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

@michaelmontalbano Right now, it is not (yet?) possible to install using conda-forge.

You could try my solution outlined here: #64 (comment)

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

@nschloe the last commit on conda-forge is now passing build for linux and osx (including tests!) following your changes.
However, the windows build fails at the linking stage, see here: https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/152561/logs/33

Some observations regarding this:

  • since the gmp library is not provided by conda-forge for windows (see this repo: https://github.com/conda-forge/gmp-feedstock) I disabled it in the meta.yaml file (which I now realize does not make much sense)
  • we could try to get gmp to be compiled for windows too by conda-forge, since the gmp homepage says:

It also is known to work on Windows in both 32-bit and 64-bit mode.

  • the build fails at the linking stage looking for 'stdc++.lib' --> I don't understand why this is happening

However, I'm running out of competence here, so I'm not sure what to do next.

from pygalmesh.

nehaljwani avatar nehaljwani commented on May 24, 2024

See #85 for the fix for the linking problem on Windows.

from pygalmesh.

montallban avatar montallban commented on May 24, 2024

@nehaljwani Even with those changes, I run into the error:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I\Users\User\usr\include\eigen-3.3.7\ -IC:\Users\User\AppData\Local\Temp\pip-build-env-835_y16g\normal\Lib\site-packages\pybind11\include -IC:\Users\User\AppData\Local\Temp\pip-build-env-835_y16g\normal\Lib\site-packages\pybind11\include -IC:\Users\User\Anaconda3\include -IC:\Users\User\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/generate.cpp /Fobuild\temp.win-amd64-3.7\Release\src/generate.obj -std=c++14
    cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
    generate.cpp
    src/generate.cpp(5): fatal error C1083: Cannot open include file: 'CGAL/Exact_predicates_inexact_constructions_kernel.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\User\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\usr\\include\\pygalmesh\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\usr\\include\\pygalmesh\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Critical, I think, is this bit:

Command line warning D9002 : ignoring unknown option '-std=c++14'
    generate.cpp
    src/generate.cpp(5): fatal error C1083: Cannot open include file: 'CGAL/Exact_predicates_inexact_constructions_kernel.h': No such file or directory

What does it mean about an unknown option? Do I need to download the CGAL header files separately and then, somewhere, direct the installer to their location?

from pygalmesh.

nehaljwani avatar nehaljwani commented on May 24, 2024

@montallban Along with the diff, try:

diff --git a/setup.py b/setup.py
index 7e288c5..0f8003a 100644
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,7 @@ ext_modules = [
         language="C++",
         include_dirs=[
             os.environ.get("EIGEN_INCLUDE_DIR", "/usr/include/eigen3/"),
+            os.environ.get("CGAL_INCLUDE_DIR", "/usr/include/CGAL/../"),
             # Path to pybind11 headers
             get_pybind_include(),
             get_pybind_include(user=True),

And then before running the build, point CGAL_INCLUDE_DIR to the location where cgal v5 is downloaded and extracted. You'll also need mpir and mpfr on Windows (they are interface dependencies of CGAL). You can either get these with vcpkg or conda or compile yourself.

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

@montallban Please don't highjack every single thread here.

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

However, I'm running out of competence here, so I'm not sure what to do next.

@flothesof I'd say disable the windows build for now. It's already nice enough if we get conda builds for Linux and MacOS. We can work on the Windows later.

from pygalmesh.

montallban avatar montallban commented on May 24, 2024

@nschloe I'm sorry, I thought this was about fixing the windows installation of pygalmesh. I assumed knowing which errors arise when one attempts installation would be to the benefit of those solving this problem. My apologies.

Unfortunate my linux cpu is at work. I'll try to make windows work.

from pygalmesh.

flothesof avatar flothesof commented on May 24, 2024

I think we're almost there: the build runs as expected for linux and osx and the only thing preventing it to run on windows is the test tolerance in test_volume_from_surface:

        tol = 2.0e-3
        assert abs(max(mesh.points[:, 0]) - 0.357612477657) < tol
        assert abs(min(mesh.points[:, 0]) + 0.358747130015) < tol
>       assert abs(max(mesh.points[:, 1]) - 0.496137874959) < tol
E       assert 0.014181661246307764 < 0.002
E        +  where 0.014181661246307764 = abs((0.4819562 - 0.496137874959))
E        +    where 0.4819562 = max(array([-0.19258097, -0.33402   , -0.3258206 ,  0.06994132, -0.1434645 ,\n       -0.42768064,  0.05553488,  0.0659714 , ...5258,  0.37050304, -0.1880949 ,  0.39482927,\n       -0.10133088,  0.07262085, -0.20886302, -0.19134675], dtype=float32))

https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/153741/logs/30

@nschloe if you up the tolerance again it seems that we could have builds for the three platforms! I'm not sure why the tolerance should be at least ten times higher on windows, though... let me first try to patch it in the conda forge recipe and see if it works (@nehaljwani has done this before, let's see if I manage to do it too)

from pygalmesh.

nschloe avatar nschloe commented on May 24, 2024

Added a question about reproducibility on cgal. CGAL/cgal#4699

from pygalmesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.