Skip to content

Commit

Permalink
update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Jul 24, 2024
1 parent 1085543 commit 302d0b2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cmake_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
compiler: ${{ matrix.toolchain }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
Expand All @@ -46,13 +46,13 @@ jobs:
sudo apt install -y libfftw3-dev
- name: Configure Cmake
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} -DFINUFFT_BUILD_TESTS=ON -DFINUFFT_STATIC_LINKING=${{matrix.finufft_static_linking}}
cmake -S . -B ./build -G Ninja -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} -DFINUFFT_BUILD_TESTS=ON -DFINUFFT_STATIC_LINKING=${{matrix.finufft_static_linking}}
- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
cmake --build ./build --config ${{matrix.build_type}} -- -j
- name: Test
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}}
ctest -C ${{matrix.build_type}} -j
35 changes: 29 additions & 6 deletions .github/workflows/generate_cmake_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,53 @@
static_linking = ["On", "Off"]
combinations = {
"ubuntu-22.04": {
"compiler": ["llvm", "gcc"],
"toolchain": ["llvm", "gcc"],
"arch_flags": ["-march=native", "-march=x86-64", "native"]
},
"windows-2022": {
"compiler": ["msvc", "llvm"],
"toolchain": ["msvc", "llvm"],
"arch_flags": ["/arch:AVX2", "/arch:SSE2", "native"]
},
"macos-13": {
"compiler": ["llvm", "gcc-14"],
"toolchain": ["llvm", "gcc-14"],
"arch_flags": ["-march=native", "-march=x86-64", "native"]
}
}


def get_c_compiler(toolchain):
if "gcc" in toolchain:
return "gcc"
elif toolchain == "llvm":
return "clang"
elif toolchain == "msvc":
return "cl"
else:
raise ValueError(f"Unknown toolchain: {toolchain}")

def get_cxx_compiler(toolchain):
if "gcc" in toolchain:
return "g++"
elif toolchain == "llvm":
return "clang++"
elif toolchain == "msvc":
return "cl"
else:
raise ValueError(f"Unknown toolchain: {toolchain}")

for platform in combinations.keys():
for compiler in combinations[platform]["compiler"]:
for toolchain in combinations[platform]["compiler"]:
for arch_flag in combinations[platform]["arch_flags"]:
for linking in static_linking:
for build in build_type:
matrix["include"].append({
"os": platform,
"compiler": compiler,
"toolchain": toolchain,
"arch_flags": arch_flag,
"finufft_static_linking": linking,
"build_type": build
"build_type": build,
"c_compiler": get_c_compiler(toolchain),
"cxx_compiler": get_cxx_compiler(toolchain)
})
json_str = json.dumps(matrix, ensure_ascii=False)
print(json_str)

0 comments on commit 302d0b2

Please sign in to comment.