jk-jeon / dragonbox

Reference implementation of Dragonbox in C++
Apache License 2.0
607 stars 39 forks source link

Add CI support for OSes and other architectures. #21

Closed Alexhuszagh closed 3 years ago

Alexhuszagh commented 3 years ago

Adds CI support for macOS and Windows, 64-bit ARM big and little-endian, 32-bit MIPS big and little-endian, and 64-bit RISC-V. I tried to avoid using my own project, xcross for this, but Dockcross doesn't seem to to support any big-endian, 64-bit targets, and zig cc currently has issues with some C++ code. I'm more than happy to switch to Dockcross if that's not required.

The builds are not run automatically for commits to the repository, however, they are run on PRs and when manually desired. This closes #20.

The actions for dockcross would be quite simple as well:

# Configure Dockcross
git clone https://github.com/dockcross/dockcross
cd dockcross
echo "docker run --rm dockcross/linux-armv7" > dockcross
chmod +x dockcross

# Build project
./dockcross cmake -Ssubproject/test -Bbuild/test -DCMAKE_BUILD_TYPE:STRING=Debug
./dockcross cmake --build build/test --config Debug

# Run tests
cd build/test
./dockcross qemu-arm ./verify_fast_multiplication
./dockcross qemu-arm ./verify_log_computation
./dockcross qemu-arm ./verify_magic_division
./dockcross qemu-arm ./test_all_shorter_interval_cases
./dockcross qemu-arm ./uniform_random_test
./dockcross qemu-arm ./verify_compressed_cache
./dockcross qemu-arm ./compute_required_cache_length

Note that the Qemu runner would change for each, so we'd also need to store that additionally in the matrix.

Alexhuszagh commented 3 years ago

In case if you're wondering, this is a diagnostic detail, but zig cc has improved support for C++, but the support still isn't there. We get an error of ld.lld: error: undefined symbol: vtable for __cxxabiv1::__function_type_info, which means that virtual tables aren't supported, nor is likely the C++ standard library. I'm using zig v0.8.0, which is the last minor release and therefore should have full support.

jk-jeon commented 3 years ago

Looks good, thanks a lot!