Closed robquill closed 3 weeks ago
Thank you for the contribution @robquill - this could make sense, but could you expand what this flag would do in context of the broader codebase? Asking as if it's more of a corner case for a particular use-case, it may make more sense adding this on the respective project cmake file as opposed to by default to the repo to all targets
My understanding is that building a shared object requires position-independent code (https://stackoverflow.com/questions/57649452/why-must-shared-libraries-be-position-independent-while-static-libraries-dont), so I could try only setting this option if -DKOMPUTE_OPT_BUILD_PYTHON=ON is set.
I don't think you can only set it e.g. for the Pybind11 module itself as that shared library is still built using the static libraries which would still contain position dependent code.
so I could try only setting this option if -DKOMPUTE_OPT_BUILD_PYTHON=ON is set
From my understanding position independent code is glowingly the default in more modern distros, and it may indeed be the case that restricting it to only -DKOMPUTE_OPT_BUILD_PYTHON=ON may be the way to go, as I can't think of a corner case at this stage (unless someone wants to build static vs dynamic version of python although haven't tried if possible)
so I could try only setting this option if -DKOMPUTE_OPT_BUILD_PYTHON=ON is set
From my understanding position independent code is glowingly the default in more modern distros, and it may indeed be the case that restricting it to only -DKOMPUTE_OPT_BUILD_PYTHON=ON may be the way to go, as I can't think of a corner case at this stage (unless someone wants to build static vs dynamic version of python although haven't tried if possible)
OK then, that is already done, so I think this should be good to go.
When attempting the build the Python bindings like this:
I get this error: