Skip to content

Add C API and C# interop files #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from
Closed

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Apr 16, 2025

Add C API and C# interop files

This change adds a basic C API that allows access to Gemma functionality from other programming languages. The functionality is exposed via a shared library (DLL on Windows), with C++ interfaces and a basic C# interop wrapper included.

To build the DLL, use the windows-dll preset, which includes the C and C++ sources as follows:

cmake --preset windows-dll
cmake --build --config Release --preset windows-dll -j 4

This should generate a gemma.dll in <build-dir>/Release.

To build for non-Windows, the appropriate C++ DLL linking will need to be done to generate a shared library for the target OS.

Copy link

google-cla bot commented Apr 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service bot force-pushed the test_747940577 branch 2 times, most recently from d4ad4e3 to af17c96 Compare April 16, 2025 00:59
@copybara-service copybara-service bot changed the title C API for gemma-cpp, including shared library support for Windows Add C API and C# interop files Apr 16, 2025
@copybara-service copybara-service bot force-pushed the test_747940577 branch 13 times, most recently from e6b7caa to 1a135fe Compare April 22, 2025 17:23
@copybara-service copybara-service bot closed this Apr 22, 2025
@copybara-service copybara-service bot deleted the test_747940577 branch April 22, 2025 17:35
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.

0 participants