Skip to content

feat(core): add cleed core library target#69

Draft
Liam-Deacon wants to merge 3 commits intomasterfrom
feat/cleed-core
Draft

feat(core): add cleed core library target#69
Liam-Deacon wants to merge 3 commits intomasterfrom
feat/cleed-core

Conversation

@Liam-Deacon
Copy link
Owner

@Liam-Deacon Liam-Deacon commented Dec 31, 2025

Problem

  • Establish a library-first entry point to start decoupling core logic from CLI tools for WASM readiness.

Solution

  • Add in-memory curve helpers (alloc/free/copy/interp) to cleed_core.
  • Introduce a stub cleed_io library layer for future file parsing.
  • Wire new subdirectories into CMake + autotools build graphs.

Testing

  • cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
  • cmake --build build --target cleedCore cleedIO
  • python3 -m pre_commit run --all-files

Links

Follow-ups

  • Flesh out cleed_io readers/writers for legacy formats.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 31, 2025

Reviewer's Guide

Introduces a new cleed_core core library target (both CMake and autotools) with a minimal public header and a version helper, and wires it into the existing build system alongside the existing search/rfac components.

Class diagram for cleed_core public API

classDiagram
    class cleed_curve {
        +size_t n
        +double* E
        +double* I
    }

    class cleed_core_api {
        +const char* cleed_core_version()
    }

    class search_ver_h {
        +const char* SEARCH_VERSION
    }

    cleed_core_api ..> cleed_curve : uses
    cleed_core_api ..> search_ver_h : returns
Loading

File-Level Changes

Change Details Files
Add cleed_core shared/static library targets to the CMake build and link them against existing core computation libraries.
  • Create src/cleed_core/CMakeLists.txt defining cleedCore (SHARED) and cleedCoreStatic (STATIC) targets from cleed_core.c.
  • Expose src/include as a public include directory for the new targets so consumers can include cleed_core.h.
  • Link cleedCore to search and rfac, and cleedCoreStatic to searchStatic and rfacStatic.
  • Configure platform-specific install rules for the shared and static libraries, with DLLs/binaries in bin on Windows and shared libs in lib elsewhere.
src/cleed_core/CMakeLists.txt
Wire the new cleed_core component into the existing CMake and autotools build graphs.
  • Add ADD_SUBDIRECTORY(cleed_core) to the top-level src/CMakeLists.txt so the new library is built as part of the CMake project.
  • Extend SUBDIRS in src/Makefile.am to include cleed_core, integrating it into the autotools build.
src/CMakeLists.txt
src/Makefile.am
Define the public core library API surface and its implementation, currently limited to a curve struct and version helper.
  • Introduce src/include/cleed_core.h declaring the cleed_curve struct for in-memory LEED curves and the cleed_core_version() function, with C++-compatible linkage guards.
  • Implement cleed_core_version() in src/cleed_core/cleed_core.c to return the existing SEARCH_VERSION defined in search_ver.h.
  • Ensure the new source file includes the public header and search_ver.h to tie the core version to the search module version.
src/include/cleed_core.h
src/cleed_core/cleed_core.c
Add autotools targets for building and installing the cleed_core library in both static and libtool forms.
  • Create src/cleed_core/Makefile.am defining a static archive libcleedcore.a and a libtool library libcleedcore.la.
  • Configure platform-specific placement of the libtool library (bin on Windows, lib elsewhere) while using common sources for both static and libtool targets.
src/cleed_core/Makefile.am

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Dec 31, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link

codacy-production bot commented Dec 31, 2025

Codacy's Analysis Summary

5 new issues (≤ 0 issue)
0 new security issue
27 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

Add cleed_core library target with a minimal core API header and version helper.
Wire new subdirectory into CMake + autotools builds.

Tests: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release; cmake --build build --target cleedCore; python3 -m pre_commit run --all-files
Add in-memory curve helpers (alloc/free/copy/interp) to cleed_core.
Introduce a stub cleed_io library layer for future file parsing.
Wire new targets into CMake + autotools builds.

Tests: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release; cmake --build build --target cleedCore cleedIO; python3 -m pre_commit run --all-files
@Liam-Deacon Liam-Deacon changed the base branch from feat/search-bench to master January 9, 2026 11:30
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant