etaler / Etaler

A flexable HTM (Hierarchical Temporal Memory) framework with full GPU support.
BSD 3-Clause "New" or "Revised" License
89 stars 14 forks source link

Windows support. #1

Closed marty1885 closed 5 years ago

marty1885 commented 5 years ago

Currently Etaler is build-able on Windows using 64bit MSYS2. But the resulting library and test applications crash immediately after loading. It may be me mixing up 32-bit and 64-bit DLLs or an actual compiler bug. But I'm out of time for this. 😢

Possible solutions:

marty1885 commented 5 years ago

with ca5b080edc6fa001187f7d669a0b2f593f43715e. MSVC 2019 can build the main library under release. But fails when building as debug with Error: '_wassert' : ambiguous call to overloaded function. In SmallVector.hpp. The examples and tests won't build that MSVC can't find Etaler somehow.

rcrowder commented 5 years ago

Oh, sorry @marty1885 I've just seen this after sending you a Discord PM.

Here's the changes I made to get this working in Release config - https://github.com/etaler/Etaler/compare/master...rcrowder:MSVC-2019?expand=1

I'll have a look to see if I can help solve that assert issue..

marty1885 commented 5 years ago

@rcrowder. Thank you! I have now see the message. By the looks of your changes... Seems only static builds work? Hmm...

Would you mind making a PR when you feel your changes are ready. Building on Windows is an important feature, great work!

rcrowder commented 5 years ago

Ah yes, I forgot to mention that. I forced it to static builds just for ease of building the tests and examples. I'll need to try again with a dynamic library. It should work fine, just need to make sure that any exe that uses the dynamic library can find it properly. The CMake build changes can be modified, and left up to the user to decide between static and dynamic (default) library.

I need to tidy up the PR, and provide some CMake related quality of life changes. I.e. Potential to download CL and Catch2 header files, along with the potential to use CMake to git clone other dependencies (e.g. pcg-cpp and Cereal, possible FindTBB too). And ofc try a PR on my Macbook and a Ubuntu VM to make sure it still builds fine before any PR merge. Oh, and getting the Debug version to build..

rcrowder commented 5 years ago

@marty1885 I've added a PR linked to my branch and this Issue.

The changes have reverted back to the default of building an Etaler shared library, that's used by the tests and example. The changes in the PR have only been tested on Windows, I'll test them on Macbook and Linux VM soon.

The change in Error.hpp (https://github.com/etaler/Etaler/pull/17/files#diff-bfb32f475ccfc5c9cece3c17ad9977bd) moves the assert pre-processor macro outside of the Et namespace to fix the build errors with asserts.

I've simplified the TBB and OpenCL package finding in CMake. Still want to look at ExternalProject_Add CMake command to ease the way CL.hpp and Catch2 headers are downloaded and found.

I've used the simple CMake generate_export_header command to generate the appropriate DLL export macros. But only tagged structures, classes, globals, etc. that the current tests and examples need to build properly. Need to look and see whether a 'public' export visibility, rather than a 'hidden' visibility is possible.

There's a few other things to clean up before merge (e.g. remove catch.hpp file). And test all configurations (Debug/Release, CPU/GPU) on all three OS (Win, Linux, OSX).