-
Notifications
You must be signed in to change notification settings - Fork 262
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
GraphBLAS: Check for ability to link with libdl. #838
GraphBLAS: Check for ability to link with libdl. #838
Conversation
The MSVC runners are failing with errors like the following:
That is probably a regression from 7c5caf6. |
I added a commit to (partly) revert 7c5caf6. |
A possible alternative is to rely on the |
cmake provides a handy variable for libdl, so you don't have to write your own test, see |
Most UNIX-like systems provide `dlopen` and similar functions in a library named libdl. On some platforms (like NetBSD), these functions are not in a library. They can be used in any dynamically linked program instead: https://man.netbsd.org/dlopen.3 Other platforms (e.g., IBM AIX) provide these functions in a differently named library (e.g., libld). Use the name of the library containing `dlopen` and similar functions as provided by CMake.
This (partly) reverts 7c5caf6 Static members of a class can be accessed without instantiating the class: https://en.cppreference.com/w/cpp/language/static That is conceptionally different from static data. They require `dllexport`/`dllimport` attributes to be correctly exported from dlls using MSVC.
@traversaro, @0-wiz-0: Thank you for the hint. I wasn't aware that I modified the PR to use that variable instead of the configure test. |
Yes, I had to add this to get the MATLAB interface on Windows to compile. The MATLAB interface is compiled inside MATLAB with Mongoose/MATLAB/mongoose_make.m. It failed to compile, with an error stating that static class members cannot be declspec'd like that. I could add an #ifdef MATLAB_MEX_FILE so the MONGOOSE_API is not used in those 4 lines if it's being compiled inside MATLAB. |
I'll merge this in and then add the #ifdef MATLAB_MEX_FILE for Mongoose. |
db3773a
into
DrTimothyAldenDavis:dev2
Could you please show the exact error message that you were seeing? |
Yes, I can post it shortly. My Windows machine is on campus and I'm at home just now. I added this: 9280868 which should fix the problem, and launched the CI. I'm using a 2019 version of VS, so that might be what's going on. |
I'm not sure yet if that is actually a good change. I'm suspecting that somehow there is a confusion between static and shared libraries... |
Scratch that. |
On some platforms (like NetBSD),
dlopen
and similar functions are not in a library. They can be used in any dynamically linked program instead:https://man.netbsd.org/dlopen.3
Use a feature test during configuration to check whether linking to libdl is necessary (or possible).
Fixes #837.