#494·infinigen

Compilation fails: 'NULL' undeclared identifier in FastNoiseLite.h

Author: DiegoGomesDGCreated May 13, 2026Updated Aug 4, 2026
Labelsbug

Describe the bug

Compilation fails when installing Infinigen with terrain support on macOS (Apple Silicon). The build process exits with multiple "use of undeclared identifier 'NULL'" errors in FastNoiseLite.h when compiling C++ code.

The error occurs during the make terrain step called by the build script.

Steps to Reproduce

  1. Clone the repository (commit 69211e1046e53345e3159792787a294714cc3a07)
  2. Create a fresh conda environment with Python 3.11
  3. Run pip install -e ".[terrain,vis]"

What version of the code were you using?

Commit: 69211e1046e53345e3159792787a294714cc3a07

What command did you run?

bash
pip install -e ".[terrain,vis]"

What are your FULL output logs?

build.log

If this is your first time running Infinigen, what are the full install logs?

bash
pip install -v -e ".[terrain,vis]" > build.log 2>&1

build.log

Platform

  • OS & OS Version: macOS 26.4.1 (25E253)
  • Model: MacBook Pro M2 Pro (Mac14,9)
  • Chip: Apple M2 Pro
  • CPU: 10-core (6 performance + 4 efficiency)
  • GPU: Apple M2 Pro (16-core integrated)
  • GPU Driver: Built-in Metal driver
  • RAM: 16 GB
  • Compiler: Apple Clang 17.0.0 (clang-1700.6.3.2)
  • Target: arm64-apple-darwin25.4.0
  • Thread model: posix

Additional Context

Error Summary

The build process fails when compiling infinigen/terrain/source/cpu/utils/FastNoiseLite.cpp due to undeclared identifier 'NULL' errors in the included header file FastNoiseLite.h.

Key error snippet from the build log:

In file included from source/cpu/utils/FastNoiseLite.cpp:12:
source/cpu/utils/../../common/utils/FastNoiseLite.h:279:25: error: use of undeclared identifier 'NULL'
  279 |     int *is_center_tile=NULL,
      |                         ^~~~
source/cpu/utils/../../common/utils/FastNoiseLite.h:280:25: error: use of undeclared identifier 'NULL'
  280 |     int *is_center_band=NULL
      |                         ^~~~
source/cpu/utils/../../common/utils/FastNoiseLite.h:289:25: error: use of undeclared identifier 'NULL'
  289 |     assert(distances != NULL);
      |                         ^~~~
source/cpu/utils/../../common/utils/FastNoiseLite.h:291:22: error: use of undeclared identifier 'NULL'
  291 |     if (positions != NULL) {
      |                      ^~~~

Full error log shows 20+ similar errors before compilation stops.

Analysis

  • The file FastNoiseLite.cpp is being compiled as C++ (by Apple Clang)
  • The header FastNoiseLite.h uses C-style NULL without including <cstddef> or <stddef.h>
  • This causes the compiler to not recognize NULL as a valid identifier
  • The error occurs on macOS ARM64 (Apple Silicon) but may affect other platforms with strict C++ compilation

Proposed Fix

I have identified the fix and plan to submit a Pull Request. Options:

  1. Replace all NULL with nullptr (more idiomatic for C++11 and later)
  2. Add #include <cstddef> at the top of FastNoiseLite.h (minimal change)

I would appreciate guidance on which approach the maintainers prefer.

Workaround

For anyone encountering this issue while waiting for the fix, they can manually add:

cpp
#include <cstddef>

at the top of infinigen/terrain/source/common/utils/FastNoiseLite.h

Then re-run:

bash
pip install -e ".[terrain,vis]"

Additional Notes

  • This is my first time installing Infinigen
  • The issue is reproducible on a clean environment
  • I am willing to submit a PR with the fix once confirmed

Related Files

  • infinigen/terrain/source/common/utils/FastNoiseLite.h
  • infinigen/terrain/source/cpu/utils/FastNoiseLite.cpp
  • scripts/install/compile_terrain.sh