forked from ContinuumIO/gulinalg
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from ev-br/master
Use 64-bit LAPACK
- Loading branch information
Showing
30 changed files
with
1,315 additions
and
3,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Linux pypi openblas64 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test_meson: | ||
name: build and run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
numpy-version: ["", "==1.26.4", "==1.24.4", "==1.22.4"] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build and test gulinalg | ||
shell: bash -l {0} | ||
run: | | ||
pip install numpy meson meson-python ninja scipy-openblas64 | ||
# pkg-config | ||
python -c'import scipy_openblas64 as sc; print(sc.get_pkg_config())' > openblas.pc | ||
export PKG_CONFIG_PATH=$PWD | ||
echo "\n OpenBLAS PKG-CONFIG FILE\n" | ||
cat openblas.pc | ||
pip install . -Csetup-args="-Dopenmp=gnu" -Csetup-args="-Dblas=scipy-openblas64" --no-build-isolation -v | ||
# test | ||
pip install numpy${{ matrix.numpy-version }} | ||
cd /tmp | ||
export OMP_NUM_THREADS=2 | ||
python -c'import numpy; print(f"{numpy.__version__ = }")' | ||
python -c'import gulinalg as g; g.test(verbosity=2)' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Linux conda MKL | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test_meson: | ||
name: build and run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
numpy-version: ["", "==1.26.4", "==1.24.4", "==1.22.4"] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
channel-priority: true | ||
activate-environment: gulinalg | ||
use-only-tar-bz2: false | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
|
||
- name: Update Conda Environment | ||
run: mamba env update -n gulinalg -f environment.yml | ||
|
||
- name: Build and test gulinalg | ||
shell: bash -l {0} | ||
run: | | ||
conda activate gulinalg | ||
pip install numpy meson meson-python ninja mkl mkl-devel | ||
mamba list | ||
# build | ||
pip install . --no-build-isolation -v -Csetup-args="-Dopenmp=gnu" -Csetup-args="-Dblas=mkl" | ||
# test | ||
pip install numpy${{ matrix.numpy-version }} | ||
cd /tmp | ||
python -c'import numpy; print(f"{numpy.__version__ = }")' | ||
OMP_NUM_THREADS=2 python -c'import gulinalg as g; g.test(verbosity=2)' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
*.dylib | ||
*.pyd | ||
*.pdb | ||
build/ | ||
build/ | ||
build-install |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Vendored from numpy verbatim, | ||
https://github.com/numpy/numpy/tree/main/numpy/_build_utils | ||
""" | ||
|
||
import sys | ||
import os | ||
import argparse | ||
import importlib.util | ||
|
||
|
||
def get_processor(): | ||
# Convoluted because we can't import from numpy.distutils | ||
# (numpy is not yet built) | ||
conv_template_path = os.path.join( | ||
os.path.dirname(__file__), | ||
'..', 'distutils', 'conv_template.py' | ||
) | ||
spec = importlib.util.spec_from_file_location( | ||
'conv_template', conv_template_path | ||
) | ||
mod = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(mod) | ||
return mod.process_file | ||
|
||
|
||
def process_and_write_file(fromfile, outfile): | ||
"""Process tempita templated file and write out the result. | ||
The template file is expected to end in `.src` | ||
(e.g., `.c.src` or `.h.src`). | ||
Processing `npy_somefile.c.src` generates `npy_somefile.c`. | ||
""" | ||
process_file = get_processor() | ||
content = process_file(fromfile) | ||
with open(outfile, 'w') as f: | ||
f.write(content) | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"infile", | ||
type=str, | ||
help="Path to the input file" | ||
) | ||
parser.add_argument( | ||
"-o", | ||
"--outfile", | ||
type=str, | ||
help="Path to the output file" | ||
) | ||
parser.add_argument( | ||
"-i", | ||
"--ignore", | ||
type=str, | ||
help="An ignored input - may be useful to add a " | ||
"dependency between custom targets", | ||
) | ||
args = parser.parse_args() | ||
|
||
if not args.infile.endswith('.src'): | ||
raise ValueError(f"Unexpected extension: {args.infile}") | ||
|
||
outfile_abs = os.path.join(os.getcwd(), args.outfile) | ||
process_and_write_file(args.infile, outfile_abs) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.