Open
Conversation
1832b49 to
59ab170
Compare
fcaf2e3 to
d2fbfbc
Compare
- provide C enums - add atom and molecule types - add basis set and shell definitions - add molecule grid and runtime environment - add load balancer to C API - add molecular weights for C API - add functional class wrapping ExchCXX - add xc integrator and matrix type - add references for functionals - add support for reading and writing from HDF5 in C
There was a problem hiding this comment.
Pull request overview
This pull request adds Fortran/C bindings to GauXC to enable integration with legacy Fortran codes. The implementation introduces a C API layer and Fortran interfaces that bind to the C functions using iso_c_binding.
Changes:
- Added C API with headers and implementation for core functionality (molecule, basisset, matrix, integrator, etc.)
- Added Fortran modules that interface with the C API using
iso_c_binding - Updated build system to support optional C and Fortran API compilation via CMake options
- Added test coverage for C API interoperability in existing test files
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Added GAUXC_ENABLE_C and GAUXC_ENABLE_FORTRAN options with build logic |
| src/CMakeLists.txt | Conditional compilation of C/Fortran sources based on enabled features |
| include/gauxc/*.h | C API headers for all major components (molecule, basisset, matrix, integrator, etc.) |
| src/c_*.cxx | C API implementation wrapping C++ classes |
| src/.f90, src/.F90 | Fortran modules providing iso_c_binding interfaces to C API |
| include/gauxc/util/c_*.hpp | Helper utilities for C-C++ interop (pointer casting, conversions) |
| include/gauxc/gauxc_config.{h,f}.in | Configuration templates for C/Fortran feature detection |
| tests/moltypes_test.cxx | Added C API interoperability tests |
| src/external/c_hdf5_{read,write}.cxx | C API for HDF5 I/O operations |
| src/external/hdf5_{read,write}.f90 | Fortran wrappers for HDF5 operations |
Comments suppressed due to low confidence (1)
include/gauxc/gauxc_config.h.in:14
- The configuration macro
GAUXC_HAS_Cis defined in gauxc_config.f.in (line 1) but missing from gauxc_config.h.in. This creates an inconsistency where C/C++ code won't have access to theGAUXC_HAS_Cmacro to conditionally compile C API code, even though it's available in Fortran. Add#cmakedefine GAUXC_HAS_Cto gauxc_config.h.in.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #66