diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d8dbc76..94d2d4b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,6 +40,15 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-${{ matrix.version }} g++-${{ matrix.version }} + - name: Test installation + env: + CXX: g++-${{ matrix.version }} + run: | + cmake -S vir-simd -B cmake-build -DCMAKE_INSTALL_PREFIX:STRING=$HOME/vir-simd-cmake + cmake --build cmake-build --target install + cd vir-simd && make prefix=$HOME/vir-simd-make install + diff -r $HOME/vir-simd-cmake/include $HOME/vir-simd-make/include && echo "cmake and make installations match ✅" + - name: Run test suite env: CXX: g++-${{ matrix.version }} @@ -188,4 +197,4 @@ jobs: run: cmake -S vir-simd -B build -DCMAKE_BUILD_TYPE:STRING=Release - name: Compile test - run: cmake --build build --config Release + run: cmake --build build --config Release --target check diff --git a/CMakeLists.txt b/CMakeLists.txt index 2721bcd..9ffd3ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(vir-simd CXX) # Define main library @@ -37,10 +37,15 @@ install( FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ PATTERN "*.cpp" EXCLUDE) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + # Define test targets -add_library(vir-simd-test-stdlib vir/test.cpp) +add_library(vir-simd-test-stdlib EXCLUDE_FROM_ALL vir/test.cpp) target_link_libraries(vir-simd-test-stdlib PRIVATE vir-simd) -add_library(vir-simd-test-fallback vir/test.cpp) +add_library(vir-simd-test-fallback EXCLUDE_FROM_ALL vir/test.cpp) target_link_libraries(vir-simd-test-fallback PRIVATE vir-simd) target_compile_definitions(vir-simd-test-fallback PRIVATE VIR_DISABLE_STDX_SIMD) + +add_custom_target(check DEPENDS vir-simd-test-stdlib vir-simd-test-fallback) diff --git a/Makefile b/Makefile index 010cd92..12c234d 100644 --- a/Makefile +++ b/Makefile @@ -33,14 +33,21 @@ endif std=$(shell env CXX=$(CXX) ./latest_std_flag.sh) -version=$(shell grep '\' vir/simd_version.h | \ +version:=$(shell grep '\' vir/simd_version.h | \ sed -e 's/.*0x/0x/' -e 's/'\''//g' | \ (read v; echo $$((v/0x10000)).$$((v%0x10000/0x100)).$$((v%0x100));)) +version_patchlevel:=$(lastword $(subst ., ,$(version))) + +version_info=$(shell test $(version_patchlevel) -lt 100 && echo release || \ + (test $(version_patchlevel) -lt 190 && echo development || \ + (test $(version_patchlevel) -lt 200 && echo alpha $$(($(version_patchlevel)-189)) || \ + echo beta $$(($(version_patchlevel)-199))))) + check: check-extensions check-constexpr_wrapper testsuite-O2 testsuite-Os debug: - @echo "vir::simd_version: $(version)" + @echo "vir::simd_version: $(version) ($(version_info))" @echo "build_dir: $(build_dir)" @echo "triplet: $(triplet)" @echo "testflags: $(testflags)" @@ -80,7 +87,7 @@ testsuite-%: testsuite/$(build_dir)-%/Makefile @cat testsuite/$(build_dir)-$*/.simd.summary && rm testsuite/$(build_dir)-$*/.simd.summary install: - @echo "Installing vir::stdx::simd $(version) to $(includedir)/vir" + @echo "Installing vir::stdx::simd $(version) ($(version_info)) to $(includedir)/vir" install -d $(includedir)/vir install -m 644 -t $(includedir)/vir vir/*.h diff --git a/vir/simd_version.h b/vir/simd_version.h index aa65780..70aa2c3 100644 --- a/vir/simd_version.h +++ b/vir/simd_version.h @@ -13,7 +13,11 @@ #define VIR_HAVE_SPACESHIP 0 #endif -#define VIR_SIMD_VERSION 0x0'03'64 +// release >= 0x00 +// development >= 0x64 +// alpha >= 0xbe +// beta >= 0xc8 +#define VIR_SIMD_VERSION 0x0'03'c8 #define VIR_SIMD_VERSION_MAJOR (VIR_SIMD_VERSION / 0x10000) diff --git a/vir/test.cpp b/vir/test.cpp index 3cb1038..8b61415 100644 --- a/vir/test.cpp +++ b/vir/test.cpp @@ -20,8 +20,6 @@ #define SIMD_IS_CONSTEXPR_ENOUGH 0 #endif -static_assert(vir::simd_version == vir::simd_version_t{0,3,100}); -static_assert(vir::simd_version <= vir::simd_version_t{0,3,100}); static_assert(vir::simd_version >= vir::simd_version_t{0,3,100}); static_assert(vir::simd_version != vir::simd_version_t{0,3,0}); static_assert(vir::simd_version >= vir::simd_version_t{0,3,0});