From d4b55237cda1c61593c6f5e1f57c2c31eb70c72b Mon Sep 17 00:00:00 2001 From: Kevin Mooney Date: Thu, 31 Oct 2024 13:20:46 +0000 Subject: [PATCH] Various fixes for upcoming release GLIBCXX assertions are enabled by default on the latest versions of GCC, this introduces a dependency on the standard libarary which we prefer to avoid, so we disable them. This patch makes it explicit that the only supported compilers are GCC >= 11 and Clang >= 16. GCC 10 doesn't support bitcast and Clang 15 >doesn't support our use of concepts. Sometimes CMake installs libopenrng in a lib64 directory, so this patch makes the examples look for the library there as well. --- CMakeLists.txt | 5 ++++- README.md | 8 +++++--- examples/Makefile | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb0508..c9727f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,9 @@ if (NOT GIT_HASH) set(GIT_HASH 0) endif() +# Disable GLIBCXX assertions to avoid libstdc++ dependency +add_compile_definitions(_GLIBCXX_NO_ASSERTIONS) + if (WIN32) # Disable _CRT_SECURE and _CRT_NONSTDC for portability. We want to continue # using fopen, getpid, etc. on WIN32. @@ -96,4 +99,4 @@ endif() option(BUILD_DOCS "Build documentation" OFF) IF(BUILD_DOCS) add_subdirectory(docs) -endif() \ No newline at end of file +endif() diff --git a/README.md b/README.md index da0bf10..ded9d4f 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ to contribute to the development of OpenRNG, please see the ## Download, build and install OpenRNG -In this section, we assume that you have already installed the necessary build -tools. The steps below use CMake to configure the project and `make` to build -it. +Building OpenRNG requires either GCC >=11 or Clang >=16. The steps below use +CMake to configure the project and `make` to build it. To configure the project +with a compiler other than your system's default compiler, see the +[CMAKE_LANG_COMPILER](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html) +documentation. Clone the OpenRNG repository: diff --git a/examples/Makefile b/examples/Makefile index 578e48d..c12e80a 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -4,7 +4,7 @@ endif CFLAGS=-O3 -I${OPENRNG_ROOT}/include CXXFLAGS=${CFLAGS} -LDFLAGS=-L${OPENRNG_ROOT}/lib -lopenrng -lm +LDFLAGS=-L${OPENRNG_ROOT}/lib -L${OPENRNG_ROOT}/lib64 -lopenrng -lm all: pi skipahead sobol_joe_kuo -- GitLab