diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 0ba7007e99..c358b70141 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -62,17 +62,16 @@ jobs: python -m pip install 'rtree>=1.2' cd pip_venv/src git clone https://github.com/firedrakeproject/libsupermesh.git - cd libsupermesh - mkdir -p build - cd build + mkdir -p libsupermesh/build + cd libsupermesh/build cmake .. \ -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV \ - -DMPI_C_COMPILER=$MPICH_DIR/mpicc \ - -DMPI_CXX_COMPILER=$MPICH_DIR/mpicxx \ - -DMPI_Fortran_COMPILER=$MPICH_DIR/mpif90 \ - -DCMAKE_Fortran_COMPILER=$MPICH_DIR/mpif90 \ - -DMPIEXEC_EXECUTABLE=$MPICH_DIR/mpiexec + -DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \ + -DMPI_C_COMPILER="$MPICH_DIR/mpicc" \ + -DMPI_CXX_COMPILER="$MPICH_DIR/mpicxx" \ + -DMPI_Fortran_COMPILER="$MPICH_DIR/mpif90" \ + -DCMAKE_Fortran_COMPILER="$MPICH_DIR/mpif90" \ + -DMPIEXEC_EXECUTABLE="$MPICH_DIR/mpiexec" make make install diff --git a/.github/workflows/pyop2.yml b/.github/workflows/pyop2.yml index 4d0ce1dd64..7248f195b3 100644 --- a/.github/workflows/pyop2.yml +++ b/.github/workflows/pyop2.yml @@ -39,6 +39,10 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Prepare venv + run: | + python -m venv venv + - name: Clone PETSc uses: actions/checkout@v4 with: @@ -57,6 +61,24 @@ jobs: --with-fortran-bindings=0 make + - name: Install libsupermesh + run: | + source venv/bin/activate + python -m pip install 'rtree>=1.2' + git clone https://github.com/firedrakeproject/libsupermesh.git + mkdir -p libsupermesh/build + cd libsupermesh/build + cmake .. \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \ + -DMPI_C_COMPILER=mpicc \ + -DMPI_CXX_COMPILER=mpicxx \ + -DMPI_Fortran_COMPILER=mpif90 \ + -DCMAKE_Fortran_COMPILER=mpif90 \ + -DMPIEXEC_EXECUTABLE=mpiexec + make + make install + - name: Checkout PyOP2 uses: actions/checkout@v4 with: @@ -66,18 +88,22 @@ jobs: shell: bash working-directory: PyOP2 run: | + source venv/bin/activate python -m pip install -U pip python -m pip install -U pytest-timeout - name: Install PyOP2 shell: bash working-directory: PyOP2 - run: python -m pip install -v ".[test]" + run: | + source venv/bin/activate + python -m pip install -v ".[test]" - name: Run tests shell: bash working-directory: PyOP2 run: | + source venv/bin/activate # Running parallel test cases separately works around a bug in pytest-mpi pytest -k "not parallel" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2 mpiexec -n 3 pytest -k "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2 diff --git a/setup.py b/setup.py index 21ab9f28ab..2ab024be27 100644 --- a/setup.py +++ b/setup.py @@ -156,8 +156,8 @@ def __getitem__(self, key): # -lsupermesh \ # -Wl,-rpath,$ORIGIN/../../supermesh supermesh_ = ExternalDependency( - include_dirs=[sys.prefix], - library_dirs=[sys.prefix], + include_dirs=[f"{sys.prefix}/include"], + library_dirs=[f"{sys.prefix}/lib"], libraries=["supermesh"], )