Closed brechtsanders closed 4 months ago
same here
when I compile with verbose mode, what is passed to compiler is -Dhwy_contrib_EXPORTS
not -Dhwy_EXPORTS
. So, according to highway_export.h, HWY_DLLEXPORT
is defined to __declspec(dllimport)
That is only true if HWY_SHARED_DEFINE
is not defined, because if it is HWY_DLLEXPORT
is empty, see the code from hwy/highway_export.h
I mentioned above.
https://github.com/google/highway/pull/413 would still be nice to have 😉
Apologies, I used the wrong macro: it should have been HWY_CONTRIB_DLLEXPORT for anything in hwy/contrib. Fixing shortly.
That aside, I'm not sure it actually makes sense to use shared libraries for Highway. There's not a lot of code that can actually go into the .so/.dll, and maybe it's more trouble than it is worth?
@kmilos we can certainly add the LANGUAGES CXX to CMakelists, I'm not sure the other prefix change is still relevant because we now instead set RUNTIME_OUTPUT_DIRECTORY?
I was suggesting at MSYS2 in the CI in general...
hm, when we last tried enabling it, there were numerous issues. Do you have any statistics on how many projects are using Highway with MSYS/MinGW? Would anyone be willing to help with these and future issues?
Do you have any statistics on how many projects are using Highway with MSYS/MinGW?
So far libjxl and libvips depend on it directly in the MSYS2 repo https://packages.msys2.org/package/mingw-w64-ucrt-x86_64-highway?repo=ucrt64 and then all of their clients. It's hard to tell who else uses it indirectly, outside the repo...
When building highway 1.2.0 on Windows using MinGW-w64 the shared build fails with the following error:
When looking at this section in
hwy/highway_export.h
:and this section in
CMakeLists.txt
:it's clear that
set(DLLEXPORT_TO_DEFINE "HWY_SHARED_DEFINE")
causesHWY_DLLEXPORT
to be defined as nothing instead of__declspec(dllexport)
.I was able to build successfully after changing
CMakeLists.txt
soHWY_SHARED_DEFINE
is not defined.