Skip to content

Install python bindings of releases/2.9

Hi all, when i try to build with cmake .. -DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_ALLOW_GET_PIP=1 -DDUNE_PYTHON_VIRTUALENV_SETUP=TRUE -DDUNE_ENABLE_PYTHONBINDINGS=TRUE -DBUILD_SHARED_LIBS=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Alberta=TRUE inspired by the FLAGS in the .gitlab-ci.ymlfile. All modules are checkout and installed using the releases/2.9 branches I get:

Compiler output before the error
-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Dependencies for dune-foamgrid: dune-common (>= 2.8);dune-geometry (>= 2.8);dune-grid (>= 2.8)
-- Dependencies for dune-geometry: dune-common (>= 2.9)
-- Dependencies for dune-grid: dune-geometry (>= 2.9)
-- Suggestions for dune-grid: dune-uggrid (>=2.9)
-- Dependencies for dune-geometry: dune-common (>= 2.9)
-- Dependencies for dune-uggrid: dune-common (>= 2.9)
-- Performing Test cxx_std_flag_17
-- Performing Test cxx_std_flag_17 - Success
-- Performing Test compiler_supports_cxx17
-- Performing Test compiler_supports_cxx17 - Success
-- Looking for std::experimental::make_array<int,int>
-- Looking for std::experimental::make_array<int,int> - found
-- Looking for std::move<std::experimental::detected_t<std::decay_t,int>>
-- Looking for std::move<std::experimental::detected_t<std::decay_t,int>> - found
-- Looking for std::identity
-- Looking for std::identity - not found
-- Performing Test DUNE_HAVE_CXX_UNEVALUATED_CONTEXT_LAMBDA
-- Performing Test DUNE_HAVE_CXX_UNEVALUATED_CONTEXT_LAMBDA - Failed
-- Could NOT find LATEX (missing: LATEX_COMPILER) 
-- Could NOT find LatexMk (missing: LATEXMK_EXECUTABLE) 
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Performing tests for dune-common (from /usr/local/share/dune/cmake/modules/DuneCommonMacros.cmake)
-- Set Minimal Debug Level to 4
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so  
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /usr/lib/x86_64-linux-gnu/libopenblas.so;-lm;-ldl  
-- Looking for dsyev_
-- Looking for dsyev_ - found
-- Could NOT find GMP (missing: GMPXX_LIB GMPXX_INCLUDE_DIR GMP_INCLUDE_DIR GMP_LIB) 
-- Performing Test QuadMath_COMPILES
-- Performing Test QuadMath_COMPILES - Success
-- Found QuadMath: (Supported by compiler)  
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found suitable version "3.1", minimum required is "3.0") 
-- Found MPI: TRUE (found suitable version "3.1", minimum required is "3.0") found components: C 
-- Could NOT find TBB (set TBB_DIR to path containing TBBConfig.cmake or set PKG_CONFIG_PATH to include the location of the tbb.pc file) (missing: PkgConfigTBB_LINK_LIBRARIES PkgConfigTBB_FOUND) (found version "")
-- Could NOT find PTScotch (missing: SCOTCH_LIBRARY SCOTCHERR_LIBRARY SCOTCH_INCLUDE_DIR) 
-- Found METIS: /usr/lib/x86_64-linux-gnu/libmetis.so (found version "5.1") 
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: C 
-- Could NOT find ParMETIS (missing: PARMETIS_LIBRARY PARMETIS_INCLUDE_DIR) (Required is at least version "4.0")
-- Could NOT find Vc (missing: Vc_DIR)
CMake Warning at /usr/local/share/dune/cmake/modules/DunePythonDeprecations.cmake:19 (message):
      The DUNE_PYTHON_VIRTUALENV_SETUP variable is deprecated, as it's
       behaviour is now enabled by default.

Call Stack (most recent call first):
  /usr/local/share/dune/cmake/modules/DunePythonCommonMacros.cmake:70 (include)
  /usr/local/share/dune/cmake/modules/DuneCommonMacros.cmake:54 (include)
  /usr/local/share/dune/cmake/modules/DuneModuleDependencies.cmake:112 (include)
  /usr/local/share/dune/cmake/modules/DuneProject.cmake:123 (dune_process_dependency_macros)
  CMakeLists.txt:19 (dune_project)


-- Found Python3: /usr/bin/python3 (found version "3.10.9") found components: Interpreter Development Development.Module Development.Embed 
-- Found pip_/usr/bin/python3: TRUE  
-- Failed to find the python package virtualenv with interpreter /usr/bin/python3. (missing: DUNE_PYTHON_virtualenv_FOUND) 
-- Found venv_/usr/bin/python3: TRUE  
-- Building a virtualenv in /dune/dune-foamgrid/build/dune-env
-- Failed to find the python package pip with interpreter /dune/dune-foamgrid/build/dune-env/bin/python. (missing: pippresent) 
-- Installing pip using https://bootstrap.pypa.io/get-pip.py...
-- Setting dune-common_INCLUDE_DIRS=/usr/local/include
-- Setting dune-common_LIBRARIES=dunecommon
-- Performing tests for dune-uggrid (from /usr/local/share/dune/cmake/modules/DuneUggridMacros.cmake)
-- Setting dune-uggrid_INCLUDE_DIRS=/usr/local/include
-- Setting dune-uggrid_LIBRARIES=duneuggrid
-- Setting dune-geometry_INCLUDE_DIRS=/usr/local/include
-- Setting dune-geometry_LIBRARIES=dunegeometry
-- Performing tests for dune-grid (from /usr/local/share/dune/cmake/modules/DuneGridMacros.cmake)
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Could NOT find ParMETIS (missing: PARMETIS_LIBRARY PARMETIS_INCLUDE_DIR) 
-- Setting dune-grid_INCLUDE_DIRS=/usr/local/include
-- Setting dune-grid_LIBRARIES=dunegrid
-- Performing tests for dune-foamgrid (from /dune/dune-foamgrid/cmake/modules/DuneFoamgridMacros.cmake)
-- Using scripts from /usr/local/share/dune/cmake/scripts for creating doxygen stuff.
CMake Deprecation Warning at /usr/local/share/dune/cmake/modules/DunePythonInstallPackage.cmake:652 (message):
  This function is deprecated.  Use 'dune_python_configure_bindings' for
  python binding packages or 'dune_python_configure_package' for installable
  python packages
Call Stack (most recent call first):
  python/CMakeLists.txt:5 (dune_python_install_package)


-- Installing python package abstract requirements: dune-common dune-geometry dune-grid 
-- Installing python package at /dune/dune-foamgrid/build/python/. into Dune virtual environment 
-- Generating the CMake metadata file at dune/data/dune-foamgrid.cmake
-- Adding custom target for config.h generation
-- The following OPTIONAL packages have been found:

 * dune-uggrid
 * BLAS, fast linear algebra routines
 * LAPACK, fast linear algebra routines
 * QuadMath, GCC Quad-Precision Math Library, <https://gcc.gnu.org/onlinedocs/libquadmath>
 * Threads, Multi-threading library
 * Python3
 * METIS, Serial Graph Partitioning, <http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>
 * MPI, Message Passing Interface library
   Parallel programming on multiple processors

-- The following REQUIRED packages have been found:

 * dune-common
 * dune-geometry
 * dune-grid

-- The following OPTIONAL packages have not been found:

 * LATEX
 * LatexMk
 * Sphinx, Documentation generator, <www.sphinx-doc.org>
   To generate the documentation from CMake and Python sources
 * Doxygen, Class documentation generator, <www.doxygen.org>
   To generate the class documentation from C++ sources
 * GMP, GNU multi-precision library, <https://gmplib.org>
 * Inkscape, converts SVG images, <www.inkscape.org>
   To generate the documentation with LaTeX
 * TBB, Intel's Threading Building Blocks, <https://github.com/oneapi-src/oneTBB>
 * PTScotch, Sequential and Parallel Graph Partitioning, <https://gitlab.inria.fr/scotch/scotch>
 * Vc, C++ Vectorization library, <https://github.com/VcDevel/Vc>
   For use of SIMD instructions
 * ParMETIS, Parallel Graph Partitioning, <http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview>

-- Configuring done
-- Generating done
-- Build files have been written to: /dune/dune-foamgrid/build
-- Install configuration: "Release"
-- Installing: /usr/local/lib/dunecontrol/dune-foamgrid/dune.module
-- Installing: /usr/local/lib/cmake/dune-foamgrid/dune-foamgrid-config.cmake
-- Installing: /usr/local/lib/cmake/dune-foamgrid/dune-foamgrid-config-version.cmake
-- Installing: /usr/local/lib/pkgconfig/dune-foamgrid.pc
-- Installing: /usr/local/include/dune/foamgrid/foamgrid.hh
-- Installing: /usr/local/include/dune/foamgrid/dgffoam.cc
-- Installing: /usr/local/include/dune/foamgrid/dgffoam.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgrid.cc
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridedge.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridelements.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridentity.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridentityseed.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridfactory.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridgeometry.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridhierarchiciterator.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridindexsets.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridintersectioniterators.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridintersections.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridleafiterator.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridleveliterator.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridnulliteratorfactory.hh
-- Installing: /usr/local/include/dune/foamgrid/foamgrid/foamgridvertex.hh
-- Installing: /usr/local/share/dune/cmake/modules/DuneFoamgridMacros.cmake

And then getting the error:

The error
Installing python package
CMake Warning at /usr/local/share/dune/cmake/modules/DuneExecuteProcess.cmake:76 (message):
  python package installation failed - ignored

  Run
  command:/usr/bin/cmake;--build;.;--target;install_python;--config;Release

  Return code: 2

  Output:

  [100%] Installing the python package at /dune/dune-foamgrid/build/python/.
  (location --user)

  Looking in links: file:///usr/local/share/dune/wheelhouse

  Processing /dune/dune-foamgrid/build/python

    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'

  Requirement already satisfied: dune-common in
  /root/.local/lib/python3.10/site-packages (from dune-foamgrid==2.10.0)
  (2.9.0)

  Requirement already satisfied: dune-geometry in
  /root/.local/lib/python3.10/site-packages (from dune-foamgrid==2.10.0)
  (2.9.0)

  Requirement already satisfied: dune-grid in
  /root/.local/lib/python3.10/site-packages (from dune-foamgrid==2.10.0)
  (2.9.0)

  Requirement already satisfied: pip>=21.a in /usr/lib/python3/dist-packages
  (from dune-common->dune-foamgrid==2.10.0) (22.3.1)

  Requirement already satisfied: portalocker in
  /root/.local/lib/python3.10/site-packages (from
  dune-common->dune-foamgrid==2.10.0) (2.7.0)

  Requirement already satisfied: numpy in
  /usr/local/lib/python3.10/dist-packages (from
  dune-common->dune-foamgrid==2.10.0) (1.24.1)

  Requirement already satisfied: setuptools>=41 in
  /usr/lib/python3/dist-packages (from dune-common->dune-foamgrid==2.10.0)
  (65.6.3)

  Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages
  (from dune-common->dune-foamgrid==2.10.0) (3.0.3)

  Requirement already satisfied: mpi4py in
  /root/.local/lib/python3.10/site-packages (from
  dune-common->dune-foamgrid==2.10.0) (3.1.4)

  Requirement already satisfied: wheel in /usr/lib/python3/dist-packages
  (from dune-common->dune-foamgrid==2.10.0) (0.38.4)

  Building wheels for collected packages: dune-foamgrid

    Building wheel for dune-foamgrid (setup.py): started
    Building wheel for dune-foamgrid (setup.py): finished with status 'error'
    error: subprocess-exited-with-error
    
    × python setup.py bdist_wheel did not run successfully.
exit code: 1
    ╰─> [8 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build/lib
        creating build/lib/dune
        creating build/lib/dune/foamgrid
        error: can't copy 'dune/foamgrid/__init__.py.py': doesn't exist or not a regular file
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for dune-foamgrid
    Running setup.py clean for dune-foamgrid

  Failed to build dune-foamgrid

  Installing collected packages: dune-foamgrid

    Running setup.py install for dune-foamgrid: started
    Running setup.py install for dune-foamgrid: finished with status 'error'
    error: subprocess-exited-with-error
    
    × Running setup.py install for dune-foamgrid did not run successfully.
exit code: 1
    ╰─> [10 lines of output]
        running install
        /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        running build
        running build_py
        creating build
        creating build/lib
        creating build/lib/dune
        creating build/lib/dune/foamgrid
        error: can't copy 'dune/foamgrid/__init__.py.py': doesn't exist or not a regular file
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.

  error: legacy-install-failure

  

  × Encountered error while trying to install package.

  ╰─> dune-foamgrid

  

  note: This is an issue with the package mentioned above, not pip.

  hint: See above for output from the failure.

  gmake[3]: ***
  [python/CMakeFiles/install_python_package_dune.dir/build.make:71:
  python/CMakeFiles/install_python_package_dune] Error 1

  gmake[2]: *** [CMakeFiles/Makefile2:1513:
  python/CMakeFiles/install_python_package_dune.dir/all] Error 2

  gmake[1]: *** [CMakeFiles/Makefile2:1208:
  CMakeFiles/install_python.dir/rule] Error 2

  gmake: *** [Makefile:621: install_python] Error 2

Call Stack (most recent call first):
  python/cmake_install.cmake:50 (dune_execute_process)
  cmake_install.cmake:66 (include)


Installing wheel for python package at /dune/dune-foamgrid/build/python/. into /usr/local/share/dune/wheelhouse...
CMake Warning at /usr/local/share/dune/cmake/modules/DuneExecuteProcess.cmake:76 (message):
  wheel installation failed - ignored

  Run
  command:/dune/dune-foamgrid/build/dune-env/bin/python;-m;pip;wheel;-w;/usr/local/share/dune/wheelhouse;--find-links=file:///usr/local/share/dune/wheelhouse;/dune/dune-foamgrid/build/python/.


  Return code: 1

  Output:

  Looking in links: file:///usr/local/share/dune/wheelhouse

  Processing ./python

    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'

  Processing
  /usr/local/share/dune/wheelhouse/dune_common-2.9.0-cp310-cp310-linux_x86_64.whl


    File was already downloaded /usr/local/share/dune/wheelhouse/dune_common-2.9.0-cp310-cp310-linux_x86_64.whl

  Processing
  /usr/local/share/dune/wheelhouse/dune_geometry-2.9.0-cp310-cp310-linux_x86_64.whl


    File was already downloaded /usr/local/share/dune/wheelhouse/dune_geometry-2.9.0-cp310-cp310-linux_x86_64.whl

  Processing
  /usr/local/share/dune/wheelhouse/dune_grid-2.9.0-cp310-cp310-linux_x86_64.whl


    File was already downloaded /usr/local/share/dune/wheelhouse/dune_grid-2.9.0-cp310-cp310-linux_x86_64.whl

  Collecting jinja2

    File was already downloaded /usr/local/share/dune/wheelhouse/Jinja2-3.1.2-py3-none-any.whl

  Collecting setuptools>=41

    File was already downloaded /usr/local/share/dune/wheelhouse/setuptools-66.1.1-py3-none-any.whl

  Collecting wheel

    File was already downloaded /usr/local/share/dune/wheelhouse/wheel-0.38.4-py3-none-any.whl

  Collecting pip>=21

    File was already downloaded /usr/local/share/dune/wheelhouse/pip-22.3.1-py3-none-any.whl

  Collecting numpy

    File was already downloaded /usr/local/share/dune/wheelhouse/numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

  Collecting portalocker

    File was already downloaded /usr/local/share/dune/wheelhouse/portalocker-2.7.0-py2.py3-none-any.whl

  Collecting MarkupSafe>=2.0

    File was already downloaded /usr/local/share/dune/wheelhouse/MarkupSafe-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

  Building wheels for collected packages: dune-foamgrid

    Building wheel for dune-foamgrid (setup.py): started
    Building wheel for dune-foamgrid (setup.py): finished with status 'error'
    error: subprocess-exited-with-error
    
    × python setup.py bdist_wheel did not run successfully.
exit code: 1
    ╰─> [4 lines of output]
        running bdist_wheel
        running build
        running build_py
        error: can't copy 'dune/foamgrid/__init__.py.py': doesn't exist or not a regular file
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for dune-foamgrid
    Running setup.py clean for dune-foamgrid

  Failed to build dune-foamgrid

  ERROR: Failed to build one or more wheels

Call Stack (most recent call first):
  python/cmake_install.cmake:53 (dune_execute_process)
  cmake_install.cmake:66 (include)

I don't know much about python but it looks suspicious that the script is searching for some file dune/foamgrid/__init__.py.py that is not existing?

Edited by Alexander Müller
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information