Skip to content

Commit 0319e71

Browse files
authored
disable scaled_ylm_std() when using Apple Clang (#156)
* fix macos build * fix workflow for blas * remove llvm workflow * remove on_push workflow and move macos build to compiler zoo
1 parent ba80757 commit 0319e71

File tree

3 files changed

+72
-4
lines changed

3 files changed

+72
-4
lines changed

.github/workflows/build_and_test_compiler_zoo.yml

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,89 @@ jobs:
185185
steps:
186186
- uses: actions/checkout@v4
187187

188-
- name: Setup Compiler
188+
- name: Setup Compiler
189189
shell: bash
190190
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh gnu 12
191191

192192
- name: Configure CMake
193193
shell: bash
194194
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
195-
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
195+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
196196
-DCMAKE_PREFIX_PATH=${ENV_PREFIX_PATH}
197197
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
198198

199199
- name: Build
200200
shell: bash
201-
run: cmake --build ${{runner.workspace}}/build -j2
201+
run: cmake --build ${{runner.workspace}}/build -j2
202202

203203
- name: Install
204204
shell: bash
205205
run: cmake --build ${{runner.workspace}}/build --target install
206206

207207
- name: CMake Discovery Configure
208208
shell: bash
209-
run: cmake -S $GITHUB_WORKSPACE/tests/cmake/discovery -B ${{runner.workspace}}/cmake_discovery_build
209+
run: cmake -S $GITHUB_WORKSPACE/tests/cmake/discovery -B ${{runner.workspace}}/cmake_discovery_build
210210
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/install;${ENV_PREFIX_PATH}"
211211
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
212212

213213
- name: CMake Discovery Build
214214
shell: bash
215215
run: cmake --build ${{runner.workspace}}/cmake_discovery_build -j2
216+
217+
macos_build:
218+
name: macOS Build and Test
219+
runs-on: macos-14
220+
221+
steps:
222+
- uses: actions/checkout@v4
223+
224+
- uses: mamba-org/setup-micromamba@v2
225+
with:
226+
environment-name: gauxc
227+
create-args: >-
228+
python=3.11
229+
c-compiler
230+
cxx-compiler
231+
fortran-compiler
232+
mpich
233+
cmake
234+
hdf5
235+
openblas
236+
ccache
237+
init-shell: bash
238+
cache-environment: true
239+
240+
- name: Setup ccache
241+
shell: micromamba-shell {0}
242+
run: |
243+
ccache --set-config=max_size=2G
244+
ccache --set-config=compression=true
245+
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
246+
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
247+
248+
- name: Restore ccache
249+
uses: actions/cache@v4
250+
with:
251+
path: ~/.ccache
252+
key: ccache-macos-${{ github.sha }}
253+
restore-keys: |
254+
ccache-macos-
255+
256+
- name: Build
257+
shell: micromamba-shell {0}
258+
run: |
259+
cmake -S . -B build \
260+
-DCMAKE_BUILD_TYPE=Release \
261+
-DGAUXC_ENABLE_MPI=ON \
262+
-DGAUXC_ENABLE_TESTS=ON \
263+
-DBUILD_TESTING=ON \
264+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
265+
cmake --build build -j3
266+
267+
- name: ccache statistics
268+
shell: micromamba-shell {0}
269+
run: ccache --show-stats
270+
271+
- name: Test
272+
shell: micromamba-shell {0}
273+
run: ctest --test-dir build --output-on-failure

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ src/xc_integrator/local_work_driver/host/obara_saika/generator/integral*
77
src/xc_integrator/local_work_driver/host/obara_saika/generator/obara*
88
src/xc_integrator/local_work_driver/host/obara_saika/generator/*.x
99
*.swp
10+
11+
# Build directories
12+
build/
13+
_build/
14+
cmake-build-*/

src/xc_integrator/integrator_util/spherical_harmonics.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ void scaled_ylm_new(const int lmax, const std::array<double, 3> x, const std::ar
125125
}
126126

127127
// compute scaled spherical harmonics, with standard library functions
128+
// DISABLED ON MACOS: std::sph_legendre not available in Apple's libc++
129+
// This function is unused. Added in commit 66784a4 (Feb 2025), never called.
130+
// Production uses scaled_ylm_new() above.
131+
#ifndef __APPLE__
128132
std::vector<double> scaled_ylm_std(int lmax, std::array<double, 3> x, std::array<double, 3> a, double r) {
129133

130134
std::vector<double> delta = {x[0] - a[0], x[1] - a[1], x[2] - a[2]};
@@ -155,6 +159,7 @@ std::vector<double> scaled_ylm_std(int lmax, std::array<double, 3> x, std::array
155159
}
156160
return ylm;
157161
}
162+
#endif // __APPLE__
158163

159164
void scaled_ylm_matrix(const int lmax, const double* points, const int32_t npts, const std::array<double, 3> center, const double radius, double* ylm_matrix) {
160165
int nharmonics = (lmax + 1) * (lmax + 1);

0 commit comments

Comments
 (0)