Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9504362
further cleaning
sshiraiwa Jun 2, 2025
3bc0fd0
added numpy to build requirement. fixed licence-files in pyproject.to…
sshiraiwa Jun 3, 2025
8b50344
removed 3.8 from test, added 3.13
sshiraiwa Jun 3, 2025
637ebd2
removed added apt-get install chrpath
sshiraiwa Jun 3, 2025
a6c6fb8
fixed typo, added pip in build requirement
sshiraiwa Jun 3, 2025
6956edd
update numba_coefficient.i for Python 3.13
sshiraiwa Jun 3, 2025
6873201
still cleaning... parallel seems to need no-isolation
sshiraiwa Jun 3, 2025
436cc75
rearranged further to build with-parallel
sshiraiwa Jun 4, 2025
1c4adfb
updating workflow to explicitly install build dependencies, since we …
sshiraiwa Jun 4, 2025
3f50278
updating workflow to explicitly install build dependencies, since we …
sshiraiwa Jun 4, 2025
ba60d7b
updating workflow to explicitly install build dependencies, since we …
sshiraiwa Jun 4, 2025
6214926
added gslib url
sshiraiwa Jun 4, 2025
776d7e4
fixing parallel workflow build
sshiraiwa Jun 4, 2025
1025fea
fixing parallel build and libceed build
sshiraiwa Jun 4, 2025
052248f
fixing parallel build and libceed build
sshiraiwa Jun 4, 2025
2b4c972
fixing parallel build and libceed build
sshiraiwa Jun 4, 2025
c73f9e1
introduced dynamic adjustment of build-requirement. no need to use --…
sshiraiwa Jun 4, 2025
b5cdb2e
fix conditions to trigger mpi4py in the build environment
sshiraiwa Jun 4, 2025
ab9f91b
testing MacOS...
sshiraiwa Jun 4, 2025
cd6104e
(WIP)
sshiraiwa Jun 4, 2025
b4aabb4
(WIP)testing MacOS...
sshiraiwa Jun 4, 2025
02ed1ea
(WIP)testing MacOS...
sshiraiwa Jun 4, 2025
9d2915d
fixing rpath
sshiraiwa Jun 4, 2025
88efbf6
(WIP)
sshiraiwa Jun 4, 2025
f2a53cd
Merge branch 'improve-install3' of github.com:mfem/PyMFEM into improv…
sshiraiwa Jun 4, 2025
d985bc9
(WIP)...
sshiraiwa Jun 4, 2025
647c12c
(WIP)...
sshiraiwa Jun 4, 2025
bd8fb48
(WIP) checkign mac parallel build
sshiraiwa Jun 4, 2025
3d17c16
(WIP) checkign mac parallel build
sshiraiwa Jun 4, 2025
7268c98
(WIP) checkign mac parallel build
sshiraiwa Jun 4, 2025
1538a46
(WIP) checkign mac parallel build
sshiraiwa Jun 4, 2025
38c31c0
(WIP)...distutils problem???
sshiraiwa Jun 4, 2025
a2f31ef
distutils not found...
sshiraiwa Jun 4, 2025
2b0c91f
distutils not found...
sshiraiwa Jun 4, 2025
2f5b678
distutils not found...
sshiraiwa Jun 5, 2025
806c4c0
putting back test changes
sshiraiwa Jun 5, 2025
e767502
cleaning routines, which were not used
sshiraiwa Jun 5, 2025
565d58a
minor edit
sshiraiwa Jun 5, 2025
3e54d54
removed chrpathdir, which is not used, in the end
sshiraiwa Jun 5, 2025
0049e0e
removed setuputils.py, delete chrpath from github workflow files
sshiraiwa Jun 5, 2025
5f7dfac
changes to recover a backword compatibility... python setup.py instal…
sshiraiwa Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .github/workflows/build-and-test-callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
CUDA_HOME: '/usr/local/cuda'
# These are all passed to setup.py as one concatenated string
build-flags: >-
${{ inputs.parallel && '-C"--build-option=--with-parallel"' || '' }}
${{ inputs.cuda && '-C"--build-option=--with-cuda"' || '' }}
${{ inputs.libceed && '-C"--build-option=--with-libceed"' || '' }}
${{ inputs.gslib && '-C"--build-option=--with-gslib"' || '' }}
${{ (!(inputs.mfem-branch == 'default') && format('-C"--build-option=--mfem-branch=''{0}''"', inputs.mfem-branch)) || '' }}
${{ inputs.parallel && '-C"with-parallel=Yes"' || '' }}
${{ inputs.cuda && '-C"with-cuda=Yes"' || '' }}
${{ inputs.libceed && '-C"with-libceed=Yes"' || '' }}
${{ inputs.gslib && '-C"with-gslib=Yes"' || '' }}
${{ (!(inputs.mfem-branch == 'default') && format('-C"mfem-branch=''{0}''"', inputs.mfem-branch)) || '' }}

# -------------------------------------------------------------------------------------------------
# Begin workflow
Expand All @@ -88,10 +88,17 @@ jobs:
# -------------------------------------------------------------------------------------------------
# Download/install dependencies
# -------------------------------------------------------------------------------------------------
# - name: Install core dependencies via requirements.txt
# run: |
# pip install setuptools
# pip install -r requirements.txt --verbose
- name: Install core dependencies via requirements.txt
run: |
pip install -U setuptools>=79.0.1
pip install -U numpy>=2.0.0
pip install -U cmake>=4.0.0
pip install -U swig>=4.3

#- name: Install chrpath on ubuntu
# if: inputs.os == 'ubuntu-latest'
# run: |
# sudo apt-get install chrpath

- name: Install MPI
if: inputs.parallel
Expand Down Expand Up @@ -150,9 +157,13 @@ jobs:
# if: inputs.phases
# run: python setup.py install --skip-ext --skip-swig --vv ${{ env.build-flags }}

#- name: Build all (steps 1-3)
# if: inputs.phases == false
# run: pip install -e . -C"--build-option=--vv" ${{ env.build-flags }}

- name: Build all (steps 1-3)
if: inputs.phases == false
run: pip install -e . -C"--build-option=--vv" ${{ env.build-flags }}
run: pip install . ${{ env.build-flags }} --verbose

# -------------------------------------------------------------------------------------------------
# Run tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
mfem-branch: [master, default] # 'default' uses a specific commit hash defined in setup.py:repos_sha
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # 3.12 is not supported by scipy
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
parallel: [false]
name: test-linux | ${{ matrix.mfem-branch }} | ${{ matrix.python-version }} | ${{ matrix.parallel && 'parallel' || 'serial' }}
uses: ./.github/workflows/build-and-test-callable.yml
Expand All @@ -46,7 +46,7 @@ jobs:
fail-fast: false
matrix:
mfem-branch: [master, default] # 'default' uses a specific commit hash defined in setup.py:repos_sha
python-version: ['3.9', '3.10', '3.11', '3.12'] # 3.12 is not supported by scipy
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
parallel: [true]
name: test-linux | ${{ matrix.mfem-branch }} | ${{ matrix.python-version }} | ${{ matrix.parallel && 'parallel' || 'serial' }}
uses: ./.github/workflows/build-and-test-callable.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

CWD=$PWD
yum install -y zlib-devel
yum install -y chrpath
#yum install -y chrpath

mkdir dist

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testrelease_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

CWD=$PWD
yum install -y zlib-devel
yum install -y chrpath
#yum install -y chrpath

mkdir dist

Expand Down
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,16 @@ $ pip download mfem --no-binary mfem (expand tar.gz file and move to the downloa
or clone this repository
$ git clone https://github.com/mfem/PyMFEM.git

# Then, build it from local source
$ python -m pip install ./ --install-option="--with-parallel" --install-option="--mfem-branch=master"
or
$ python setup.py install --with-parallel # it download and build metis/hypre/mfem

# Verbose output
$ python setup.py install --verbose # SWIG output and CMAKE_VERBOSE_MAKEFILE is on
# Build it from local source with MPI
$ pip install ./ -C"with-parallel=Yes" --verbose

# Cleaning
$ python setup.py clean --all # clean external dependencies + wrapper code

# Choosing compiler
$ python setup.py install --with-parallel --CC=icc --CXX=icpc --MPICC=mpiicc --MPICXX=mpiicpc

# Run test
cd test
python test_examples.py -serial

# For other configurations, see docs/install.txt or help
$ python setup.py install --help

```

## Usage
Expand Down
1 change: 1 addition & 0 deletions _build_system/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
k
31 changes: 31 additions & 0 deletions _build_system/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from setuptools import build_meta as _orig
from setuptools.build_meta import *

import build_globals as bglb


def get_requires_for_build_wheel(config_settings=None):
ret = _orig.get_requires_for_build_wheel(config_settings)

need_mpi = False
if config_settings is not None:
for flag in ("with-parallel", ):
value = config_settings.pop(flag, "No")
if value.upper() in ("YES", "TRUE", "1"):
need_mpi = True
break

if need_mpi:
ret = ret + ['mpi4py']
return ret


def get_requires_for_build_sdist(config_settings=None):
return _orig.get_requires_for_build_sdist(config_settings)


def build_wheel(*args, **kwargs):
bglb.cfs = args[1]
if bglb.cfs is None:
bglb.cfs = {}
return _orig.build_wheel(*args, **kwargs)
Loading