cactus-compute / cactus-compute/cactus

iOS/macOS xcframework: `import cactus` fails as shipped — bundled cactus_engine.h includes cactus_graph.h, which is not in the framework

Open Beginner friendly
#771 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6k
Forks
503
Avg merge
1d 18h
Merged PRs (30d)
4

Description

### Summary

The iOS/macOS xcframeworks produced by `apple/build.sh` bundle a single header, `cactus_engine.h`, whose first include is:

```c
#include "cactus_graph.h"
```

`cactus_graph.h` is not bundled into the framework (and is a C++ header), so `import cactus` fails to compile as shipped:

```
fatal error: 'cactus_graph.h' file not found
could not build module 'cactus'
```

### Repro

1. `bash apple/build.sh` (or `cactus build --apple`)
2. Add `apple/cactus-ios.xcframework` to an Xcode project per `bindings/swift/README.md`
3. `import cactus` in any Swift file → the error above (Xcode 27, iOS 27 SDK)

### Note

Nothing in the FFI declarations of `cactus_engine.h` references graph types — the C surface is self-contained. So either of these fixes works:

- drop the `#include "cactus_graph.h"` line from the header that gets bundled into the framework (what we do in our vendoring step), or
- bundle `cactus_graph.h` + its transitive includes (heavier, and it pulls C++ headers into a C module map).

Found while integrating the engine as a benchmark arm at commit `1ace6d78`; integration details in https://github.com/john-rocky/apple-silicon-llm-bench (`ios/BenchmarkApp/scripts/bootstrap.sh`, step 6).

Contributor guide

Open the contributing guide

Research direction

Run bash apple/build.sh first and inspect how it packages cactus_engine.h, then read bindings/swift/README.md for the intended framework integration. Confirm the generated xcframework can compile a Swift file containing import cactus without a missing cactus_graph.h error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios, macos, shell, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.