Undefined symbol in pyx-based package

I am trying to fix cupy in nixpkgs, and I’m stuck on an undefined symbol during the build phase.

cupy_backends/cuda/libs/cutensor.cpp:5717:17: error: ‘CUTENSOR_VERSION’ was not declared in this scope; did you mean ‘CUTENSOR_OP_SIN’?
 5717 |   __pyx_t_1 = ((CUTENSOR_VERSION < 0x2904) != 0);

Looking at the cupy source, it seems that the file in which this error is occurring is generated from a .pyx file, and CUTENSOR_VERSION is declared in that file, but not defined.

int CUTENSOR_VERSION

I cannot figure out how this should be defined by the build system. I’m not even sure how to patch the source to make this work under the nix builder, because the original source is pyx instead of plain C++.

1 Like