Skip to content
Snippets Groups Projects

test python support

Merged Andreas Dedner requested to merge add-python into master
1 unresolved thread

This is based on core/dune-common!960 (merged) It adds testing of the python bindings in different configurations. Also added tests for using an external builddir. To avoid increasing the number of pipelines these different setups are added to the existing pipelines. Six different configurations are tested (tensor product of (no python, internal venv, external venv) x (interbal builddir, external builddir)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I like the idea to introduce optional parameters to the toolchains to generate multiple jobs with different setups.

  • 82 out.write('{} {} {}:\n'.format(toolchain[0], toolchain[1], mod[0]))
    94 extraTags = ''
    95 if toolchain[2].get("python",None):
    96 extraTags += " venv-" + toolchain[2]["python"]
    97 if toolchain[2].get("builddir",None):
    98 extraTags += " bdir-" + toolchain[2]["builddir"]
    99 out.write('{} {} {}{}:\n'.format(toolchain[0], toolchain[1], mod[0],
    100 extraTags))
    83 101 out.write(' <<: *{}\n'.format(mod[0]))
    84 102 out.write(' image: registry.dune-project.org/docker/ci/{}\n'.format(toolchain[0]))
    85 103 out.write(' variables:\n')
    86 104 out.write(' DUNECI_TOOLCHAIN: {}\n'.format(toolchain[1]))
    105 if toolchain[2].get("python",None) is None:
    106 out.write(' DUNECI_CMAKE_FLAGS: "$DUNECI_CMAKE_GLOBAL_FLAGS"\n')
    107 else:
    108 # need to disable ALBERTA with python for now due to linker error
    • Why does Alberta introduce linker errors? Can I inspect this somewhere? Do you get the same linker errors with the new FindAlberta package, see core/dune-grid!484 (merged) ?

    • I haven't really looked into this. There linker comes up with an 'undefined symbol: funcName'. It's an issue in dune-py - perhaps some flags aren't correctly set there - but trying to figure out which symbol funcName could be, was more then I cared to look into at the moment. I can try the branch you mentioned. It only appears with clang - gcc seems fine with everything I think.

    • changed this line in version 3 of the diff

    • I've switched the toolchain in the dune-grid branch and the CI fails with the symbol issue https://gitlab.dune-project.org/core/dune-grid/-/jobs/240394 I tried if using PIC or shared libs makes a difference but it doesn't. The linker command is https://gitlab.dune-project.org/core/dune-grid/-/jobs/240447#L4178 and then importing it fails.

    • It is difficult for me to debug this. But, at least I know that funcName is some global static variable that is filled with the name of each called function using some macro FUNCNAME(...). It is defined in the utility library libalberta_utilities.so. This library should be linked when using add_dune_alberta_flags. Do you call this manually, or do you use something like enable_all_packages? The latter should not work for alberta, since this library does not register dune package flags. The reason is that we need to know the dimworld in order to link the correct library. Maybe one could register the utility library only. The problem is that this is not accessible directly, since provided by pkg-config as dependency.

    • Thanks, that helped me a bit. So we are using 'enable_all_packages'. The test where it is failing in the CI is actually compiling a YaspGrid but is linking against /builds/core/dune-grid/build-cmake/lib/libdunealbertagrid*d.a and that see,s to be causing the problems. Setting add_dune_alberta_flags when compiling yaspgrid doesn't seem to make sense. Btw: the problem is only with clang, the gcc 9-17passes with Alberta turned on.

    • I now tried to reproduce this on my local machine and I it is working there (also clang-10-20 on Ubuntu 20 - so should be identical). So I don't know how to debug this further.

    • Actually, it not link against the libdunealbertagrid*d.a libraries. This should only be done if add_dune_alberta_flags is called. The problem is two-fold, I think: 1. libdunealbertagrid is created using dune_add_library. This adds the library to DUNE_MODULE_LIBRARIES that is appended to dune-grid_LIBRARIES in the corresponding dune-grid-config.cmake file. 2. Somehow, all these libraries are linked by default. I have not yet found out why. It could be an effect of the dune_enable_all_packages or of the way in dune dependencies are searched and included. You could check whether DUNE_LIBS or DUNE_DEFAULT_LIBS contains the dunealbertagrid libraries.

    • Another problem is the way the linker resolves symbols. Since funcName is actually not used, it should not be a problem. But somehow it is.

    • The overall problem stems from the complicated interplay and structure of the current cmake build system. Another argument for cleaning this up further.

    • Another problem is the way the linker resolves symbols. Since funcName is actually not used, it should not be a problem. But somehow it is. That's the issue I really don't understand and of course might explain why gcc behaves differently from clang. Why it is working locally for me with clang is a further mystery...

    • Please register or sign in to reply
  • Andreas Dedner added 1 commit

    added 1 commit

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    Compare with previous version

  • Andreas Dedner mentioned in merge request !1 (closed)

    mentioned in merge request !1 (closed)

  • mentioned in merge request core/dune-grid!484 (merged)

  • Andreas Dedner added 1 commit

    added 1 commit

    • d1e17435 - adapt to change in default flags for python bindings

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • b154e2ff - [testing] make CI pass by disabling a toolchain for which numpy download fails

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • c41c5606 - [testing] need DUNE_RUNNING_IN_CI flag

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • c859d67b - do not force the 'overhaul' branch

    Compare with previous version

  • Andreas Dedner added 5 commits

    added 5 commits

    • 7a811e2b - use the different images/toolchains to test different configurations of...
    • 2bdaed45 - add gridtype selector to cmake flags to improve dune-fem testing
    • 38bc18ad - [bugfix][alugrid] Allow debian:10 to fail.
    • 47a47973 - adapt to change in default flags for python bindings
    • 3347648d - do not force the 'overhaul' branch

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 32f7e0ea - enable same toolchains as in master

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 721c05f2 - need to use shared libs with clang for python bindings

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 195cb0fe - try if shared libs can be avoided

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 5999b1d2 - turn on shared libs for all runs

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 25b5c6a2 - turn CMAKE_INSTALL_RPATH_USE_LINK_PATH on

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    Compare with previous version

  • mentioned in merge request core/dune-common!960 (merged)

  • Andreas Dedner added 1 commit

    added 1 commit

    • 6f905532 - if dune-alugrid fails so does dune-fem so allow both to fail for now

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 826f25a4 - if dune-alugrid fails so does dune-fem so allow both to fail for now

    Compare with previous version

  • Andreas Dedner added 3 commits

    added 3 commits

    • 52b44087 - add gridtype selector to cmake flags to improve dune-fem testing
    • 9d09ac72 - adapt to change in default flags for python bindings
    • 19c4d741 - if dune-alugrid fails so does dune-fem so allow both to fail for now

    Compare with previous version

  • Andreas Dedner enabled an automatic merge when the pipeline for 19c4d741 succeeds

    enabled an automatic merge when the pipeline for 19c4d741 succeeds

  • Andreas Dedner mentioned in commit 1f3fc1b8

    mentioned in commit 1f3fc1b8

  • Please register or sign in to reply
    Loading