aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_settings.cmake13
-rw-r--r--default_build_settings.cmake15
-rw-r--r--dist/vespa.spec5
-rw-r--r--vespamalloc/src/tests/allocfree/CMakeLists.txt2
-rw-r--r--vespamalloc/src/tests/test1/CMakeLists.txt2
-rw-r--r--vespamalloc/src/vespamalloc/CMakeLists.txt8
6 files changed, 28 insertions, 17 deletions
diff --git a/build_settings.cmake b/build_settings.cmake
index ac4e86c2e81..c96a626ad0b 100644
--- a/build_settings.cmake
+++ b/build_settings.cmake
@@ -54,7 +54,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" ST
endif()
else()
set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
- set(VESPA_ATOMIC_LIB "atomic")
+ if(VESPA_OS_DISTRO_COMBINED STREQUAL "centos 8" OR
+ VESPA_OS_DISTRO_COMBINED STREQUAL "rhel 8.1")
+ set(VESPA_ATOMIC_LIB "")
+ else()
+ set(VESPA_ATOMIC_LIB "atomic")
+ endif()
set(VESPA_GCC_LIB "gcc")
set(VESPA_STDCXX_FS_LIB "stdc++fs")
endif()
@@ -79,7 +84,11 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -latomic -ldl")
endif()
else()
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id -latomic -ldl -Wl,-E")
+ if(VESPA_ATOMIC_LIB STREQUAL "")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id -ldl -Wl,-E")
+ else()
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id -latomic -ldl -Wl,-E")
+ endif()
endif()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic" )
diff --git a/default_build_settings.cmake b/default_build_settings.cmake
index 66fcf1b2e16..67d2be5917d 100644
--- a/default_build_settings.cmake
+++ b/default_build_settings.cmake
@@ -8,16 +8,17 @@ function(setup_vespa_default_build_settings_rhel_6_10)
set(DEFAULT_CMAKE_SHARED_LINKER_FLAGS "-lrt" PARENT_SCOPE)
endfunction()
-function(setup_vespa_default_build_settings_rhel_7_7)
- message("-- Setting up default build settings for rhel 7.7")
+function(setup_vespa_default_build_settings_rhel_7)
+ message("-- Setting up default build settings for rhel 7")
set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib64" "/usr/lib64/llvm7.0/lib" PARENT_SCOPE)
set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/llvm7.0" "/usr/include/openblas" PARENT_SCOPE)
set(DEFAULT_VESPA_LLVM_VERSION "7" PARENT_SCOPE)
endfunction()
-function(setup_vespa_default_build_settings_rhel_8_1)
- message("-- Setting up default build settings for rhel 8.1")
- set(DEFAULT_VESPA_LLVM_VERSION "7" PARENT_SCOPE)
+function(setup_vespa_default_build_settings_rhel_8)
+ message("-- Setting up default build settings for rhel 8")
+ set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/openblas" PARENT_SCOPE)
+ set(DEFAULT_VESPA_LLVM_VERSION "8" PARENT_SCOPE)
endfunction()
function(setup_vespa_default_build_settings_centos_7)
@@ -159,9 +160,9 @@ function(vespa_use_default_build_settings)
if(VESPA_OS_DISTRO_COMBINED STREQUAL "rhel 6.10")
setup_vespa_default_build_settings_rhel_6_10()
elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "rhel 7.7")
- setup_vespa_default_build_settings_rhel_7_7()
+ setup_vespa_default_build_settings_rhel_7()
elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "rhel 8.1")
- setup_vespa_default_build_settings_rhel_8_1()
+ setup_vespa_default_build_settings_rhel_8()
elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "centos 7")
setup_vespa_default_build_settings_centos_7()
elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "centos 8")
diff --git a/dist/vespa.spec b/dist/vespa.spec
index 26310c19750..aa0232fa421 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -38,9 +38,10 @@ BuildRequires: rh-maven35
%define _rhmaven35_enable /opt/rh/rh-maven35/enable
%endif
%if 0%{?el8}
-BuildRequires: gcc-c++
-BuildRequires: libatomic
+BuildRequires: gcc-toolset-9-gcc-c++
+BuildRequires: gcc-toolset-9-binutils
BuildRequires: maven
+%define _devtoolset_enable /opt/rh/gcc-toolset-9/enable
%endif
%if 0%{?fedora}
BuildRequires: gcc-c++
diff --git a/vespamalloc/src/tests/allocfree/CMakeLists.txt b/vespamalloc/src/tests/allocfree/CMakeLists.txt
index 52c0c03d079..34d402d0c60 100644
--- a/vespamalloc/src/tests/allocfree/CMakeLists.txt
+++ b/vespamalloc/src/tests/allocfree/CMakeLists.txt
@@ -21,7 +21,7 @@ vespa_add_executable(vespamalloc_linklist_test_app
$<TARGET_OBJECTS:vespamalloc_util>
DEPENDS
dl
- atomic
+ ${VESPA_ATOMIC_LIB}
)
vespa_add_test(NAME vespamalloc_allocfree_shared_test_app NO_VALGRIND COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/allocfree_test.sh BENCHMARK
DEPENDS vespamalloc_realloc_test_app vespamalloc_allocfree_shared_test_app vespamalloc_linklist_test_app
diff --git a/vespamalloc/src/tests/test1/CMakeLists.txt b/vespamalloc/src/tests/test1/CMakeLists.txt
index cbfb9543cda..cade2e092b4 100644
--- a/vespamalloc/src/tests/test1/CMakeLists.txt
+++ b/vespamalloc/src/tests/test1/CMakeLists.txt
@@ -3,6 +3,6 @@ vespa_add_executable(vespamalloc_testatomic_app TEST
SOURCES
testatomic.cpp
DEPENDS
- atomic
+ ${VESPA_ATOMIC_LIB}
)
vespa_add_test(NAME vespamalloc_testatomic_app NO_VALGRIND COMMAND vespamalloc_testatomic_app)
diff --git a/vespamalloc/src/vespamalloc/CMakeLists.txt b/vespamalloc/src/vespamalloc/CMakeLists.txt
index ac7fd300828..1fe550ad95a 100644
--- a/vespamalloc/src/vespamalloc/CMakeLists.txt
+++ b/vespamalloc/src/vespamalloc/CMakeLists.txt
@@ -5,7 +5,7 @@ vespa_add_library(vespamalloc
$<TARGET_OBJECTS:vespamalloc_util>
INSTALL lib64/vespa/malloc
DEPENDS
- atomic
+ ${VESPA_ATOMIC_LIB}
dl
)
vespa_add_library(vespamallocd
@@ -14,7 +14,7 @@ vespa_add_library(vespamallocd
$<TARGET_OBJECTS:vespamalloc_util>
INSTALL lib64/vespa/malloc
DEPENDS
- atomic
+ ${VESPA_ATOMIC_LIB}
dl
)
vespa_add_library(vespamallocdst16
@@ -23,7 +23,7 @@ vespa_add_library(vespamallocdst16
$<TARGET_OBJECTS:vespamalloc_util>
INSTALL lib64/vespa/malloc
DEPENDS
- atomic
+ ${VESPA_ATOMIC_LIB}
dl
)
vespa_add_library(vespamallocdst16_nl
@@ -32,7 +32,7 @@ vespa_add_library(vespamallocdst16_nl
$<TARGET_OBJECTS:vespamalloc_util>
INSTALL lib64/vespa/malloc
DEPENDS
- atomic
+ ${VESPA_ATOMIC_LIB}
dl
)
vespa_add_library(vespammap