diff --git a/.github/workflows/test_cxx_backend.yml b/.github/workflows/test_cxx_backend.yml index bfcdc854..87d22afd 100644 --- a/.github/workflows/test_cxx_backend.yml +++ b/.github/workflows/test_cxx_backend.yml @@ -35,6 +35,10 @@ jobs: - name: Build and test capi_test against backend working-directory: capi_test run: ./test_with_cxx_backend.sh + + - name: Build and run capi_sample + working-directory: capi_sample + run: ./run_sample.sh test-cxx-backend-rollup: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 03291f14..bc2630f0 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,9 @@ # CMake build work_cxx +work_cxx_blas +work_cxx_wo_blas +capi_benchmark/work_cxx_blas/ .DS_Store .vscode/settings.json diff --git a/README.md.bak b/README.md.bak deleted file mode 100644 index 908c2e96..00000000 --- a/README.md.bak +++ /dev/null @@ -1,502 +0,0 @@ -# libsparseir - -[![CMake on a single platform](https://github.com/SpM-lab/libsparseir/actions/workflows/CI_cmake.yml/badge.svg)](https://github.com/SpM-lab/libsparseir/actions/workflows/CI_cmake.yml) - -> [!WARNING] -> This C++ project is still under construction. Please use other repositories: -> - https://github.com/SpM-lab/sparse-ir -> - https://github.com/SpM-lab/SparseIR.jl -> - https://github.com/SpM-lab/sparse-ir-fortran - -## Description - -This C++ library provides routines for constructing and working with the intermediate representation of correlation functions. It provides: - -- on-the-fly computation of basis functions for arbitrary cutoff Λ -- basis functions and singular values are accurate to full precision -- routines for sparse sampling - -We use [tuwien-cms/libxprec](https://github.com/tuwien-cms/libxprec) as a double-double precision arithmetic library. - -## Building and Installation - -### Dependencies - -- **CMake** (>= 3.10) -- **C++ compiler** with C++11 support -- **Fortran compiler** (optional, for Fortran bindings) - -All other dependencies (including libxprec) are automatically downloaded and built during the build process using CMake's FetchContent feature. You do not need to install these manually. - -### Using Build Scripts - -Three build scripts are provided for easy building and installation: - -1. **build_capi.sh**: Builds and installs only the C API - ```bash - ./build_capi.sh - ``` - -2. **build_fortran.sh**: Builds and installs the C API and Fortran bindings - ```bash - ./build_fortran.sh - ``` - -3. **build_with_tests.sh**: Builds everything including tests - ```bash - ./build_with_tests.sh - # After testing, you can install with: - cd build && cmake --install . - ``` - -By default, all scripts will install to `$HOME/opt/libsparseir`. You can override this by setting the `CMAKE_INSTALL_PREFIX` environment variable: - -```bash -CMAKE_INSTALL_PREFIX=/usr/local ./build_capi.sh -``` - -### Manual Build - -If you prefer to build manually, you can use the following commands: - -```bash -mkdir -p build -cd build -# For C API only -cmake .. -DSPARSEIR_BUILD_FORTRAN=OFF -DSPARSEIR_BUILD_TESTING=OFF -# For C API and Fortran bindings -cmake .. -DSPARSEIR_BUILD_FORTRAN=ON -DSPARSEIR_BUILD_TESTING=OFF -# For everything including tests -cmake .. -DSPARSEIR_BUILD_FORTRAN=ON -DSPARSEIR_BUILD_TESTING=ON - -# Build -cmake --build . - -# Install -cmake --install . -``` - -### Quick Test Build - -For a quick test build with all options enabled: - -```sh -rm -rf ./build && cmake -S . -B ./build -DSPARSEIR_BUILD_TESTING=ON && cmake --build ./build -j && ./build/test/libsparseirtests -``` - -### Testing Fortran Bindings - -After building with Fortran bindings enabled, you can run the Fortran test: - -```bash -cd build -./test_kernel -``` - -## Generating documentation with Doxygen - -Install `doxygen` and `graphviz`. Then, run the following command: - -```bash -bash generate_docs.sh -``` - -This will create the `docs/html` directory. Open `docs/html/index.html` with your browser to see it. - -# libsparseir C-API Documentation - -This document describes how to use the C-API of libsparseir. The C-API provides a way to use the sparseir library from C or other languages that can interface with C. All objects are immutable. - -## Basic Usage - -Please refer [`test/cinterface.cxx`](test/cinterface.cxx) to learn more. - - -### Basic Working Example -The following example demonstrates how to create a fermionic finite-temperature basis using the logistic kernel, -and perform transformations of a single-variable Green's function between Matsubara frequency and imaginary-time domains. - -For fitting, we use the `spir_sampling_fit_XY`, where `X` is the element type of the input data, and `Y` is that of the output data: `z` corresponds to `c_complex`, `d` to `double`. -The same naming convention is used for evaluation: `spir_sampling_eval_XY`. - -The logistic kernel is defined as - -$ -K^\mathrm{L}(\tau, \omega) = \frac{e^{-\tau \omega}}{1 + e^{-\beta\omega}}, -$ - -which corresponds to the normal Fermi-Dirac distribution at temperature $\beta^{-1}$. -For more details, see [SparseIR Tutorial](https://spm-lab.github.io/sparse-ir-tutorial/). - -```c -#include -#include - -// Create a fermionic finite temperature basis -double beta = 10.0; // Inverse temperature -double omega_max = 10.0; // Ultraviolet cutoff -double epsilon = 1e-8; // Accuracy target -spir_fermionic_finite_temp_basis* basis = - spir_fermionic_finite_temp_basis_new(beta, omega_max, epsilon); - -// Create sampling objects for imaginary-time and Matsubara domains -spir_sampling* tau_sampling = spir_fermionic_tau_sampling_new(basis); -spir_sampling* matsubara_sampling = spir_fermionic_matsubara_sampling_new(basis); - -// Create Green's function with a pole at 0.5*omega_max -int n_matsubara; -int status = spir_sampling_get_npoints(matsubara_sampling, &n_matsubara); -assert(status == SPIR_COMPUTATION_SUCCESS); - -c_complex* g_matsubara = (c_complex*)malloc(n_matsubara * sizeof(c_complex)); -int* matsubara_indices = (int*)malloc(n_matsubara * sizeof(int)); - -// Get Matsubara frequency indices -status = spir_sampling_get_matsus(matsubara_sampling, matsubara_indices); -assert(status == SPIR_COMPUTATION_SUCCESS); - -// Set pole position -const double pole_position = 0.5 * omega_max; - -// Initialize Green's function in Matsubara frequencies -// G(iω_n) = 1/(iω_n - ε) = ε/(ω_n^2 + ε^2) - iω_n/(ω_n^2 + ε^2) -for (int i = 0; i < n_matsubara; ++i) { - double i_n = (2 * matsubara_indices[i] + 1) * M_PI / beta; // Fermionic Matsubara frequency - double denominator = i_n * i_n + pole_position * pole_position; - g_matsubara[i] = c_complex{ - pole_position / denominator, // Real part: ε/(ω_n^2 + ε^2) - -i_n / denominator // Imaginary part: -ω_n/(ω_n^2 + ε^2) - }; -} - -int target_dim = 0; // target dimension for evaluation and fit - -// Matsubara sampling points to basis coefficients -int n_basis; -status = spir_fermionic_finite_temp_basis_get_size(basis, &n_basis); -assert(status == SPIR_COMPUTATION_SUCCESS); -c_complex* g_fit = (c_complex*)malloc(n_basis * sizeof(c_complex)); -int dims[1] = {n_matsubara}; -status = spir_sampling_fit_zz(matsubara_sampling, SPIR_ORDER_COLUMN_MAJOR, - 1, dims, target_dim, g_matsubara, g_fit); -assert(status == SPIR_COMPUTATION_SUCCESS); - -// Evaluate the basis coefficients at imaginary times -{ - double tau = 0.1 * beta; - double expected = -exp(-tau * pole_position) / (1.0 + exp(-beta * pole_position)); - spir_polyvector* u = spir_fermionic_finite_temp_basis_get_u(basis); - double* uval = (double*)malloc(n_basis * sizeof(double)); - status = spir_evaluate_funcs(u, tau, uval); - assert(status == SPIR_COMPUTATION_SUCCESS); - - double actual = 0.0; - for (int i = 0; i < n_basis; ++i) { - actual += creal(g_fit[i]) * uval[i]; - } - assert(fabs(actual - expected) < epsilon); - - free(uval); - spir_release_polyvector(u); -} - -// Basis coefficients to imaginary-time sampling points -int n_tau; -status = spir_sampling_get_npoints(tau_sampling, &n_tau); -assert(status == SPIR_COMPUTATION_SUCCESS); -c_complex* g_tau = (c_complex*)malloc(n_tau * sizeof(c_complex)); -status = spir_sampling_eval_zz(tau_sampling, SPIR_ORDER_COLUMN_MAJOR, - 1, dims, target_dim, g_fit, g_tau); -assert(status == SPIR_COMPUTATION_SUCCESS); - -// Compare with expected result: -// G(tau) = -exp(-tau * pole_position) / (1 + exp(-beta * pole_position)) -double* tau_points = (double*)malloc(n_tau * sizeof(double)); -status = spir_sampling_get_taus(tau_sampling, tau_points); -assert(status == SPIR_COMPUTATION_SUCCESS); -for (int i = 0; i < n_tau; ++i) { - double tau = tau_points[i]; - double expected = -exp(-tau * pole_position) / (1.0 + exp(-beta * pole_position)); - assert(fabs(g_tau[i].real - expected) < epsilon); - assert(fabs(g_tau[i].imag) < epsilon); -} - -// Imaginary-time sampling points to basis coefficients -c_complex* g_fit2 = (c_complex*)malloc(n_basis * sizeof(c_complex)); -status = spir_sampling_fit_zz(tau_sampling, SPIR_ORDER_COLUMN_MAJOR, - 1, dims, target_dim, g_tau, g_fit2); -assert(status == SPIR_COMPUTATION_SUCCESS); - -// Basis coefficients to Matsubara Green's function -c_complex* g_matsubara_reconstructed = (c_complex*)malloc(n_matsubara * sizeof(c_complex)); -status = spir_sampling_eval_zz(matsubara_sampling, SPIR_ORDER_COLUMN_MAJOR, - 1, dims, target_dim, g_fit2, g_matsubara_reconstructed); -assert(status == SPIR_COMPUTATION_SUCCESS); -for (int i = 0; i < n_matsubara; ++i) { - assert(fabs(g_matsubara_reconstructed[i].real2 - g_matsubara[i].real) < epsilon); - assert(fabs(g_matsubara_reconstructed[i].imag - g_matsubara[i].imag) < epsilon); -} - -// Clean up (order is arbitrary) -free(matsubara_indices); -free(g_matsubara); -free(g_fit); -free(g_tau); -spir_release_fermionic_finite_temp_basis(basis); -spir_release_sampling(tau_sampling); -spir_release_sampling(matsubara_sampling); -``` - - -We can create a bosonic basis using the logistic kernel as discussed in the [SparseIR Tutorial](https://spm-lab.github.io/sparse-ir-tutorial/). -This can be achived by replacing `fermionic` by `bosonic` in the above code. - - -### Kernel Creation and Domain - -```c -#include - -// Create kernels for different statistics -spir_kernel* fermionic_kernel = spir_logistic_kernel_new(9.0); -spir_kernel* bosonic_kernel = spir_reg_bose_kernel_new(9.0); - -// Get kernel domain -double xmin, xmax, ymin, ymax; -spir_kernel_domain(fermionic_kernel, &xmin, &xmax, &ymin, &ymax); - -// Clean up -spir_release_kernel(fermionic_kernel); -spir_release_kernel(bosonic_kernel); -``` - -### Basis Construction and Sampling - -```c -#include - -// Create a fermionic finite temperature basis -double beta = 10.0; // Inverse temperature -double omega_max = 10.0; // Frequency cutoff -double epsilon = 1e-8; // Accuracy target -spir_fermionic_finite_temp_basis* basis = - spir_fermionic_finite_temp_basis_new(beta, omega_max, epsilon); - -// Create sampling objects for different domains -spir_sampling* tau_sampling = spir_fermionic_tau_sampling_new(basis); -spir_sampling* matsubara_sampling = spir_fermionic_matsubara_sampling_new(basis); - -// Create Green's function with a pole at 0.5*omega_max -int n_matsubara; -int status = spir_sampling_get_npoints(matsubara_sampling, &n_matsubara); -if (status != 0) { - // Handle error - exit(-1); -} - -c_complex* g_matsubara = (c_complex*)malloc(n_matsubara * sizeof(c_complex)); -int* matsubara_indices = (int*)malloc(n_matsubara * sizeof(int)); - -// Get Matsubara frequency indices -status = spir_sampling_get_matsus(matsubara_sampling, matsubara_indices); -if (status != 0) { - // Handle error - free(matsubara_indices); - free(g_matsubara); - exit(-1); -} - -// Set pole position -const double pole_position = 0.5 * omega_max; - -// Initialize Green's function in Matsubara frequencies -// G(iω_n) = 1/(iω_n - ε) = ε/(ω_n^2 + ε^2) - iω_n/(ω_n^2 + ε^2) -for (int i = 0; i < n_matsubara; ++i) { - double i_n = (2 * matsubara_indices[i] + 1) * M_PI / beta; // Fermionic Matsubara frequency - double denominator = i_n * i_n + pole_position * pole_position; - g_matsubara[i] = c_complex{ - pole_position / denominator, // Real part: ε/(ω_n^2 + ε^2) - -i_n / denominator // Imaginary part: -ω_n/(ω_n^2 + ε^2) - }; -} - -// Clean up -free(matsubara_indices); -free(g_matsubara); -spir_release_fermionic_finite_temp_basis(basis); -spir_release_sampling(tau_sampling); -spir_release_sampling(matsubara_sampling); -``` - -### Sampling Operations - -```c -#include - -// Create basis and sampling objects -double beta = 10.0; -double omega_max = 10.0; -double epsilon = 1e-8; -spir_fermionic_finite_temp_basis* basis = - spir_fermionic_finite_temp_basis_new(beta, omega_max, epsilon); -spir_sampling* tau_sampling = spir_fermionic_tau_sampling_new(basis); - -// Example of evaluating basis coefficients at sampling points -int32_t ndim = 2; -int32_t input_dims[] = {3, 4}; // Example dimensions -int32_t target_dim = 0; -double input[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0}; -double output[12]; - -// Real to real transformation -spir_sampling_eval_dd( - tau_sampling, - SPIR_ORDER_COLUMN_MAJOR, - ndim, - input_dims, - target_dim, - input, - output -); - -// Fit values back to basis coefficients -spir_sampling_fit_dd( - tau_sampling, - SPIR_ORDER_COLUMN_MAJOR, - ndim, - input_dims, - target_dim, - output, - input -); - -// Clean up -spir_release_fermionic_finite_temp_basis(basis); -spir_release_sampling(tau_sampling); -``` - -### Discrete Lehmann Representation (DLR) - -```c -#include -#include // rand - -double beta = 100.0; -double wmax = 1.0; -double epsilon = 1e-12; - -spir_fermionic_finite_temp_basis *basis = - spir_fermionic_finite_temp_basis_new(beta, wmax, epsilon); - -spir_fermionic_dlr *dlr = spir_fermionic_dlr_new(basis); - -int npoles = 10; -double poles[npoles]; -double coeffs[npoles]; -for (int i = 0; i < npoles; i++) { - double r = (double)rand() / (double)RAND_MAX; - poles[i] = wmax * (2.0 * r - 1.0); - r = (double)rand() / (double)RAND_MAX; - coeffs[i] = 2.0 * r - 1.0; -} - -spir_fermionic_dlr *dlr_with_poles = - spir_fermionic_dlr_new_with_poles(basis, npoles, poles); -int fitmat_rows = spir_fermionic_dlr_fitmat_rows(dlr_with_poles); -int fitmat_cols = spir_fermionic_dlr_fitmat_cols(dlr_with_poles); - -double *Gl = (double *)malloc(fitmat_rows * sizeof(double)); -int32_t to_ir_input_dims[1] = {npoles}; -int status_to_IR = - spir_fermionic_dlr_to_IR(dlr_with_poles, SPIR_ORDER_COLUMN_MAJOR, 1, - to_ir_input_dims, coeffs, Gl); - -double *g_dlr = (double *)malloc(fitmat_rows * sizeof(double)); -int32_t from_ir_input_dims[1] = {static_cast(fitmat_rows)}; -int status_from_IR = spir_fermionic_dlr_from_IR( - dlr, SPIR_ORDER_COLUMN_MAJOR, 1, from_ir_input_dims, Gl, g_dlr); - -// Clean up -free(Gl); -free(g_dlr); -spir_release_fermionic_finite_temp_basis(basis); -spir_release_fermionic_dlr(dlr); -spir_release_fermionic_dlr(dlr_with_poles); -``` - -### Complex Number Operations - -```c -#include -#include - -// Create basis and sampling objects -double beta = 10.0; -double omega_max = 10.0; -double epsilon = 1e-8; -spir_fermionic_finite_temp_basis* basis = - spir_fermionic_finite_temp_basis_new(beta, omega_max, epsilon); -spir_sampling* matsubara_sampling = spir_fermionic_matsubara_sampling_new(basis); - -// Setup dimensions and data -int32_t ndim = 2; -int32_t input_dims[] = {3, 4}; -int32_t target_dim = 0; - -// Initialize complex input data -c_complex complex_input[12]; -c_complex complex_output[12]; -for (int i = 0; i < 12; i++) { - // Complex numbers with real and imaginary parts - complex_input[i] = c_complex{(double)i, (double)i}; -} - -// Complex to complex transformation -spir_sampling_eval_zz( - matsubara_sampling, - SPIR_ORDER_COLUMN_MAJOR, - ndim, - input_dims, - target_dim, - complex_input, - complex_output -); - -// Fit complex values back to basis coefficients -c_complex recovered_input[12]; -spir_sampling_fit_zz( - matsubara_sampling, - SPIR_ORDER_COLUMN_MAJOR, - ndim, - input_dims, - target_dim, - complex_output, - recovered_input -); - -// Clean up -spir_release_fermionic_finite_temp_basis(basis); -spir_release_sampling(matsubara_sampling); -``` - -# libsparseir Fortran Bindings Documentation - -This document describes how to use the Fortran bindings of libsparseir. The Fortran bindings provide a way to use the sparseir library from Fortran. All objects are immutable. - -## Basic Usage - -```fortran -use sparseir -implicit none - -type(spir_kernel) :: kernel -real(8) :: lambda, xmin, xmax, ymin, ymax -integer :: stat - -! Create a logistic kernel -lambda = 9.0d0 -kernel = spir_logistic_kernel_new(lambda) - -! Get kernel domain -stat = spir_kernel_domain(kernel, xmin, xmax, ymin, ymax) -``` \ No newline at end of file diff --git a/back/_build_fortran.sh b/back/_build_fortran.sh deleted file mode 100644 index 2ecd1160..00000000 --- a/back/_build_fortran.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e - -# Get script directory -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$SCRIPT_DIR" - -# Create build directory -mkdir -p build -cd build - -# Configure with tests enabled -cmake .. \ - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-$HOME/opt/libsparseir} \ - -DCMAKE_C_FLAGS="-w" \ - -DCMAKE_CXX_FLAGS="-w" \ - -DCMAKE_EXE_LINKER_FLAGS="" \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DSPARSEIR_BUILD_TESTING=OFF \ - -DSPARSEIR_USE_BLAS=OFF \ - -DSPARSEIR_USE_LAPACKE=OFF - -cmake --build . --config Release -j 4 -make install diff --git a/back/build_capi.sh b/back/build_capi.sh deleted file mode 100644 index 5752b81d..00000000 --- a/back/build_capi.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -# Get script directory -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$SCRIPT_DIR" - -# Clean build directory to ensure clean state -rm -rf build -mkdir -p build -cd build - -# Configure with minimal options (only C-API) -cmake .. \ - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-$HOME/opt/libsparseir} \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DSPARSEIR_BUILD_TESTING=OFF \ - -DSPARSEIR_USE_BLAS=OFF \ - -DBUILD_TESTING=OFF - -# Build and install -cmake --build . --config Release -- -j 4 -cmake --install . - -echo "SparseIR C-API library has been built and installed successfully." diff --git a/back/build_capi_with_asan.sh b/back/build_capi_with_asan.sh deleted file mode 100644 index 9c3905c4..00000000 --- a/back/build_capi_with_asan.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -e - -# Get script directory -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$SCRIPT_DIR" - -# Create build directory -mkdir -p build -cd build - -# Configure with tests enabled -cmake .. \ - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-$HOME/opt/libsparseir} \ - -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_C_FLAGS="-w -fsanitize=address -static-libasan" \ - -DCMAKE_CXX_FLAGS="-w -fsanitize=address -static-libasan" \ - -DCMAKE_EXE_LINKER_FLAGS="-static-libasan" \ - -DSPARSEIR_BUILD_FORTRAN=OFF \ - -DSPARSEIR_BUILD_TESTING=OFF \ - -DSPARSEIR_USE_BLAS=ON - -# Build (including tests) -cmake --build . --config Release -j 4 - -# Run tests -ctest --output-on-failure - -echo "SparseIR was built with tests successfully." -echo "You can install it using: cd build && cmake --install ." diff --git a/back/build_optimized.sh b/back/build_optimized.sh deleted file mode 100644 index cce0cedc..00000000 --- a/back/build_optimized.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -set -e - -# Get script directory -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$SCRIPT_DIR" - -# Clean build directory to ensure clean state -rm -rf build -mkdir -p build -cd build - -# Configure with maximum optimization for benchmarking -cmake .. \ - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-$HOME/opt/libsparseir} \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DSPARSEIR_BUILD_TESTING=OFF \ - -DSPARSEIR_USE_BLAS=OFF \ - -DBUILD_TESTING=OFF \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS="-O3 -DNDEBUG -g0 -march=native" \ - -DCMAKE_EXE_LINKER_FLAGS="-flto" \ - -DCMAKE_VERBOSE_MAKEFILE=ON - -# Build with maximum parallelization -cmake --build . --config Release -- -j $(nproc) - -# Install -cmake --install . - -echo "Optimized SparseIR library has been built and installed successfully." -echo "Debug symbols removed, maximum optimization enabled." diff --git a/back/build_with_tests.sh b/back/build_with_tests.sh deleted file mode 100755 index fb7f214c..00000000 --- a/back/build_with_tests.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -e - -# Get script directory -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$SCRIPT_DIR" - -# Create build directory -mkdir -p build -cd build - -# Configure with tests enabled -cmake .. \ - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-$HOME/opt/libsparseir} \ - -DCMAKE_C_FLAGS="-w" \ - -DCMAKE_CXX_FLAGS="-w" \ - -DCMAKE_EXE_LINKER_FLAGS="" \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DSPARSEIR_BUILD_TESTING=ON \ - -DSPARSEIR_USE_BLAS=ON - -# Build (including tests) -cmake --build . --config Release -j 4 - -# Run tests -ctest --output-on-failure - -echo "SparseIR was built with tests successfully." -echo "You can install it using: cd build && cmake --install ." diff --git a/back/workflows/CI_C_API_Python.yml b/back/workflows/CI_C_API_Python.yml deleted file mode 100644 index 506d1f68..00000000 --- a/back/workflows/CI_C_API_Python.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Python C API CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - test: - name: Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - python-version: - - "3.10" - - "3.11" - - "3.12" - - steps: - - name: Install dependencies (Linux) - if: runner.os == 'Linux' - run: sudo apt update && sudo apt install -y libeigen3-dev libopenblas-dev - - - name: Install dependencies (macOS) - if: runner.os == 'macOS' - run: brew install eigen openblas - - uses: actions/checkout@v5 - - name: Install uv and set the python version - uses: astral-sh/setup-uv@v7 - with: - # Install a specific version of uv. - version: "0.8.15" - python-version: ${{ matrix.python-version }} - - name: Enable caching - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: Run prepare_build.py - run: python3 prepare_build.py - working-directory: python - - - name: Run uv sync - run: uv sync - working-directory: python - env: - SPARSEIR_USE_BLAS: 1 - - - name: Run tests - # For example, using `pytest` - run: uv run pytest tests - working-directory: python - env: - SPARSEIR_USE_BLAS: 1 diff --git a/back/workflows/CI_PublishTestPyPI.yml b/back/workflows/CI_PublishTestPyPI.yml deleted file mode 100644 index 059a7cd2..00000000 --- a/back/workflows/CI_PublishTestPyPI.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: CI Python Build & Publish to TestPyPI (Trusted) - -on: - push: - tags: ["v*"] - workflow_dispatch: - -jobs: - build-wheels: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - # Linux builds - - os: ubuntu-latest - cibw_archs: "auto" - deployment_target: "" - openblas_path: "" - py_tag: "cp310" - # macOS Intel builds - - os: macos-13 # Intel Mac - cibw_archs: "x86_64" - deployment_target: "13.0" - openblas_path: "/usr/local/opt/openblas" - py_tag: "cp310" - # macOS Apple Silicon builds - - os: macos-latest # Apple Silicon Mac - cibw_archs: "arm64" - deployment_target: "15.0" - openblas_path: "/opt/homebrew/opt/openblas" - py_tag: "cp310" - steps: - - uses: actions/checkout@v5 - - name: remove python/.gitignore - shell: bash - run: | - rm -f python/.gitignore - - name: prepare build - shell: bash - run: | - cd python - python prepare_build.py - - uses: pypa/cibuildwheel@v3.2.1 - env: - CIBW_DEPENDENCY_VERSIONS: "latest" - CIBW_BUILD_VERBOSITY: 1 - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" - CIBW_BUILD: "${{ matrix.py_tag }}-*" - CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target || '11.0' }} SPARSEIR_USE_BLAS=1" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - CIBW_SKIP: "*-manylinux_i686 *-musllinux_i686" - # Install OpenBLAS using micromamba (conda-forge) - separate for manylinux and musllinux - CIBW_BEFORE_ALL_MANYLINUX: "curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps" - CIBW_BEFORE_ALL_MUSLLINUX: "apk add --no-cache bzip2 && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps" - CIBW_BEFORE_ALL_MACOS: "brew install openblas" - # Set environment variables to help CMake find OpenBLAS - CIBW_ENVIRONMENT_MANYLINUX: "SPARSEIR_USE_BLAS=1" - CIBW_ENVIRONMENT_MUSLLINUX: "SPARSEIR_USE_BLAS=1" - with: - package-dir: ./python - output-dir: dist - - uses: actions/upload-artifact@v5 - with: - name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.py_tag }} - path: dist/* - - publish-testpypi: - needs: build-wheels - runs-on: ubuntu-latest - environment: - name: testpypi - permissions: - id-token: write # ← Trusted Publishing に必須 - contents: read - steps: - - uses: actions/download-artifact@v6 - with: - path: dist - merge-multiple: true - - name: Publish to TestPyPI (Trusted) - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist - repository-url: https://test.pypi.org/legacy/ - verbose: true - skip-existing: true - attestations: false # Disable attestations due to Sigstore service issues \ No newline at end of file diff --git a/back/workflows/CI_cmake_intel.yml b/back/workflows/CI_cmake_intel.yml deleted file mode 100644 index 865cf973..00000000 --- a/back/workflows/CI_cmake_intel.yml +++ /dev/null @@ -1,142 +0,0 @@ -# CMake CI workflow for libsparseir with Intel oneAPI compilers -# Tests on Ubuntu-latest (x86_64) with Intel C++/Fortran compilers -name: CMake Intel oneAPI CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - INSTALL_PREFIX: ${{github.workspace}}/install - -jobs: - build-intel: - runs-on: ubuntu-latest - name: ubuntu-latest-intel-x86_64 - - steps: - - uses: actions/checkout@v5 - - - name: Install Intel oneAPI Base Toolkit - run: | - # Download Intel oneAPI GPG public key - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - - # Add Intel oneAPI repository - echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - - # Update package list - sudo apt-get update - - # Install Intel oneAPI compilers - sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-compiler-fortran intel-oneapi-mkl-devel - - - name: Install Eigen - run: sudo apt-get install -y libeigen3-dev - - - name: Setup Intel oneAPI environment - run: | - source /opt/intel/oneapi/setvars.sh - echo "Intel C++ compiler: $(which icpx)" - echo "Intel Fortran compiler: $(which ifx)" - icpx --version - ifx --version - - - name: Configure CMake - run: | - source /opt/intel/oneapi/setvars.sh - - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=icx \ - -DCMAKE_CXX_COMPILER=icpx \ - -DCMAKE_CXX_FLAGS="-fp-model=precise -g -O2" \ - -DCMAKE_Fortran_COMPILER=ifx \ - -DCMAKE_Fortran_FLAGS="-stand f08 -warn all -g -O2 -check bounds -traceback" \ - -DCMAKE_BUILD_TYPE=Release \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} \ - -DSPARSEIR_BUILD_TESTING=OFF \ - -DSPARSEIR_USE_BLAS=OFF \ - -DSPARSEIR_DEBUG=ON - - - name: Build - run: | - source /opt/intel/oneapi/setvars.sh - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Skip C++/C Tests - run: | - echo "Skipping C++/C tests to focus on Fortran sample debugging" - - - name: Install - run: | - source /opt/intel/oneapi/setvars.sh - cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Verify Installation - run: | - ls -la ${{env.INSTALL_PREFIX}}/include/sparseir/ - ls -la ${{env.INSTALL_PREFIX}}/lib/ - - - name: Build and Run Fortran Sample - run: | - source /opt/intel/oneapi/setvars.sh - - echo "=== Building Fortran Sample ===" - cd fortran/sample - - # Find SparseIR CMake config - SPARSEIR_DIR="${{env.INSTALL_PREFIX}}/share/cmake/SparseIR" - if [ ! -d "$SPARSEIR_DIR" ]; then - echo "ERROR: SparseIR CMake config not found at $SPARSEIR_DIR" - exit 1 - fi - - # Install FFTW3 - sudo apt-get update && sudo apt-get install -y libfftw3-dev - - # Clean and build - rm -rf build - - cmake -B build \ - -DSparseIR_DIR="$SPARSEIR_DIR" \ - -DUSE_SYSTEM_LIBSPARSEIR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_Fortran_COMPILER=ifx \ - -DCMAKE_Fortran_FLAGS="-stand f08 -warn all -g -O2 -check bounds -traceback" - - cmake --build build - - echo "=== Running Fortran Sample ===" - - export LD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$LD_LIBRARY_PATH" - export SPARSEIR_DEBUG=1 - echo "Set library paths:" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - echo "SPARSEIR_DEBUG: $SPARSEIR_DEBUG" - - # Run with error handling and debug tools - if ./build/second_order_perturbation_fort; then - echo "=== Fortran Sample completed successfully ===" - else - echo "=== Fortran Sample failed with exit code $? ===" - echo "=== Running with debug tools ===" - - # Install debug tools - sudo apt-get install -y gdb valgrind - - # Run with gdb for stack trace - echo "=== GDB Stack Trace ===" - gdb -batch -ex "run" -ex "bt" -ex "info registers" -ex "quit" ./build/second_order_perturbation_fort 2>&1 || true - - # Run with valgrind for memory debugging - echo "=== Valgrind Memory Check ===" - valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes ./build/second_order_perturbation_fort 2>&1 || true - - exit 1 - fi - diff --git a/back/workflows/CI_cmake_no_blas.yml b/back/workflows/CI_cmake_no_blas.yml deleted file mode 100644 index b4a2a294..00000000 --- a/back/workflows/CI_cmake_no_blas.yml +++ /dev/null @@ -1,160 +0,0 @@ -# Multi-platform CMake CI workflow for libsparseir (without BLAS) -# Tests across Windows, macOS, and Ubuntu with gcc and clang compilers -name: CMake Multi-Platform CI (No BLAS) - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - INSTALL_PREFIX: ${{github.workspace}}/install - -jobs: - build-no-blas: - strategy: - fail-fast: false - matrix: - include: - # Ubuntu with gcc and clang (x86_64) - - os: ubuntu-latest - compiler: gcc - c_compiler: gcc - cpp_compiler: g++ - eigen_install: sudo apt update && sudo apt install -y libeigen3-dev - - os: ubuntu-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - eigen_install: sudo apt update && sudo apt install -y libeigen3-dev - - # Ubuntu ARM64 with gcc and clang - - os: ubuntu-latest - arch: arm64 - compiler: gcc - c_compiler: gcc - cpp_compiler: g++ - eigen_install: sudo apt update && sudo apt install -y libeigen3-dev - - os: ubuntu-latest - arch: arm64 - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - eigen_install: sudo apt update && sudo apt install -y libeigen3-dev - - # macOS with clang - - os: macos-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - eigen_install: brew install eigen - - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }}-no-blas - - steps: - - uses: actions/checkout@v5 - - - name: Install Fortran compiler (macOS) - if: matrix.os == 'macos-latest' - run: brew install gfortran - - - name: Install Eigen - run: ${{ matrix.eigen_install }} - - - name: Debug Fortran compilers (macOS) - if: matrix.os == 'macos-latest' - run: | - echo "Available Fortran compilers:" - ls -la /opt/homebrew/bin/*fortran* || echo "No *fortran* found in /opt/homebrew/bin/" - ls -la /usr/local/bin/*fortran* || echo "No *fortran* found in /usr/local/bin/" - which gfortran || echo "gfortran not in PATH" - which gfortran-13 || echo "gfortran-13 not in PATH" - - - name: Configure CMake (Unix) - run: | - if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - # Use the full path to gfortran from Homebrew gcc - FORTRAN_COMPILER="/opt/homebrew/bin/gfortran-13" - else - FORTRAN_COMPILER="gfortran" - fi - - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ - -DCMAKE_Fortran_COMPILER="$FORTRAN_COMPILER" \ - -DCMAKE_Fortran_FLAGS="-std=f2008 -pedantic -Wall -Wextra" \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} \ - -DSPARSEIR_BUILD_TESTING=ON \ - -DSPARSEIR_USE_BLAS=OFF - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest --build-config ${{env.BUILD_TYPE}} --output-on-failure - - - name: Install - run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Verify Installation - run: | - ls -la ${{env.INSTALL_PREFIX}}/include/sparseir/ - ls -la ${{env.INSTALL_PREFIX}}/lib/ - - - name: Build and Run Fortran Sample (Unix) - run: | - echo "=== Building Fortran Sample ===" - cd fortran/sample - - # Find SparseIR CMake config - SPARSEIR_DIR="${{env.INSTALL_PREFIX}}/share/cmake/SparseIR" - if [ ! -d "$SPARSEIR_DIR" ]; then - echo "ERROR: SparseIR CMake config not found at $SPARSEIR_DIR" - exit 1 - fi - - # Install FFTW3 if needed (for Ubuntu/macOS) - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - sudo apt-get update && sudo apt-get install -y libfftw3-dev - elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then - brew install fftw - fi - - # Clean and build - rm -rf build - - # Set Fortran compiler explicitly - if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - FORTRAN_COMPILER="/opt/homebrew/bin/gfortran-13" - else - FORTRAN_COMPILER="gfortran" - fi - - cmake -B build \ - -DSparseIR_DIR="$SPARSEIR_DIR" \ - -DUSE_SYSTEM_LIBSPARSEIR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_Fortran_COMPILER="$FORTRAN_COMPILER" \ - -DCMAKE_Fortran_FLAGS="-std=f2008 -pedantic -Wall -Wextra" - - cmake --build build - - echo "=== Running Fortran Sample ===" - - export LD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$LD_LIBRARY_PATH" - export DYLD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$DYLD_LIBRARY_PATH" - echo "Set library paths:" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - echo "DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH" - - ./build/second_order_perturbation_fort - - echo "=== Fortran Sample completed successfully ===" diff --git a/back/workflows/CI_cmake_with_blas.yml b/back/workflows/CI_cmake_with_blas.yml deleted file mode 100644 index 0515e854..00000000 --- a/back/workflows/CI_cmake_with_blas.yml +++ /dev/null @@ -1,201 +0,0 @@ -# Multi-platform CMake CI workflow for libsparseir (with BLAS/OpenBLAS) -# Tests across Ubuntu and macOS with BLAS/LAPACK support -name: CMake Multi-Platform CI (With BLAS) - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - INSTALL_PREFIX: ${{github.workspace}}/install - -jobs: - build-with-blas: - strategy: - fail-fast: false - matrix: - include: - # Ubuntu with gcc and clang (BLAS/LAPACK enabled) - x86_64 - - os: ubuntu-latest - compiler: gcc - c_compiler: gcc - cpp_compiler: g++ - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libblas-dev liblapack-dev - - os: ubuntu-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libblas-dev liblapack-dev - - # Ubuntu ARM64 with gcc and clang (BLAS/LAPACK enabled) - - os: ubuntu-latest - arch: arm64 - compiler: gcc - c_compiler: gcc - cpp_compiler: g++ - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libblas-dev liblapack-dev - - os: ubuntu-latest - arch: arm64 - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libblas-dev liblapack-dev - - # Ubuntu with OpenBLAS specifically - - os: ubuntu-latest - compiler: gcc - c_compiler: gcc - cpp_compiler: g++ - blas_type: openblas - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libopenblas-dev - - os: ubuntu-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - blas_type: openblas - deps_install: sudo apt update && sudo apt install -y libeigen3-dev libopenblas-dev - - # macOS with BLAS (using Accelerate framework) - - os: macos-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - blas_type: accelerate - deps_install: brew install eigen - - # macOS with OpenBLAS - - os: macos-latest - compiler: clang - c_compiler: clang - cpp_compiler: clang++ - blas_type: openblas - deps_install: brew install eigen openblas - - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }}${{ matrix.blas_type && format('-{0}', matrix.blas_type) || '' }}-blas - - steps: - - uses: actions/checkout@v5 - - - name: Install Fortran compiler (macOS) - if: matrix.os == 'macos-latest' - run: brew install gfortran - - - name: Install dependencies - run: ${{ matrix.deps_install }} - - - name: Debug Fortran compilers (macOS) - if: matrix.os == 'macos-latest' - run: | - echo "Available Fortran compilers:" - ls -la /opt/homebrew/bin/*fortran* || echo "No *fortran* found in /opt/homebrew/bin/" - ls -la /usr/local/bin/*fortran* || echo "No *fortran* found in /usr/local/bin/" - which gfortran || echo "gfortran not in PATH" - which gfortran-13 || echo "gfortran-13 not in PATH" - - - name: Configure CMake - run: | - if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - # Use the full path to gfortran from Homebrew gcc - FORTRAN_COMPILER="/opt/homebrew/bin/gfortran-13" - - # Set OpenBLAS paths for macOS if using OpenBLAS - if [[ "${{ matrix.blas_type }}" == "openblas" ]]; then - OPENBLAS_ROOT="/opt/homebrew/opt/openblas" - export LDFLAGS="-L${OPENBLAS_ROOT}/lib" - export CPPFLAGS="-I${OPENBLAS_ROOT}/include" - export PKG_CONFIG_PATH="${OPENBLAS_ROOT}/lib/pkgconfig" - fi - else - FORTRAN_COMPILER="gfortran" - fi - - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ - -DCMAKE_Fortran_COMPILER="$FORTRAN_COMPILER" \ - -DCMAKE_Fortran_FLAGS="-std=f2008 -pedantic -Wall -Wextra" \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} \ - -DSPARSEIR_BUILD_TESTING=ON \ - -DSPARSEIR_USE_BLAS=ON - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest --build-config ${{env.BUILD_TYPE}} --output-on-failure - - - name: Install - run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Verify Installation - run: | - ls -la ${{env.INSTALL_PREFIX}}/include/sparseir/ - ls -la ${{env.INSTALL_PREFIX}}/lib/ - - - name: Check BLAS linking - run: | - if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - otool -L ${{env.INSTALL_PREFIX}}/lib/libsparseir.dylib | grep -E "(Accelerate|openblas)" || echo "No BLAS library found in linking" - else - ldd ${{env.INSTALL_PREFIX}}/lib/libsparseir.so | grep -E "(blas|lapack|openblas)" || echo "No BLAS library found in linking" - fi - - - name: Build and Run Fortran Sample - run: | - echo "=== Building Fortran Sample ===" - cd fortran/sample - - # Find SparseIR CMake config - SPARSEIR_DIR="${{env.INSTALL_PREFIX}}/share/cmake/SparseIR" - if [ ! -d "$SPARSEIR_DIR" ]; then - echo "ERROR: SparseIR CMake config not found at $SPARSEIR_DIR" - exit 1 - fi - - # Install FFTW3 if needed - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - sudo apt-get update && sudo apt-get install -y libfftw3-dev - elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then - # FFTW3 might already be installed via deps_install, but ensure it's available - brew list fftw || brew install fftw - fi - - # Clean and build - rm -rf build - - # Set Fortran compiler explicitly - if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - FORTRAN_COMPILER="/opt/homebrew/bin/gfortran-13" - else - FORTRAN_COMPILER="gfortran" - fi - - cmake -B build \ - -DSparseIR_DIR="$SPARSEIR_DIR" \ - -DUSE_SYSTEM_LIBSPARSEIR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_Fortran_COMPILER="$FORTRAN_COMPILER" \ - -DCMAKE_Fortran_FLAGS="-std=f2008 -pedantic -Wall -Wextra" - - cmake --build build - - echo "=== Running Fortran Sample ===" - - export LD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$LD_LIBRARY_PATH" - export DYLD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$DYLD_LIBRARY_PATH" - echo "Set library paths:" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - echo "DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH" - - ./build/second_order_perturbation_fort - - echo "=== Fortran Sample completed successfully ===" - diff --git a/back/workflows/CI_cmake_with_blas_ilp64.yml b/back/workflows/CI_cmake_with_blas_ilp64.yml deleted file mode 100644 index 71df8984..00000000 --- a/back/workflows/CI_cmake_with_blas_ilp64.yml +++ /dev/null @@ -1,134 +0,0 @@ -# Multi-platform CMake CI workflow for libsparseir (with ILP64 BLAS/OpenBLAS) -# Tests ILP64 support with OpenBLAS 64-bit integer interface -name: CMake Multi-Platform CI (With ILP64 BLAS) - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - INSTALL_PREFIX: ${{github.workspace}}/install - -jobs: - build-with-ilp64-blas: - runs-on: ubuntu-latest - name: ubuntu-gcc-ilp64-blas - - steps: - - uses: actions/checkout@v5 - - - name: Install dependencies - run: sudo apt update && sudo apt install -y libeigen3-dev libopenblas64-0 libopenblas64-dev - - - name: Verify OpenBLAS ILP64 installation - run: | - echo "=== Checking OpenBLAS ILP64 installation ===" - dpkg -l | grep openblas64 || echo "No openblas64 packages found" - - # Check for ILP64 libraries in common locations - echo "=== Checking for ILP64 libraries ===" - find /usr/lib -name "*openblas64*" -type f 2>/dev/null || echo "No openblas64 libraries found" - - # Check if ILP64 symbols are available - echo "=== Checking for ILP64 symbols ===" - for lib in /usr/lib/x86_64-linux-gnu/libopenblas64*.so*; do - if [ -f "$lib" ]; then - echo "Checking symbols in $lib:" - nm -D "$lib" 2>/dev/null | grep -E "dgemm_|zgemm_" | head -3 || echo "No BLAS symbols found" - break - fi - done - - - name: Configure CMake with ILP64 - run: | - # Set environment variables to help CMake find ILP64 BLAS - export BLA_VENDOR=OpenBLAS - export BLA_PREFER_PKGCONFIG=ON - - # Find the actual OpenBLAS64 library path - OPENBLAS64_LIB=$(find /usr/lib -name "libopenblas64*.so*" -type f | head -1) - if [ -z "$OPENBLAS64_LIB" ]; then - echo "Error: libopenblas64 not found" - exit 1 - fi - echo "Found OpenBLAS64 library: $OPENBLAS64_LIB" - - # Configure CMake with explicit library hint - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_CXX_COMPILER=g++ \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DSPARSEIR_BUILD_FORTRAN=ON \ - -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} \ - -DSPARSEIR_BUILD_TESTING=ON \ - -DSPARSEIR_USE_BLAS=ON \ - -DSPARSEIR_USE_ILP64=ON \ - -DBLAS_LIBRARIES="$OPENBLAS64_LIB" - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest --build-config ${{env.BUILD_TYPE}} --output-on-failure - - - name: Install - run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Verify Installation - run: | - ls -la ${{env.INSTALL_PREFIX}}/include/sparseir/ - ls -la ${{env.INSTALL_PREFIX}}/lib/ - - - name: Check ILP64 BLAS linking - run: | - echo "=== Checking ILP64 BLAS linking ===" - ldd ${{env.INSTALL_PREFIX}}/lib/libsparseir.so | grep -E "(openblas64|blas)" || echo "No BLAS library found in linking" - - # Verify that the library links to OpenBLAS 64-bit - if ldd ${{env.INSTALL_PREFIX}}/lib/libsparseir.so | grep -q "openblas64"; then - echo "✓ Successfully linked to OpenBLAS ILP64" - else - echo "✗ Failed to link to OpenBLAS ILP64" - exit 1 - fi - - - name: Build and Run Fortran Sample with ILP64 - run: | - echo "=== Building Fortran Sample with ILP64 ===" - cd fortran/sample - - # Find SparseIR CMake config - SPARSEIR_DIR="${{env.INSTALL_PREFIX}}/share/cmake/SparseIR" - if [ ! -d "$SPARSEIR_DIR" ]; then - echo "ERROR: SparseIR CMake config not found at $SPARSEIR_DIR" - exit 1 - fi - - # Install FFTW3 if needed - sudo apt-get update && sudo apt-get install -y libfftw3-dev - - # Clean and build - rm -rf build - - cmake -B build \ - -DSparseIR_DIR="$SPARSEIR_DIR" \ - -DUSE_SYSTEM_LIBSPARSEIR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_Fortran_COMPILER="gfortran" - - cmake --build build - - echo "=== Running Fortran Sample with ILP64 ===" - - export LD_LIBRARY_PATH="${{env.INSTALL_PREFIX}}/lib:$LD_LIBRARY_PATH" - echo "Set library paths:" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - - ./build/second_order_perturbation_fort - - echo "=== Fortran Sample with ILP64 completed successfully ===" diff --git a/back/workflows/CreateTag.yml b/back/workflows/CreateTag.yml deleted file mode 100644 index 235218f6..00000000 --- a/back/workflows/CreateTag.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Create Tag and Release from Version Header -on: - push: - branches: [main] - -# https://stackoverflow.com/questions/69063452/github-actions-on-release-created-workflow-trigger-not-working -# GITHUB_TOKEN is not enough to trigger the wheel build and publish workflow. -# Use personal access token for "actions" and "contents" read-write permissions. - -jobs: - tag-and-release: - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.DEPLOY }} - steps: - - uses: actions/checkout@v5 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Check version consistency - run: | - echo "Checking version consistency across components..." - python update_version.py - if [ $? -ne 0 ]; then - echo "❌ Version inconsistency detected. Please run 'python update_version.py ' to fix." - exit 1 - fi - echo "✅ All versions are consistent" - - - name: Extract version from header - id: version - run: | - MAJOR=$(grep "#define SPARSEIR_VERSION_MAJOR" include/sparseir/version.h | awk '{print $3}') - MINOR=$(grep "#define SPARSEIR_VERSION_MINOR" include/sparseir/version.h | awk '{print $3}') - PATCH=$(grep "#define SPARSEIR_VERSION_PATCH" include/sparseir/version.h | awk '{print $3}') - VERSION="v${MAJOR}.${MINOR}.${PATCH}" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - echo "Version: $VERSION" - - # Check if remote tag exists - git fetch --tags - if git tag -l | grep -q "^$VERSION$"; then - echo "Tag $VERSION already exists" - echo "should_create=false" >> "$GITHUB_OUTPUT" - else - echo "should_create=true" >> "$GITHUB_OUTPUT" - fi - - - name: Create Release - if: steps.version.outputs.should_create == 'true' - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ steps.version.outputs.version }} - name: Release ${{ steps.version.outputs.version }} - draft: false - prerelease: false - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.DEPLOY }} diff --git a/back/workflows/PublishPyPI.yml b/back/workflows/PublishPyPI.yml deleted file mode 100644 index 6f4b2bf6..00000000 --- a/back/workflows/PublishPyPI.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: Build & Publish - -on: - push: - tags: ["v*"] - workflow_dispatch: - -jobs: - build-wheels: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - # Linux builds - - os: ubuntu-latest - cibw_archs: "auto" - deployment_target: "" - openblas_path: "" - py_tag: "cp310" - - os: ubuntu-latest - cibw_archs: "auto" - deployment_target: "" - openblas_path: "" - py_tag: "cp311" - - os: ubuntu-latest - cibw_archs: "auto" - deployment_target: "" - openblas_path: "" - py_tag: "cp312" - - os: ubuntu-latest - cibw_archs: "auto" - deployment_target: "" - openblas_path: "" - py_tag: "cp313" - # macOS Intel builds - - os: macos-13 # Intel Mac - cibw_archs: "x86_64" - deployment_target: "13.0" - openblas_path: "/usr/local/opt/openblas" - py_tag: "cp310" - - os: macos-13 # Intel Mac - cibw_archs: "x86_64" - deployment_target: "13.0" - openblas_path: "/usr/local/opt/openblas" - py_tag: "cp311" - - os: macos-13 # Intel Mac - cibw_archs: "x86_64" - deployment_target: "13.0" - openblas_path: "/usr/local/opt/openblas" - py_tag: "cp312" - - os: macos-13 # Intel Mac - cibw_archs: "x86_64" - deployment_target: "13.0" - openblas_path: "/usr/local/opt/openblas" - py_tag: "cp313" - # macOS Apple Silicon builds - - os: macos-latest # Apple Silicon Mac - cibw_archs: "arm64" - deployment_target: "15.0" - openblas_path: "/opt/homebrew/opt/openblas" - py_tag: "cp310" - - os: macos-latest # Apple Silicon Mac - cibw_archs: "arm64" - deployment_target: "15.0" - openblas_path: "/opt/homebrew/opt/openblas" - py_tag: "cp311" - - os: macos-latest # Apple Silicon Mac - cibw_archs: "arm64" - deployment_target: "15.0" - openblas_path: "/opt/homebrew/opt/openblas" - py_tag: "cp312" - - os: macos-latest # Apple Silicon Mac - cibw_archs: "arm64" - deployment_target: "15.0" - openblas_path: "/opt/homebrew/opt/openblas" - py_tag: "cp313" - steps: - - uses: actions/checkout@v5 - - name: remove python/.gitignore - shell: bash - run: | - rm -f python/.gitignore - - name: prepare build - shell: bash - run: | - cd python - python prepare_build.py - - uses: pypa/cibuildwheel@v3.2.1 - env: - CIBW_DEPENDENCY_VERSIONS: "latest" - CIBW_BUILD_VERBOSITY: 1 - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" - CIBW_BUILD: "${{ matrix.py_tag }}-*" - CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target || '11.0' }} SPARSEIR_USE_BLAS=1" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - CIBW_SKIP: "*-manylinux_i686 *-musllinux_i686" - # Install OpenBLAS using micromamba (conda-forge) - separate for manylinux and musllinux - CIBW_BEFORE_ALL_MANYLINUX: "curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps" - CIBW_BEFORE_ALL_MUSLLINUX: "apk add --no-cache bzip2 && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps" - CIBW_BEFORE_ALL_MACOS: "brew install openblas" - # Set environment variables to help CMake find OpenBLAS - CIBW_ENVIRONMENT_MANYLINUX: "SPARSEIR_USE_BLAS=1" - CIBW_ENVIRONMENT_MUSLLINUX: "SPARSEIR_USE_BLAS=1" - with: - package-dir: ./python - output-dir: dist - - uses: actions/upload-artifact@v5 - with: - name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.py_tag }} - path: dist/* - - publish-pypi: - needs: build-wheels - runs-on: ubuntu-latest - environment: - name: pypi - permissions: - id-token: write # Required for Trusted Publishing - contents: read - steps: - - uses: actions/download-artifact@v6 - with: - path: dist - merge-multiple: true - - name: Publish to PyPI (Trusted) - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist - repository-url: https://upload.pypi.org/legacy/ - verbose: true - skip-existing: true - attestations: false # Disable attestations due to Sigstore service issues \ No newline at end of file diff --git a/back/workflows/VersionConsistencyCheck.yml b/back/workflows/VersionConsistencyCheck.yml deleted file mode 100644 index dd19f239..00000000 --- a/back/workflows/VersionConsistencyCheck.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Version Consistency Check - -on: - pull_request: - branches: [main] - paths: - - 'include/sparseir/version.h' - - 'python/pyproject.toml' - - 'update_version.py' - push: - branches: [main] - paths: - - 'include/sparseir/version.h' - - 'python/pyproject.toml' - - 'update_version.py' - -jobs: - check-version-consistency: - runs-on: ubuntu-latest - name: Check Version Consistency - - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Check version consistency - run: | - echo "🔍 Checking version consistency across components..." - echo "==================================================" - echo - - python update_version.py - exit_code=$? - - echo - if [ $exit_code -eq 0 ]; then - echo "✅ All versions are consistent and in sync!" - echo " Ready for release process." - else - echo "❌ Version inconsistency detected!" - echo - echo "💡 To fix this issue:" - echo " 1. Run: python update_version.py " - echo " 2. Commit the changes: git add -A && git commit -m 'Fix version consistency'" - echo " 3. Push the changes to update this PR" - echo - echo "Example:" - echo " python update_version.py 0.4.3" - exit 1 - fi \ No newline at end of file diff --git a/back/workflows/conda.yml b/back/workflows/conda.yml deleted file mode 100644 index 3cdc7b67..00000000 --- a/back/workflows/conda.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build and upload conda packages - -# Triggered a new tag starting with "v" is pushed -on: - push: - tags: - - 'v*' - workflow_dispatch: - -jobs: - build: - runs-on: ${{ matrix.runner_label }} - strategy: - matrix: - include: - - name: ubuntu-x64 - runner_label: ubuntu-latest - - name: macos-arm64 - runner_label: macos-latest - - steps: - - uses: actions/checkout@v5 - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - - name: Conda info - shell: bash -el {0} - run: conda info - - name: Install dependencies - run: | - conda install conda-build anaconda-client -y - - - name: Bulid and upload - working-directory: python - env: - ANACONDA_API_TOKEN: ${{secrets.ANACONDA_TOKEN}} - run: | - python3 --version - conda config --set anaconda_upload yes - conda build conda-recipe --user SpM-lab --output-folder conda-bld diff --git a/build_capi_with_tests.sh b/build_capi_with_tests.sh new file mode 100644 index 00000000..786c0272 --- /dev/null +++ b/build_capi_with_tests.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Build backend/cxx and run C++ tests +# Build directory: backend/cxx/build + +set -e # Exit on error + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +echo -e "${GREEN}=== Building backend/cxx with tests ===${NC}" + +# Create build directory +BUILD_DIR="backend/cxx/build" +mkdir -p "$BUILD_DIR" + +# Configure CMake +echo -e "${YELLOW}Configuring CMake...${NC}" +cd "$BUILD_DIR" +cmake ../.. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DSPARSEIR_BUILD_TESTING=ON \ + -DSPARSEIR_USE_BLAS=OFF + +# Build +echo -e "${YELLOW}Building...${NC}" +cmake --build . -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + +# Run tests +echo -e "${YELLOW}Running C++ tests...${NC}" +ctest --output-on-failure --verbose + +echo -e "${GREEN}=== Build and test completed successfully ===${NC}" + diff --git a/sample_c/CMakeLists.txt b/capi_sample/CMakeLists.txt similarity index 100% rename from sample_c/CMakeLists.txt rename to capi_sample/CMakeLists.txt diff --git a/sample_c/README.md b/capi_sample/README.md similarity index 62% rename from sample_c/README.md rename to capi_sample/README.md index b304e992..2fc3d07c 100644 --- a/sample_c/README.md +++ b/capi_sample/README.md @@ -9,6 +9,9 @@ ## Build and run + +### Option 1: Build with pre-installed library + After installing the library, you can build the samples as follows: ```bash @@ -16,4 +19,17 @@ After installing the library, you can build the samples as follows: export SparseIR_DIR=$HOME/opt/libsparseir/share/cmake cmake -S . -B ./build cmake --build build --target test -``` \ No newline at end of file +``` + +### Option 2: Build C++ backend and samples together + +You can also build the C++ backend and run the samples in one go: + +```bash +./run_sample.sh +``` + +This script will: +1. Build the C++ backend with BLAS support in `work_cxx/` directory +2. Install the backend to the `install/` subdirectory +3. Build and run all sample programs \ No newline at end of file diff --git a/capi_sample/run_sample.sh b/capi_sample/run_sample.sh new file mode 100755 index 00000000..9d6e65d7 --- /dev/null +++ b/capi_sample/run_sample.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Build C++ backend with BLAS support and run samples +# Build directory: work_cxx + +set -e # Exit on error + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +echo -e "${GREEN}=== Building C++ backend with BLAS and running samples ===${NC}" + +# Create work_cxx directory structure +BUILD_DIR="work_cxx" +INSTALL_DIR="$BUILD_DIR/install" + +mkdir -p "$BUILD_DIR/build_backend" +mkdir -p "$INSTALL_DIR" + +# Step 1: Build C++ backend with BLAS +echo -e "${YELLOW}Building C++ backend with BLAS support...${NC}" +cd "$BUILD_DIR/build_backend" + +cmake ../../../backend/cxx \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="../../work_cxx/install" \ + -DSPARSEIR_USE_BLAS=ON \ + -DSPARSEIR_BUILD_TESTING=OFF + +cmake --build . -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) +cmake --install . + +cd ../.. + +# Step 2: Set SparseIR_DIR to point to the installed backend +export SparseIR_DIR="$(pwd)/work_cxx/install/share/cmake/SparseIR" + +# Clean build directory +rm -rf ./build +mkdir -p ./build + +echo -e "${YELLOW}Building samples...${NC}" +cmake -S . -B ./build + +echo -e "${YELLOW}Building sample executables...${NC}" +cmake --build build + +echo -e "${YELLOW}Running samples...${NC}" +cmake --build build --target test + +echo -e "${GREEN}=== All samples completed successfully ===${NC}" + diff --git a/sample_c/sample1.c b/capi_sample/sample1.c similarity index 98% rename from sample_c/sample1.c rename to capi_sample/sample1.c index 99121e57..c64092e9 100644 --- a/sample_c/sample1.c +++ b/capi_sample/sample1.c @@ -33,7 +33,7 @@ assert(sve != NULL); // Create a fermionic finite temperature basis with pre-computed SVE result // Use SPIR_STATISTICS_BOSONIC for bosonic basis int max_size = -1; -spir_basis* basis = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, kernel, sve, max_size, &status); +spir_basis* basis = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, epsilon, kernel, sve, max_size, &status); assert(status == SPIR_COMPUTATION_SUCCESS); assert(basis != NULL); diff --git a/sample_c/sample2.c b/capi_sample/sample2.c similarity index 89% rename from sample_c/sample2.c rename to capi_sample/sample2.c index 4c15720a..7fe4b4af 100644 --- a/sample_c/sample2.c +++ b/capi_sample/sample2.c @@ -32,11 +32,11 @@ assert(sve_logistic != NULL); // Create fermionic and bosonic finite temperature bases with pre-computed SVE result int max_size = -1; -spir_basis* basis_fermionic = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, logistic_kernel, sve_logistic, max_size, &status); +spir_basis* basis_fermionic = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, epsilon, logistic_kernel, sve_logistic, max_size, &status); assert(status == SPIR_COMPUTATION_SUCCESS); assert(basis_fermionic != NULL); -spir_basis* basis_bosonic = spir_basis_new(SPIR_STATISTICS_BOSONIC, beta, omega_max, logistic_kernel, sve_logistic, max_size, &status); +spir_basis* basis_bosonic = spir_basis_new(SPIR_STATISTICS_BOSONIC, beta, omega_max, epsilon, logistic_kernel, sve_logistic, max_size, &status); assert(status == SPIR_COMPUTATION_SUCCESS); assert(basis_bosonic != NULL); @@ -49,7 +49,7 @@ spir_sve_result* sve_regularized = spir_sve_result_new(regularized_kernel, epsil assert(status == SPIR_COMPUTATION_SUCCESS); assert(sve_regularized != NULL); -spir_basis* basis_regularized = spir_basis_new(SPIR_STATISTICS_BOSONIC, beta, omega_max, regularized_kernel, sve_regularized, max_size, &status); +spir_basis* basis_regularized = spir_basis_new(SPIR_STATISTICS_BOSONIC, beta, omega_max, epsilon, regularized_kernel, sve_regularized, max_size, &status); assert(status == SPIR_COMPUTATION_SUCCESS); assert(basis_regularized != NULL); diff --git a/sample_c/sample3.c b/capi_sample/sample3.c similarity index 98% rename from sample_c/sample3.c rename to capi_sample/sample3.c index 3bee9ea9..f8a683a2 100644 --- a/sample_c/sample3.c +++ b/capi_sample/sample3.c @@ -31,7 +31,7 @@ assert(sve_logistic != NULL); // Create fermionic and bosonic finite temperature bases with pre-computed SVE result int max_size = -1; -spir_basis* basis = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, kernel, sve_logistic, max_size, &status); +spir_basis* basis = spir_basis_new(SPIR_STATISTICS_FERMIONIC, beta, omega_max, epsilon, kernel, sve_logistic, max_size, &status); assert(status == SPIR_COMPUTATION_SUCCESS); assert(basis != NULL); diff --git a/julia/README b/julia/README new file mode 100644 index 00000000..e69de29b diff --git a/julia/YggdrasilCommitHelper.jl/Yggdrasil b/julia/YggdrasilCommitHelper.jl/Yggdrasil new file mode 160000 index 00000000..0d9490dd --- /dev/null +++ b/julia/YggdrasilCommitHelper.jl/Yggdrasil @@ -0,0 +1 @@ +Subproject commit 0d9490dd112afba3df175acbb8d50fade7cc674b