Skip to content
Snippets Groups Projects

Futurize for python2/3

Merged Adrien Crovato requested to merge adrien into master
All threads resolved!

Context

This merge request brings compatibility for python 3 while ensuring backwards compatibility with python 2.

Details

The future package has been used to futurize the code. Waves can now depend on python3-xxx instead of python-xxx packages.

If python 2 is to be used instead of python 3, proceed with the usual build and add -DUSE_PY3=OFF to the cmake command line. Note that the additional python-futurize package is required.

Test

Passed on ubuntu18.04 (python 2.7.15 and 3.6.9), debian (gaston, python 2.7), msys2 (python 2.7.16 and 3.8.1)

Edited by Adrien Crovato

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
    • Author Maintainer

      For the reference, I changed

      def next(...):

      to

      def my_next(...):

      in params/src/indices.py, and adapted the code consistently. I also removed the git symbols in mrstlnos/broken/beam_UQ_1.py, and commented the line in scripts/cppcheck.py (futurize did not like the > symbol).

  • Adrien Crovato
    Adrien Crovato @acrovato started a thread on commit d1ad8ba1
92 94 ENDIF()
93 95
94 96 # -- Search for Python
95 FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
96 FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
97 IF(USE_PY3)
98 SET(pyVersion 3.6)
99 ELSE()
100 SET(pyVersion 2.7)
101 ENDIF()
102 FIND_PACKAGE(PythonInterp ${pyVersion})
  • Adrien Crovato
    Adrien Crovato @acrovato started a thread on commit d1ad8ba1
  • 59 61
    60 62 # extract some results
    61 63 tests = CTests()
    62 tests.add(CTest('mean flux X', p.qM.x[0], -11.140748, 1e-4))
    63 tests.add(CTest('mean flux Y', p.qM.x[1], -11.102918, 1e-4))
    64 tests.add(CTest('mean flux X', p.qM.x[0], -12.6239, 1e-4))
  • Adrien Crovato resolved all threads

    resolved all threads

  • Adrien Crovato changed the description

    changed the description

  • Adrien Crovato added 1 commit

    added 1 commit

    • 173469c1 - Compatibility with python3 and vtk8

    Compare with previous version

  • Author Maintainer

    Using the latest version of MSYS2 with GCC 9.2 Intel TBB causes new warnings to fire:

    • TBB
      • atomic.h and mutex.h are deprecated
    • fwk/wTimes.cpp
      • dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 34 | user = Int64Time(*(reinterpret_cast<__int64 *>(&ftUser)));
    • Resolved by Adrien Crovato

      I had the same new TBB warnings (with many more) when I installed intel mkl/tbb 2020 in the container. As I though that my problems resulted from this new version of tbb/mkl, I downgraded tbb/mkl to 2019.2.

  • Boman Romain added 7 commits

    added 7 commits

    • d8879e2e - test python3 build
    • a5bb635b - ctest with python3
    • 9b757ec5 - fix image for py3 testing
    • 72cb4be6 - use full python3 image with trilinos
    • 67aa67bb - fix FindMPI4PY for python3
    • f36cd9ed - fix py3 compatibility
    • db9c48f7 - Merge remote-tracking branch 'origin/adrien' into ci-py3

    Compare with previous version

  • Adrien Crovato added 1 commit

    added 1 commit

    Compare with previous version

  • Adrien Crovato changed the description

    changed the description

  • Adrien Crovato resolved all threads

    resolved all threads

  • Adrien Crovato unmarked as a Work In Progress

    unmarked as a Work In Progress

  • ctest is OK on macOS/clang and Windows/MSVC (both using python 2)

  • Boman Romain approved this merge request

    approved this merge request

  • Liegeois Kim approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading