HardwareIR / netlistDB

netlistDB - Intermediate format for digital hardware representation with graph database API
MIT License
29 stars 2 forks source link

msvc DLL workaround for templatized members #12

Open Nic30 opened 5 years ago

Nic30 commented 5 years ago

The windows DLL build forbids the usage of the templates for members. This is ridiculous as it says STL can not be used. And there is probably no workaround. http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html The fact that everything have to be marked manually with dllimport/export is smaller problem.

XVilka commented 5 years ago

I think it might be possible to use clang-cl for Windows then.

On Thu, Mar 7, 2019, 6:58 AM Nic30 notifications@github.com wrote:

The windows DLL build forbids the usage of the templates for members. This is ridiculous as it says STL can not be used. And there is probably no workaround. http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html The fact that everything have to be marked manually with dllimport/export is smaller problem.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HardwareIR/netlistDB/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMZ_XIR7D0OaTPk2fbCa9mVTNlHMSoPks5vUEgQgaJpZM4bh_h7 .

XVilka commented 5 years ago

See https://clang.llvm.org/docs/MSVCCompatibility.html and http://blog.llvm.org/2018/11/30-faster-windows-builds-with-clang-cl_14.html

The LLVM 8.0 release should happen quite soon, matter of days.

In this case there are might be some problems with meson - https://github.com/mesonbuild/meson/issues/4232 and https://github.com/mesonbuild/meson/issues/4232

Nic30 commented 5 years ago

MSVC out of Visual Studio is complete disaster. However it is possible to build as a static library. I try to use clang as it should be much better and it is also used by many.

Nic30 commented 5 years ago

And one funny thing, I was thinking that the current windows build does not work because there is some bug in impl. which appears only in windows.

It turns out that mt19937 the random generator works differently under windows so the values in test does not match...