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/.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);