From d2cc3790de026dc878d2d05d2fd50a38fe790c3e Mon Sep 17 00:00:00 2001 From: jjgoings <3915169+jjgoings@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:36:00 -0700 Subject: [PATCH 1/4] fix macos build --- .github/workflows/on_push.yml | 60 +++++++++++++++++++ .gitignore | 5 ++ .../integrator_util/spherical_harmonics.cxx | 5 ++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/on_push.yml diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml new file mode 100644 index 00000000..b7b1ecc3 --- /dev/null +++ b/.github/workflows/on_push.yml @@ -0,0 +1,60 @@ +name: Build and Test + +on: + push: + branches: [ master, main, develop ] + pull_request: + branches: [ master, main, develop ] + +jobs: + macos-m1: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v2 + with: + environment-name: gauxc + create-args: python=3.11 c-compiler cxx-compiler fortran-compiler mpich cmake hdf5 + channels: conda-forge + cache-environment: true + - name: Build + shell: micromamba-shell {0} + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUXC_ENABLE_MPI=ON -DGAUXC_ENABLE_TESTS=ON -DBUILD_TESTING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build -j3 + - name: Test + shell: micromamba-shell {0} + run: ctest --test-dir build --output-on-failure + + ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gnu-12, llvm-19] + steps: + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v2 + with: + environment-name: gauxc + create-args: python=3.11 c-compiler cxx-compiler fortran-compiler mpich cmake hdf5 + channels: conda-forge + cache-environment: true + - name: Install LLVM + if: matrix.compiler == 'llvm-19' + run: | + wget -q https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 19 + - name: Build + shell: micromamba-shell {0} + run: | + if [ "${{ matrix.compiler }}" = "llvm-19" ]; then + export CC=clang-19 CXX=clang++-19 + else + export CC=gcc-12 CXX=g++-12 + fi + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUXC_ENABLE_MPI=ON -DGAUXC_ENABLE_TESTS=ON -DBUILD_TESTING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build -j2 + - name: Test + shell: micromamba-shell {0} + run: ctest --test-dir build --output-on-failure diff --git a/.gitignore b/.gitignore index 65b35b0d..be531abc 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ src/xc_integrator/local_work_driver/host/obara_saika/generator/integral* src/xc_integrator/local_work_driver/host/obara_saika/generator/obara* src/xc_integrator/local_work_driver/host/obara_saika/generator/*.x *.swp + +# Build directories +build/ +_build/ +cmake-build-*/ diff --git a/src/xc_integrator/integrator_util/spherical_harmonics.cxx b/src/xc_integrator/integrator_util/spherical_harmonics.cxx index be7cf84a..bbc838e1 100644 --- a/src/xc_integrator/integrator_util/spherical_harmonics.cxx +++ b/src/xc_integrator/integrator_util/spherical_harmonics.cxx @@ -125,6 +125,10 @@ void scaled_ylm_new(const int lmax, const std::array x, const std::ar } // compute scaled spherical harmonics, with standard library functions +// DISABLED ON MACOS: std::sph_legendre not available in Apple's libc++ +// This function is unused. Added in commit 66784a4 (Feb 2025), never called. +// Production uses scaled_ylm_new() above. +#ifndef __APPLE__ std::vector scaled_ylm_std(int lmax, std::array x, std::array a, double r) { std::vector delta = {x[0] - a[0], x[1] - a[1], x[2] - a[2]}; @@ -155,6 +159,7 @@ std::vector scaled_ylm_std(int lmax, std::array x, std::array } return ylm; } +#endif // __APPLE__ void scaled_ylm_matrix(const int lmax, const double* points, const int32_t npts, const std::array center, const double radius, double* ylm_matrix) { int nharmonics = (lmax + 1) * (lmax + 1); From eb4c7a5ae96b5596f251b38ff789dbb2895cb068 Mon Sep 17 00:00:00 2001 From: jjgoings <3915169+jjgoings@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:44:42 -0700 Subject: [PATCH 2/4] fix workflow for blas --- .github/workflows/on_push.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index b7b1ecc3..848a3e05 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -14,8 +14,16 @@ jobs: - uses: mamba-org/setup-micromamba@v2 with: environment-name: gauxc - create-args: python=3.11 c-compiler cxx-compiler fortran-compiler mpich cmake hdf5 - channels: conda-forge + create-args: >- + python=3.11 + c-compiler + cxx-compiler + fortran-compiler + mpich + cmake + hdf5 + openblas + init-shell: bash cache-environment: true - name: Build shell: micromamba-shell {0} @@ -36,8 +44,16 @@ jobs: - uses: mamba-org/setup-micromamba@v2 with: environment-name: gauxc - create-args: python=3.11 c-compiler cxx-compiler fortran-compiler mpich cmake hdf5 - channels: conda-forge + create-args: >- + python=3.11 + c-compiler + cxx-compiler + fortran-compiler + mpich + cmake + hdf5 + openblas + init-shell: bash cache-environment: true - name: Install LLVM if: matrix.compiler == 'llvm-19' From 1f3d0dc38289d342a3554f9427a42c71e06737ff Mon Sep 17 00:00:00 2001 From: jjgoings <3915169+jjgoings@users.noreply.github.com> Date: Thu, 23 Oct 2025 16:01:38 -0700 Subject: [PATCH 3/4] remove llvm workflow --- .github/workflows/on_push.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index 848a3e05..cd00864d 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -36,9 +36,6 @@ jobs: ubuntu: runs-on: ubuntu-latest - strategy: - matrix: - compiler: [gnu-12, llvm-19] steps: - uses: actions/checkout@v4 - uses: mamba-org/setup-micromamba@v2 @@ -55,20 +52,9 @@ jobs: openblas init-shell: bash cache-environment: true - - name: Install LLVM - if: matrix.compiler == 'llvm-19' - run: | - wget -q https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 19 - name: Build shell: micromamba-shell {0} run: | - if [ "${{ matrix.compiler }}" = "llvm-19" ]; then - export CC=clang-19 CXX=clang++-19 - else - export CC=gcc-12 CXX=g++-12 - fi cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUXC_ENABLE_MPI=ON -DGAUXC_ENABLE_TESTS=ON -DBUILD_TESTING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 cmake --build build -j2 - name: Test From 07d58b47464fbb30ae285e4241e154aad41bf755 Mon Sep 17 00:00:00 2001 From: jjgoings <3915169+jjgoings@users.noreply.github.com> Date: Thu, 23 Oct 2025 21:52:32 -0700 Subject: [PATCH 4/4] remove on_push workflow and move macos build to compiler zoo --- .../workflows/build_and_test_compiler_zoo.yml | 66 +++++++++++++++++-- .github/workflows/on_push.yml | 62 ----------------- 2 files changed, 62 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/on_push.yml diff --git a/.github/workflows/build_and_test_compiler_zoo.yml b/.github/workflows/build_and_test_compiler_zoo.yml index 7919a764..e28b3538 100644 --- a/.github/workflows/build_and_test_compiler_zoo.yml +++ b/.github/workflows/build_and_test_compiler_zoo.yml @@ -185,20 +185,20 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Compiler + - name: Setup Compiler shell: bash run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh gnu 12 - name: Configure CMake shell: bash run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build - -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install + -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install -DCMAKE_PREFIX_PATH=${ENV_PREFIX_PATH} -DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN} - name: Build shell: bash - run: cmake --build ${{runner.workspace}}/build -j2 + run: cmake --build ${{runner.workspace}}/build -j2 - name: Install shell: bash @@ -206,10 +206,68 @@ jobs: - name: CMake Discovery Configure shell: bash - run: cmake -S $GITHUB_WORKSPACE/tests/cmake/discovery -B ${{runner.workspace}}/cmake_discovery_build + run: cmake -S $GITHUB_WORKSPACE/tests/cmake/discovery -B ${{runner.workspace}}/cmake_discovery_build -DCMAKE_PREFIX_PATH="${{runner.workspace}}/install;${ENV_PREFIX_PATH}" -DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN} - name: CMake Discovery Build shell: bash run: cmake --build ${{runner.workspace}}/cmake_discovery_build -j2 + + macos_build: + name: macOS Build and Test + runs-on: macos-14 + + steps: + - uses: actions/checkout@v4 + + - uses: mamba-org/setup-micromamba@v2 + with: + environment-name: gauxc + create-args: >- + python=3.11 + c-compiler + cxx-compiler + fortran-compiler + mpich + cmake + hdf5 + openblas + ccache + init-shell: bash + cache-environment: true + + - name: Setup ccache + shell: micromamba-shell {0} + run: | + ccache --set-config=max_size=2G + ccache --set-config=compression=true + echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV + echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV + + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ccache-macos-${{ github.sha }} + restore-keys: | + ccache-macos- + + - name: Build + shell: micromamba-shell {0} + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DGAUXC_ENABLE_MPI=ON \ + -DGAUXC_ENABLE_TESTS=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build -j3 + + - name: ccache statistics + shell: micromamba-shell {0} + run: ccache --show-stats + + - name: Test + shell: micromamba-shell {0} + run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml deleted file mode 100644 index cd00864d..00000000 --- a/.github/workflows/on_push.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Build and Test - -on: - push: - branches: [ master, main, develop ] - pull_request: - branches: [ master, main, develop ] - -jobs: - macos-m1: - runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v2 - with: - environment-name: gauxc - create-args: >- - python=3.11 - c-compiler - cxx-compiler - fortran-compiler - mpich - cmake - hdf5 - openblas - init-shell: bash - cache-environment: true - - name: Build - shell: micromamba-shell {0} - run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUXC_ENABLE_MPI=ON -DGAUXC_ENABLE_TESTS=ON -DBUILD_TESTING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - cmake --build build -j3 - - name: Test - shell: micromamba-shell {0} - run: ctest --test-dir build --output-on-failure - - ubuntu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v2 - with: - environment-name: gauxc - create-args: >- - python=3.11 - c-compiler - cxx-compiler - fortran-compiler - mpich - cmake - hdf5 - openblas - init-shell: bash - cache-environment: true - - name: Build - shell: micromamba-shell {0} - run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUXC_ENABLE_MPI=ON -DGAUXC_ENABLE_TESTS=ON -DBUILD_TESTING=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - cmake --build build -j2 - - name: Test - shell: micromamba-shell {0} - run: ctest --test-dir build --output-on-failure