diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 847910d..f413509 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,34 +43,34 @@ jobs: - name: Check Conda Config run: | - source ~/conda/etc/profile.d/conda.sh - conda activate base - conda info - conda list - conda config --show-sources + source ~/conda/etc/profile.d/conda.sh && + conda activate base && + conda info && + conda list && + conda config --show-sources && conda config --show - name: Install run: | - source ~/conda/etc/profile.d/conda.sh - conda activate base - pyver=${{ matrix.python }} - sed -i -e "s/python=3\.10/python=${pyver}/" ./config/default/packages_conda.txt - cat ./config/default/packages_conda.txt + source ~/conda/etc/profile.d/conda.sh && + conda activate base && + pyver=${{ matrix.python }} && + sed -i -e "s/python=3\.*/python=${pyver}/" ./config/default/packages_conda.txt && + cat ./config/default/packages_conda.txt && ./soconda.sh -e soconda -v CI - name: Run Tests run: | - source ~/conda/etc/profile.d/conda.sh - conda activate "soconda_CI" - export OMP_NUM_THREADS=2 - export MPI_DISABLE=1 - export CI=1 - python3 -c 'import scipy; import toast' - python3 -c 'import toast.tests; toast.tests.run()' - git clone --depth=1 --single-branch --branch=master https://github.com/simonsobs/sotodlib.git - pushd sotodlib - python3 -m unittest - popd - unset MPI_DISABLE + source ~/conda/etc/profile.d/conda.sh && + conda activate "soconda_CI" && + export OMP_NUM_THREADS=2 && + export MPI_DISABLE=1 && + export CI=1 && + python3 -c 'import scipy; import toast; print(toast.__version__)' && + python3 -c 'import toast.tests; toast.tests.run()' && + git clone --depth=1 --single-branch --branch=master https://github.com/simonsobs/sotodlib.git && + pushd sotodlib && + python3 -m unittest && + popd && + unset MPI_DISABLE && unset OMP_NUM_THREADS diff --git a/deploy/install_nersc_tag.sh b/deploy/install_nersc_tag.sh index 124664a..39f706a 100755 --- a/deploy/install_nersc_tag.sh +++ b/deploy/install_nersc_tag.sh @@ -39,13 +39,13 @@ fi # always created. # Update the persistent git checkout and find the most recent tag -pushd "${git_dir}" 2>&1 >/dev/null +pushd "${git_dir}" >/dev/null 2>&1 git checkout main git fetch --tags git rebase origin/main git remote prune origin latest=$(git describe --tags $(git rev-list --tags --max-count=1)) -popd 2>&1 >/dev/null +popd >/dev/null 2>&1 # See if we already have this tag installed found=no @@ -74,7 +74,7 @@ today=$(date +%Y%m%d) log_file="${log_dir}/check_tags_${host}_${now}" # Create the log file -echo "Starting at ${now}" 2>&1 > "${log_file}" +echo "Starting at ${now}" > "${log_file}" # Get the module file version that will be installed mod_ver="${today}_${latest}" @@ -83,9 +83,9 @@ send_log=no annoy="${git_dir}/.already_annoyed" remain=$(get_common_free_gb) if (( remain < typical )); then - echo "Only ${remain} GB are available in /global/common/software/sobs" 2>&1 >> "${log_file}" - echo "Installing latest tag requires approximately ${typical} GB" 2>&1 >> "${log_file}" - echo "SKIPPING until disk space is cleared." 2>&1 >> "${log_file}" + echo "Only ${remain} GB are available in /global/common/software/sobs" >> "${log_file}" + echo "Installing latest tag requires approximately ${typical} GB" >> "${log_file}" + echo "SKIPPING until disk space is cleared." >> "${log_file}" if [ ! -e "${annoy}" ]; then send_log=yes touch "${annoy}" @@ -93,16 +93,16 @@ if (( remain < typical )); then else send_log=yes rm -f "${git_dir}/.already_annoyed" - echo "Latest tag '${latest}' not found, installing..." 2>&1 >> "${log_file}" - echo "Note: ${remain} GB are available in /global/common/software/sobs" 2>&1 >> "${log_file}" - echo "Installing latest tag requires approximately ${typical} GB" 2>&1 >> "${log_file}" + echo "Latest tag '${latest}' not found, installing..." >> "${log_file}" + echo "Note: ${remain} GB are available in /global/common/software/sobs" >> "${log_file}" + echo "Installing latest tag requires approximately ${typical} GB" >> "${log_file}" install_log=$(eval "${git_dir}/deploy/install_${host}.sh" "${latest}") if [ -f "${install_log}" ]; then # There were no errors, and the log file was returned - cat "${install_log}" 2>&1 >> "${log_file}" + cat "${install_log}" >> "${log_file}" else # The script must have printed out some errors - echo "${install_log}" 2>&1 >> "${log_file}" + echo "${install_log}" >> "${log_file}" fi fi @@ -114,7 +114,7 @@ if [ -e "${mod_latest}" ]; then rm -f "${mod_dir}/stable.lua" \ && ln -s "${mod_latest}" "${mod_dir}/stable.lua" else - echo "ERROR: module file ${mod_latest} was not created- leaving stable symlink" 2>&1 >> "${log_file}" + echo "ERROR: module file ${mod_latest} was not created- leaving stable symlink" >> "${log_file}" fi echo "Finished installing tag '${latest}' on host ${NERSC_HOST} at $(date +%Y%m%d-%H%M%S)" >> "${log_file}" @@ -124,7 +124,7 @@ if [ "${send_log}" = "yes" ]; then slack_web_hook=${SLACKBOT_SOCONDA} if [ "x${slack_web_hook}" = "x" ]; then - echo "Environment variable SLACKBOT_SOCONDA not set- skipping notifications" 2>&1 >> "${log_file}" + echo "Environment variable SLACKBOT_SOCONDA not set- skipping notifications" >> "${log_file}" else # Create the JSON payload. slackjson="${log_file}_slack.json" @@ -132,6 +132,6 @@ if [ "${send_log}" = "yes" ]; then echo -e "{\"text\":\"soconda install tag (log at \`${log_file}\`):\n\`\`\`$(head -n ${headtail} ${log_file} | sed -e "s|'|\\\'|g")\`\`\`\n(Snip)\n\`\`\`$(tail -n ${headtail} ${log_file} | sed -e "s|'|\\\'|g")\`\`\`\"}" > "${slackjson}" # Post it. slackerror=$(curl -X POST -H 'Content-type: application/json' --data "$(cat ${slackjson})" ${slack_web_hook}) - echo "Slack API post ${slackerror}" 2>&1 >> "${log_file}" + echo "Slack API post ${slackerror}" >> "${log_file}" fi fi diff --git a/deploy/install_perlmutter.sh b/deploy/install_perlmutter.sh index 206690b..d4b56dd 100755 --- a/deploy/install_perlmutter.sh +++ b/deploy/install_perlmutter.sh @@ -49,19 +49,19 @@ if [ -d "${clone_dir}" ]; then rm -rf "${clone_dir}" fi -git clone --depth=1 --single-branch --branch=${version} https://github.com/simonsobs/soconda.git "${clone_dir}" 2>&1 >> "${logfile}" +git clone --depth=1 --single-branch --branch=${version} https://github.com/simonsobs/soconda.git "${clone_dir}" >> "${logfile}" 2>&1 # Activate the base environment and keep it up to date. source "${base_dir}/etc/profile.d/conda.sh" -conda activate base 2>&1 >> "${logfile}" -conda update --yes -n base conda conda-build 2>&1 >> "${logfile}" -conda update --yes --all -n base 2>&1 >> "${logfile}" +conda activate base >> "${logfile}" 2>&1 +conda update --yes -n base conda conda-build >> "${logfile}" 2>&1 +conda update --yes --all -n base >> "${logfile}" 2>&1 # Build things from the temp directory -pushd "${clone_dir}" 2>&1 >/dev/null +pushd "${clone_dir}" >/dev/null 2>&1 mkdir -p "build" -pushd "build" 2>&1 >/dev/null +pushd "build" >/dev/null 2>&1 export MPICC="cc" @@ -69,14 +69,14 @@ eval "${clone_dir}/soconda.sh" \ -c "perlmutter" \ -e "${env_name}" \ -v "${env_version}" \ - -m "${module_dir}" 2>&1 >> "${logfile}" + -m "${module_dir}" >> "${logfile}" 2>&1 -popd 2>&1 >/dev/null -popd 2>&1 >/dev/null +popd >/dev/null 2>&1 +popd >/dev/null 2>&1 # Update permissions -chmod -R g-w,g+rX "${env_name}_${env_version}" 2>&1 >> "${logfile}" -chmod -R g-w,g+rX "${module_dir}/soconda" 2>&1 >> "${logfile}" +chmod -R g-w,g+rX "${env_name}_${env_version}" >> "${logfile}" 2>&1 +chmod -R g-w,g+rX "${module_dir}/soconda" >> "${logfile}" 2>&1 # Return name of log file echo "${logfile}" diff --git a/pkgs/libactpol/meta.yaml b/pkgs/libactpol/meta.yaml index b27974c..151e104 100644 --- a/pkgs/libactpol/meta.yaml +++ b/pkgs/libactpol/meta.yaml @@ -20,12 +20,12 @@ build: requirements: build: - {{ compiler('c') }} - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - automake - autoconf @@ -42,11 +42,12 @@ requirements: # https://github.com/conda-forge/perl-feedstock/issues/56 - libxcrypt1 # [linux] run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} - {{ pin_compatible('libactpol_deps') }} - {{ pin_compatible('cfitsio') }} - {{ pin_compatible('wcslib') }} diff --git a/pkgs/libactpol_deps/meta.yaml b/pkgs/libactpol_deps/meta.yaml index 423474b..b2bf5fb 100644 --- a/pkgs/libactpol_deps/meta.yaml +++ b/pkgs/libactpol_deps/meta.yaml @@ -21,12 +21,12 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - automake - autoconf @@ -35,11 +35,12 @@ requirements: - make - zziplib run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} - {{ pin_compatible('zziplib') }} test: diff --git a/pkgs/moby2/meta.yaml b/pkgs/moby2/meta.yaml index b900ced..3c6b552 100644 --- a/pkgs/moby2/meta.yaml +++ b/pkgs/moby2/meta.yaml @@ -21,12 +21,12 @@ build: requirements: build: - {{ compiler('c') }} - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python - fftw @@ -34,22 +34,24 @@ requirements: - libactpol - future - numpy=1.26.* + - scipy # Although not a dependency, we put numba here to force # building with a numba-compatible numpy version - numba run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} + - {{ pin_compatible('scipy') }} + - {{ pin_compatible('numpy') }} - {{ pin_compatible('fftw') }} - {{ pin_compatible('gsl') }} - {{ pin_compatible('libactpol') }} - - {{ pin_compatible('numpy') }} - future - - scipy - matplotlib - astropy - ephem diff --git a/pkgs/pixell/meta.yaml b/pkgs/pixell/meta.yaml index a5dd6f5..96a4491 100644 --- a/pkgs/pixell/meta.yaml +++ b/pkgs/pixell/meta.yaml @@ -20,12 +20,12 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('fortran') }} - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - automake - autoconf @@ -46,14 +46,15 @@ requirements: # https://github.com/conda-forge/perl-feedstock/issues/56 - libxcrypt1 # [linux] run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} + - {{ pin_compatible('scipy') }} - {{ pin_compatible('numpy') }} - - scipy - astropy - healpy - matplotlib diff --git a/pkgs/qpoint/meta.yaml b/pkgs/qpoint/meta.yaml index 12c77f6..23d6097 100644 --- a/pkgs/qpoint/meta.yaml +++ b/pkgs/qpoint/meta.yaml @@ -20,12 +20,17 @@ build: requirements: build: - {{ compiler('c') }} - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm + - openblas * openmp_* + - liblapack * *openblas - python - setuptools - numpy=1.26.* + - scipy # Although not a dependency, we put numba here to force # building with a numba-compatible numpy version - numba @@ -33,7 +38,14 @@ requirements: # IERS data and store it in the package - astropy run: + - llvm-openmp + - _openmp_mutex * *_llvm + - openblas * openmp_* + - liblapack * *openblas - python + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} + - {{ pin_compatible('scipy') }} - {{ pin_compatible('numpy') }} test: diff --git a/pkgs/so3g/meta.yaml b/pkgs/so3g/meta.yaml index b159de9..1c486a3 100644 --- a/pkgs/so3g/meta.yaml +++ b/pkgs/so3g/meta.yaml @@ -27,12 +27,12 @@ requirements: - {{ compiler('cxx') }} - cmake - make # [unix] - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python - numpy=1.26.* @@ -46,12 +46,14 @@ requirements: # building with a numba-compatible numpy version - numba run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} + - {{ pin_compatible('scipy') }} - {{ pin_compatible('numpy') }} - {{ pin_compatible('libboost') }} - {{ pin_compatible('libboost-python') }} @@ -59,7 +61,6 @@ requirements: - {{ pin_compatible('qpoint') }} - astropy - matplotlib - - scipy - ephem - pytz - pyaml diff --git a/pkgs/toast/meta.yaml b/pkgs/toast/meta.yaml index 46b192b..e50f553 100644 --- a/pkgs/toast/meta.yaml +++ b/pkgs/toast/meta.yaml @@ -25,34 +25,36 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - cmake - - make # [unix] - - llvm-openmp # [osx or linux] + - make + - llvm-openmp + - _openmp_mutex * *_llvm host: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python - numpy=1.26.* + - scipy - fftw - suitesparse - libaatm - libflac run: - - llvm-openmp # [osx or linux] + - llvm-openmp + - _openmp_mutex * *_llvm - openblas * openmp_* - - libopenblas * openmp_* - - libblas * *openblas - liblapack * *openblas - python + - {{ pin_compatible('openblas') }} + - {{ pin_compatible('liblapack') }} + - {{ pin_compatible('scipy') }} - {{ pin_compatible('numpy') }} - {{ pin_compatible('fftw') }} - {{ pin_compatible('suitesparse') }} - {{ pin_compatible('libaatm') }} - {{ pin_compatible('libflac') }} - ruamel.yaml - - scipy - matplotlib - astropy - healpy diff --git a/soconda.sh b/soconda.sh index 8e9a224..b674728 100755 --- a/soconda.sh +++ b/soconda.sh @@ -170,9 +170,19 @@ if [ -z "${env_check}" ]; then echo "Activating environment \"${fullenv}\"" conda_exec activate "${fullenv}" - # Create condarc for this environment + # Create condarc for this environment. Note: The conda build + # tools are installed in the base environment and so the + # "--use-local" option will not let us find the built packages + # we will store inside this env. Because of this, we create a + # package directory in our environment and add it to the + # condarc. + mkdir -p "${CONDA_PREFIX}/conda-bld" + mkdir -p "${CONDA_PREFIX}/conda-bld/temp_build" + conda_exec index "${CONDA_PREFIX}/conda-bld" + echo "# condarc for soconda" > "${CONDA_PREFIX}/.condarc" echo "channels:" >> "${CONDA_PREFIX}/.condarc" + echo " - file://${CONDA_PREFIX}/conda-bld" >> "${CONDA_PREFIX}/.condarc" echo " - conda-forge" >> "${CONDA_PREFIX}/.condarc" echo " - nodefaults" >> "${CONDA_PREFIX}/.condarc" echo "changeps1: true" >> "${CONDA_PREFIX}/.condarc" @@ -195,12 +205,10 @@ conda_exec env list # Install conda packages. echo -e "\n\n" echo "Installing conda packages..." | tee "log_conda" -conda_exec install --yes --file "${scriptdir}/config/common.txt" \ - 2>&1 | tee -a "log_conda" -conda_exec install --yes --file "${confdir}/packages_conda.txt" \ +conda_exec install --yes \ + --file "${scriptdir}/config/common.txt" \ + --file "${confdir}/packages_conda.txt" \ 2>&1 | tee -a "log_conda" -# The "cc" symlink from the compilers package shadows Cray's MPI C compiler... -rm -f "${CONDA_PREFIX}/bin/cc" conda_exec deactivate conda_exec activate "${fullenv}" @@ -239,17 +247,19 @@ while IFS='' read -r line || [[ -n "${line}" ]]; do pkgrecipe="${scriptdir}/pkgs/${pkgname}" echo -e "\n\n" echo "Building local package '${pkgname}'" 2>&1 | tee "log_${pkgname}" - conda build ${pkgrecipe} 2>&1 | tee -a "log_${pkgname}" + conda build --croot "${CONDA_PREFIX}/conda-bld/temp_build" \ + --output-folder "${CONDA_PREFIX}/conda-bld" \ + ${pkgrecipe} 2>&1 | tee -a "log_${pkgname}" echo "Installing local package '${pkgname}'" 2>&1 | tee -a "log_${pkgname}" - conda install --yes --use-local ${pkgname} 2>&1 | tee -a "log_${pkgname}" + conda install --yes ${pkgname} 2>&1 | tee -a "log_${pkgname}" fi done < "${confdir}/packages_local.txt" echo -e "\n\n" echo "Cleaning up build products" -conda build purge +rm -rf "${CONDA_PREFIX}/conda-bld/temp_build" -# Remove buid directory +# Remove build directory rm -rf "${conda_tmp}" &> /dev/null # Remove /tmp/pixell-* test files create by pixell/setup.py