NumPower / numpower

PHP extension for efficient scientific computing and array manipulation with GPU support
https://numpower.org
Other
192 stars 4 forks source link

fix: Fixed double definition of envvar #31

Closed henrique-borba closed 1 year ago

henrique-borba commented 1 year ago

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Fix compilation error when using CUDA

2.607 ./numpower.c: In function 'zm_deactivate_ndarray':
2.608 ./numpower.c:4104:11: error: redefinition of 'envvar'
2.608      char *envvar = "NDARRAY_VCHECK";
2.608            ^~~~~~
2.608 ./numpower.c:4099:11: note: previous definition of 'envvar' was here
2.608      char *envvar = "NDARRAY_FREEBUFFER";
2.608            ^~~~~~
2.627 make: *** [Makefile:276: install-cuda] Error 1

What is the current behavior? (You can also link to an open issue here)

During compilation with CUDA enabled, the compiler fails because envvar ends up being declared twice.

What is the new behavior (if this is a feature change)?

Change envvar to envvar_vcheck for VCHECK to avoid declaring the variable twice.