-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Way to detect whether CHOLMOD is compiled with LGPL enabled #794
Comments
That would be a good idea to add. I could use cmake to configure cholmod.h with #define's that can be used to determine which modules are installed, and whether or not an GPL modules are installed. That would be better than adding target_compile_definitions in cmake. I could also add a user-callable function that returns true/false for any module, to query if it is installed, and true/false if any GPL modules are installed. |
That would be great. With this I can probably use some preprocessor directives to throw a compile time error if there is a problem with the licensing situation. Thank you for having a look at this. |
Some preprocessor flags that are conditionally set by the build rules of CHOLMOD affect which symbols are exported from the built libraries. Add the preprocessor flags that are used to guard function declarations in `cholmod.h` to the CMake targets and the pkg-config file. That way consumers of the library get only those declarations that are actually exported from the library when including `cholmod.h` in their code. Fixes DrTimothyAldenDavis#794.
I opened #795 that might help with this. |
Thanks for adding this. This works perfectly for me. |
Thank you for making this large collection of very useful libraries available.
I'm offering my users the ability to link my MIT licensed code to cholmod using cmake. For this purpose it is sometimes necessary to use CHOLMOD in LGPL mode, i.e. no supernodal, cuda etc. Otherwise the combined code becomes GPL, which is in some cases too restrictive. This means I'd like to build in a safety feature in my compilation process that requires the user to explicitly and knowingly enable the GPL features of CHOLMOD, or otherwise only allow linking to the LGPL version.
To do this in cmake I require a way to detect how CHOLMOD was compiled. However, the compile definitions are not carried over to the installed target as
add_compile_definitions(NGPL)
etc are used. Would it be possible to use something liketarget_compile_definitions(CHOLMOD PUBLIC NGPL)
instead (also for NSUPERNODAL), similar to how it is currently done forCHOLMOD_HAS_CUDA
. I believe this then should carry over to the cmake installed target. This would then automatically enable the #ifdef features in cholmod.h as well.Or is there perhaps another way to achieve what I need?
The text was updated successfully, but these errors were encountered: