princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.16k stars 431 forks source link

‘NULL’ not declared when compiling on CentOS #170

Open RodenLuo opened 7 months ago

RodenLuo commented 7 months ago

Describe the bug

On a V100 GPU computing node of a cluster running CentOS, running USE_CUDA=1 bash install_terrain.sh got error: ‘NULL’ was not declared in this scope

Steps to Reproduce

What version of the code were you using?

commit a8ba86a394f8757586b4fb15252a3282e56a91de

What are your FULL output logs?

$ USE_CUDA=1 bash install_terrain.sh
compiled lib/cuda/utils/FastNoiseLite.so
compiled lib/cuda/elements/voronoi_rocks.so
compiled lib/cuda/elements/upsidedown_mountains.so
compiled lib/cuda/elements/ground.so
compiled lib/cuda/elements/warped_rocks.so
compiled lib/cuda/elements/mountains.so
compiled lib/cuda/elements/landtiles.so
compiled lib/cuda/elements/atmosphere.so
compiled lib/cuda/elements/waterbody.so
compiled lib/cuda/surfaces/chunkyrock.so
compiled lib/cuda/surfaces/cobble_stone.so
compiled lib/cuda/surfaces/cracked_ground.so
compiled lib/cuda/surfaces/dirt.so
compiled lib/cuda/surfaces/ice.so
compiled lib/cuda/surfaces/mountain.so
compiled lib/cuda/surfaces/mud.so
compiled lib/cuda/surfaces/sand.so
compiled lib/cuda/surfaces/sandstone.so
compiled lib/cuda/surfaces/snow.so
compiled lib/cuda/surfaces/soil.so
compiled lib/cuda/surfaces/stone.so
In file included from source/cpu/utils/FastNoiseLite.cpp:12:0:
source/cpu/utils/../../common/utils/FastNoiseLite.h:279:25: error: ‘NULL’ was not declared in this scope
     int *is_center_tile=NULL,
                         ^~~~
source/cpu/utils/../../common/utils/FastNoiseLite.h:280:25: error: ‘NULL’ was not declared in this scope
     int *is_center_band=NULL
                         ^~~~
In file included from source/cpu/utils/FastNoiseLite.cpp:7:0:
source/cpu/utils/../../common/utils/FastNoiseLite.h: In function ‘void Voronoi2D(float, float, int, float, float, int, float*, float*, int*, int, int*, int*)’:
source/cpu/utils/../../common/utils/FastNoiseLite.h:289:25: error: ‘NULL’ was not declared in this scope
     assert(distances != NULL);
                         ^
In file included from source/cpu/utils/FastNoiseLite.cpp:12:0:
source/cpu/utils/../../common/utils/FastNoiseLite.h: At global scope:
source/cpu/utils/../../common/utils/FastNoiseLite.h:436:25: error: ‘NULL’ was not declared in this scope
     int *is_center_tile=NULL
                         ^~~~
In file included from source/cpu/utils/FastNoiseLite.cpp:7:0:
source/cpu/utils/../../common/utils/FastNoiseLite.h: In function ‘void Voronoi(float, float, float, int, float, float, int, float*, float*, int*, int*)’:
source/cpu/utils/../../common/utils/FastNoiseLite.h:447:25: error: ‘NULL’ was not declared in this scope
     assert(distances != NULL);

Platform

Additional context

Thanks!

araistrick commented 3 months ago

I believe NULL should be defined in #include <cstddef> but I have not checked if FastNoise properly imports it. FastNoise was not written by us so I do not understand it well. @RodenLuo you could try adding the import and I would happily accept it as a PR if it improves portability. For now the only officially tested distros are ubuntu / redhat / springdale.

RodenLuo commented 3 months ago

Hi Alex, Thanks! I had then run it on a Ubuntu workstation and it was all fine, just no slurm jobs. Will have to be back on this a bit later. The CentOS cluster is under maintenance now. Feel free to close it.