---
title: "Compiling the Boundary-First-Flattening Library to Wasm"
url: https://daily.dev/posts/compiling-the-boundary-first-flattening-library-to-wasm-kmivlmhcg
source_url: https://cprimozic.net/notes/posts/compiling-boundary-first-flattening-to-wasm/
type: article
source: "Casey Primozic"
published: 2026-03-31T12:30:19.406Z
updated: 2026-03-31T12:58:55.641Z
tags: ["3d", "c++", "webassembly"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Compiling the Boundary-First-Flattening Library to Wasm

**[Casey Primozic](https://daily.dev/sources/cprimozic)** · 7 min read · 0 upvotes · 0 comments

## Summary

A detailed walkthrough of compiling the Boundary-First-Flattening (BFF) C++ library to WebAssembly for use in the browser. The process involves building OpenBLAS (with LAPACK) for Wasm using Emscripten, patching and building SuiteSparse against it, applying CMake and source code fixes to BFF itself (including a 32-bit size_t bug), and wrapping the result in a custom JS/TypeScript shim that exposes a single `unwrapUVs` function. The guide covers specific patches, CMake overrides, library placement for Emscripten's search path, and ES Module injection.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://cprimozic.net/notes/posts/compiling-boundary-first-flattening-to-wasm/>

## Similar posts on daily.dev

- [C\+\+ Compiler](https://daily.dev/posts/c-compiler-c54wugr6f) · Lobsters · 0 upvotes · 0 comments

---

Tags: [#3d](https://daily.dev/tags/3d), [#c++](https://daily.dev/tags/c++), [#webassembly](https://daily.dev/tags/webassembly)

[View this post on daily.dev](https://daily.dev/posts/compiling-the-boundary-first-flattening-library-to-wasm-kmivlmhcg)
