Skip to content

Commit

Permalink
Merge pull request #31 from simonsobs/omp_debug
Browse files Browse the repository at this point in the history
Fix OpenMP dynamic linking across the environment
  • Loading branch information
tskisner authored Apr 4, 2024
2 parents da11241 + c345236 commit 59264ce
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 85 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ jobs:
export OMP_NUM_THREADS=2 &&
export MPI_DISABLE=1 &&
export CI=1 &&
python3 -c 'import scipy; import toast' &&
python3 -c 'import so3g; from spt3g import core' &&
python3 -c 'from sotodlib import core' &&
python3 -c 'import toast.tests; toast.tests.run()' &&
git clone --depth=1 --single-branch --branch=master https://github.com/simonsobs/sotodlib.git &&
pushd sotodlib &&
Expand Down
4 changes: 0 additions & 4 deletions config/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ packaging
#
# Require the OpenBLAS + OpenMP flavor of linear algebra packages
#
openblas=*=openmp_*
libopenblas=*=openmp_*
libblas=*=*openblas
libcblas=*=*openblas
liblapack=*=*openblas
liblapacke=*=*openblas
#
# Install requirements of our local and pip packages
#
Expand Down
2 changes: 2 additions & 0 deletions pkgs/libactpol/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ CFLAGS="-O3 -g -fPIC" \

make
make install
rm -f "${PREFIX}/lib/libactpol_deps*.la"
rm -f "${PREFIX}/lib/libarcher.so"
20 changes: 9 additions & 11 deletions pkgs/libactpol/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ source:
build:
number: {{ build }}
skip: true # [win]
run_exports:
- libactpol

requirements:
build:
Expand All @@ -27,23 +25,23 @@ requirements:
- m4
- libtool
host:
- llvm-openmp
- _openmp_mutex * *_llvm
- libopenblas * openmp_*
- openblas * openmp_*
# This constraint is to force compatibility with the healpy package.
# remove once healpy is building with cfitsio-4.4.x.
- cfitsio <4.4.0
- llvm-openmp # [osx]
- libgomp # [linux]
- libopenblas * *openmp*
- libblas * *openblas
- cfitsio
- wcslib
- libactpol_deps
# Remove until this perl bug is fixed
# https://github.com/conda-forge/perl-feedstock/issues/56
- libxcrypt1 # [linux]
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("cfitsio") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- {{ pin_compatible("libactpol_deps") }}
- {{ pin_compatible("wcslib") }}

Expand Down
1 change: 1 addition & 0 deletions pkgs/libactpol_deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ CXXFLAGS="-O3 -g -fPIC" \
./configure --prefix="${PREFIX}" --with-zzip
make
make install
rm -f "${PREFIX}/lib/libactpol_deps*.la"
popd
7 changes: 2 additions & 5 deletions pkgs/libactpol_deps/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ source:
build:
number: {{ build }}
skip: true # [win]
run_exports:
- libactpol_deps

requirements:
build:
Expand All @@ -30,9 +28,8 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- zziplib
run:

Expand Down
12 changes: 0 additions & 12 deletions pkgs/moby2/dep_names.patch

This file was deleted.

16 changes: 7 additions & 9 deletions pkgs/moby2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source:
url: https://github.com/ACTCollaboration/moby2/archive/{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- dep_names.patch
- np_bool.patch

build:
Expand All @@ -25,9 +24,8 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- python
- fftw
- gsl
Expand All @@ -40,16 +38,16 @@ requirements:
- numba
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("scipy") }}
- {{ pin_compatible("fftw") }}
- {{ pin_compatible("liblapack") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- {{ pin_compatible("gsl") }}
- {{ pin_compatible("libactpol") }}
- python
- numpy
- scipy
- future
- matplotlib
- astropy
Expand Down
17 changes: 8 additions & 9 deletions pkgs/pixell/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "0.23.8" %}
{% set sha256 = "1f9f89193550892e8e90b95d7fccfaf57d47ff5e99b45854e95231eb5a919a4f" %}
{% set sha256 = "b50dbc38b26543a36e8ab0f62876fcd25d573c2b78ea58e9e16b51f61ae50107" %}

{% set build = 0 %}

Expand Down Expand Up @@ -29,9 +29,8 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- python
- cython
- numpy >=1.26
Expand All @@ -48,13 +47,13 @@ requirements:
- libxcrypt1 # [linux]
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("liblapack") }}
- {{ pin_compatible("scipy") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- python
- numpy
- scipy
- astropy
- healpy
- matplotlib
Expand Down
15 changes: 7 additions & 8 deletions pkgs/qpoint/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- python
- setuptools
- numpy >=1.26
Expand All @@ -39,13 +38,13 @@ requirements:
- astropy
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("liblapack") }}
- {{ pin_compatible("scipy") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- python
- numpy
- scipy
- astropy

test:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/so3g/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e
set -x

CFLAGS="-O3 -g -fPIC" \
CXXFLAGS='-O3 -g -fPIC -std=c++14' \
CFLAGS="-Wno-error -O3 -g -fPIC -I${PREFIX}/include" \
CXXFLAGS="-Wno-error -O3 -g -fPIC -std=c++14 -I${PREFIX}/include" \
BOOST_ROOT="${PREFIX}" \
FLAC_ROOT="${PREFIX}" \
python -m pip install -vvv --ignore-installed --no-deps --prefix "${PREFIX}" .
24 changes: 11 additions & 13 deletions pkgs/so3g/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "0.1.12" %}
{% set sha256 = "7028a87fc6b4b85b1c18bc7cfbb24da90506e84c7a13186fa4d32b93855d6b41" %}
{% set version = "0.1.13" %}
{% set sha256 = "468b1a813fa1baf1134f7041898380b0552fe3a02f0fdbe450ac1e452bbae349" %}

{% set build = 0 %}

Expand All @@ -13,13 +13,11 @@ source:
patches:
- setup_requires.patch
- cxx_werror.patch
- parallel.patch

build:
number: {{ build }}
skip: true # [win]
script_env:
- CFLAGS=-Wno-error -O3 -g -fPIC
- CXXFLAGS=-Wno-error -O3 -g -fPIC -std=c++14

requirements:
build:
Expand All @@ -31,9 +29,9 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- openblas * *openmp*
- python
- numpy >=1.26
- scipy
Expand All @@ -47,16 +45,16 @@ requirements:
- numba
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("liblapack") }}
- {{ pin_compatible("scipy") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- {{ pin_compatible("libboost-python") }}
- {{ pin_compatible("libboost") }}
- {{ pin_compatible("libflac") }}
- python
- numpy
- scipy
- astropy
- qpoint
- matplotlib
Expand Down
17 changes: 17 additions & 0 deletions pkgs/so3g/parallel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff -urN so3g-0.1.13_orig/setup.py so3g-0.1.13/setup.py
--- so3g-0.1.13_orig/setup.py 2024-03-29 08:40:04.000000000 -0700
+++ so3g-0.1.13/setup.py 2024-04-02 22:41:13.998376523 -0700
@@ -152,7 +152,12 @@
sp.check_call(["cmake", cmake_list_dir] + cmake_args, cwd=build_dir, env=env)

print("-" * 10, "Building {}".format(pkg), "-" * 40)
- cmake_cmd = ["cmake", "--build", "."] + build_args + ["--", "-j2"]
+ if "CPU_COUNT" in os.environ:
+ # Running in conda-build
+ parallel_args = ["--parallel", os.environ["CPU_COUNT"]]
+ else:
+ parallel_args = ["--parallel", "2"]
+ cmake_cmd = ["cmake", "--build", "."] + build_args + parallel_args
sp.check_call(cmake_cmd, cwd=build_dir)
cmake_cmd = ["cmake", "--install", "."] + build_args
sp.check_call(cmake_cmd, cwd=build_dir)
21 changes: 9 additions & 12 deletions pkgs/toast/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ package:
source:
url: https://github.com/hpc4cmb/toast/archive/refs/tags/{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- openmp_linking.patch
#patches:
# - openmp_linking.patch
# - debug_lapack.patch

build:
Expand All @@ -31,10 +31,8 @@ requirements:
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- openblas * openmp_*
- libopenblas * openmp_*
- libblas
- liblapack
- libopenblas * *openmp*
- libblas * *openblas
- python
- numpy >=1.26
- scipy
Expand All @@ -44,18 +42,17 @@ requirements:
- libflac
run:
- llvm-openmp # [osx]
- openblas * openmp_*
- libopenblas * openmp_*
- libopenblas * *openmp*
- libblas * *openblas
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("scipy") }}
- {{ pin_compatible("fftw") }}
- {{ pin_compatible("libopenblas") }}
- {{ pin_compatible("libblas") }}
- {{ pin_compatible("liblapack") }}
- {{ pin_compatible("suitesparse") }}
- {{ pin_compatible("libaatm") }}
- {{ pin_compatible("libflac") }}
- python
- numpy
- scipy
- ruamel.yaml
- matplotlib
- astropy
Expand All @@ -65,7 +62,7 @@ requirements:
- tomlkit
- traitlets>=5.0
- psutil
- pshmem>=1.0.4
- pshmem>=1.1.0

test:
imports:
Expand Down

0 comments on commit 59264ce

Please sign in to comment.