Compare commits
16 Commits
4ecf1ef037
...
7929733978
Author | SHA1 | Date |
---|---|---|
Jason Volk | 7929733978 | |
Jason Volk | 1b67a12a5f | |
Jason Volk | 38c9a77a8f | |
Jason Volk | 8f4fe45034 | |
Jason Volk | c7a89fcd89 | |
Jason Volk | 5303e170d3 | |
Jason Volk | ffecc8bd22 | |
Jason Volk | d4b3a0db66 | |
Jason Volk | 38e77c64c6 | |
Jason Volk | b1c2576c20 | |
Jason Volk | ef930635de | |
Jason Volk | 02c862e4bc | |
Jason Volk | 674b6489a4 | |
Jason Volk | 999ef88b7f | |
Jason Volk | 7046010ff9 | |
Jason Volk | 92da7381ce |
322
configure.ac
322
configure.ac
|
@ -151,21 +151,25 @@ dnl Debugging mode
|
|||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to enable debugging)
|
||||
AC_ARG_ENABLE(debug, RB_HELP_STRING([--enable-debug], [Enable debugging suite for development]),
|
||||
AC_ARG_ENABLE(debug, RB_HELP_STRING([--enable-debug=[[no]]], [Enable debugging suite for development]),
|
||||
[
|
||||
debug=$enableval
|
||||
], [
|
||||
debug="no"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$debug])
|
||||
AM_CONDITIONAL([DEBUG], [[[[ "$debug" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF([DEBUG],
|
||||
[
|
||||
debug="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(DEBUG, 1)
|
||||
RB_DEFINE_UNQUOTED([DEBUG], [1], [Not configured for release when lit.])
|
||||
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise])
|
||||
], [
|
||||
debug="no"
|
||||
AC_MSG_RESULT([no])
|
||||
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release])
|
||||
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release; or > 0 otherwise])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]])
|
||||
|
||||
dnl
|
||||
dnl Compactness
|
||||
dnl
|
||||
|
@ -173,14 +177,19 @@ dnl
|
|||
AC_MSG_CHECKING(Optimize for size; strip symbols; force no debugging)
|
||||
AC_ARG_ENABLE(compact, RB_HELP_STRING([--enable-compact], [Optimize for size and compactness]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(COMPACT, 1)
|
||||
RB_DEFINE_UNQUOTED([COMPACT], [1], [Not configured for compactness when lit.])
|
||||
compact=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
compact="no"
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([COMPACT], [[[[ "$COMPACT" = "1" ]]]])
|
||||
AC_MSG_RESULT([$compact])
|
||||
AM_CONDITIONAL([COMPACT], [[[[ "$compact" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF([COMPACT],
|
||||
[
|
||||
AC_SUBST(COMPACT, 1)
|
||||
RB_DEFINE_UNQUOTED([COMPACT], [1], [Not configured for compactness when lit.])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Explicit assert switch for still using assert() without --enable-debug
|
||||
|
@ -189,26 +198,26 @@ dnl
|
|||
AC_MSG_CHECKING(whether to explicitly enable assertions)
|
||||
AC_ARG_ENABLE(assert, RB_HELP_STRING([--enable-assert], [Enable assertions without --enable-debug]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(ASSERT, 1)
|
||||
assert=$enableval
|
||||
AC_MSG_RESULT([$assert])
|
||||
], [
|
||||
AM_COND_IF(DEBUG,
|
||||
[
|
||||
AC_MSG_RESULT([no, but assertions are enabled anyway])
|
||||
AC_SUBST(ASSERT, 1)
|
||||
assert="yes"
|
||||
AC_MSG_RESULT([$assert, enabled by default with --enable-debug])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
assert="no"
|
||||
AC_MSG_RESULT([$assert])
|
||||
])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([ASSERT], [[[[ "$ASSERT" = "1" ]]]])
|
||||
AM_CONDITIONAL([ASSERT], [[[[ "$assert" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF(ASSERT,
|
||||
[
|
||||
assert="yes"
|
||||
assert_type="abort"
|
||||
AC_SUBST(ASSERT, 1)
|
||||
], [
|
||||
assert="no"
|
||||
CPPDEFINE([NDEBUG])
|
||||
])
|
||||
|
||||
|
@ -216,18 +225,17 @@ dnl
|
|||
dnl Switch to control the action of assert()
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to change the behavior of assertions)
|
||||
AC_ARG_WITH(assert, RB_HELP_STRING([--with-assert[[[=abort]]]], [Soften assertion behavior]),
|
||||
AC_MSG_CHECKING(what the result of a failed assertion implies)
|
||||
AC_ARG_WITH(assert, RB_HELP_STRING([--with-assert[[[=abort]]]], [Change assertion behavior]),
|
||||
[
|
||||
assert_type=$withval
|
||||
AC_MSG_RESULT([yes, "$assert_type"])
|
||||
AC_SUBST(ASSERT_TYPE, $assert_type)
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AM_COND_IF(ASSERT,
|
||||
[
|
||||
AC_MSG_RESULT([$assert_type])
|
||||
AC_SUBST(ASSERT_TYPE, $assert_type)
|
||||
|
||||
if [[ ! -z "$assert_type" ]]; then
|
||||
|
||||
if [[ "$assert_type" != "abort" ]]; then
|
||||
|
@ -243,6 +251,9 @@ AM_COND_IF(ASSERT,
|
|||
fi
|
||||
|
||||
fi
|
||||
], [
|
||||
AC_MSG_RESULT([nothing without assertions enabled])
|
||||
assert_type=""
|
||||
])
|
||||
|
||||
dnl
|
||||
|
@ -252,19 +263,25 @@ dnl
|
|||
AC_MSG_CHECKING(whether to explicitly enable optimized build)
|
||||
AC_ARG_ENABLE(optimize, RB_HELP_STRING([--enable-optimize], [Enable optimization even with --enable-debug]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(OPTIMIZE, 1)
|
||||
optimize=$enableval
|
||||
AC_MSG_RESULT([$optimize])
|
||||
], [
|
||||
AM_COND_IF(DEBUG,
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
optimize="no"
|
||||
AC_MSG_RESULT([$optimize, disabled by default with --enable-debug])
|
||||
], [
|
||||
AC_MSG_RESULT([no, but optimized build is enabled anyway])
|
||||
AC_SUBST(OPTIMIZE, 1)
|
||||
optimize="yes"
|
||||
AC_MSG_RESULT([$optimize])
|
||||
])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([OPTIMIZE], [[[[ "$OPTIMIZE" = "1" ]]]])
|
||||
AM_CONDITIONAL([OPTIMIZE], [[[[ "$optimize" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF([OPTIMIZE],
|
||||
[
|
||||
AC_SUBST(OPTIMIZE, 1)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Enable target clones code generation
|
||||
|
@ -273,16 +290,19 @@ dnl
|
|||
AC_MSG_CHECKING(whether to generate code for target clones)
|
||||
AC_ARG_ENABLE(clones, RB_HELP_STRING([--enable-clones], [Enable target clones generation]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(CLONES, 1)
|
||||
RB_DEFINE([CLONES], [1], [Function multi-versioning for different architectures])
|
||||
clones="yes"
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
clones="no"
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([CLONES], [[[[ "$CLONES" = "1" ]]]])
|
||||
AC_MSG_RESULT([$clones])
|
||||
AM_CONDITIONAL([CLONES], [[[[ "$clones" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF([CLONES],
|
||||
[
|
||||
AC_SUBST(CLONES, 1)
|
||||
RB_DEFINE([CLONES], [1], [Function multi-versioning for different architectures])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Explicit link-time-optimization switch
|
||||
|
@ -309,7 +329,6 @@ if test "$lto" = "yes"; then
|
|||
], [
|
||||
lto="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(LTO, 1)
|
||||
])
|
||||
], [
|
||||
lto="no"
|
||||
|
@ -323,7 +342,12 @@ else
|
|||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([LTO], [[[[ "$LTO" = "1" ]]]])
|
||||
AM_CONDITIONAL([LTO], [[[[ "$lto" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF([LTO],
|
||||
[
|
||||
AC_SUBST(LTO, 1)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Explicit optimization level switch
|
||||
|
@ -419,67 +443,74 @@ dnl Precompiled headers
|
|||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to enable precompiled headers)
|
||||
AC_ARG_ENABLE(pch, RB_HELP_STRING([--disable-pch], [Disable precompiled header generation]),
|
||||
AC_ARG_ENABLE(pch, RB_HELP_STRING([--enable-pch], [Enable precompiled header generation]),
|
||||
[
|
||||
build_pch=$enableval
|
||||
AC_MSG_RESULT([$enableval])
|
||||
], [
|
||||
build_pch="yes"
|
||||
CPPDEFINE([PCH])
|
||||
AC_MSG_RESULT([yes])
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$build_pch])
|
||||
AM_CONDITIONAL([BUILD_PCH], [[[[ "$build_pch" = "yes" ]]]])
|
||||
AM_CONDITIONAL([CLANG_PCH], [[[[ "$build_pch" = "yes" ]] && [[ $CXX = clang* ]]]])
|
||||
|
||||
AM_COND_IF([BUILD_PCH],
|
||||
[
|
||||
CPPDEFINE([PCH])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Generic Mode compilation
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to enable generic mode or tune for this host)
|
||||
AC_MSG_CHECKING(whether to enable generic mode or emit for this host)
|
||||
AC_ARG_ENABLE(generic, RB_HELP_STRING([--enable-generic], [Emit more generic code for pkg binaries]),
|
||||
[
|
||||
enable_generic="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
RB_DEFINE([GENERIC], [1], [Building binary tuned for generic architectures])
|
||||
], [
|
||||
enable_generic="no"
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_generic])
|
||||
AM_CONDITIONAL([GENERIC], [[[[ "$enable_generic" = "yes" ]]]])
|
||||
|
||||
dnl
|
||||
dnl Untuned Mode compilation
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to enable fully untuned mode)
|
||||
AC_ARG_ENABLE(untuned, RB_HELP_STRING([--enable-untuned], [Emit no special feature instructions]),
|
||||
AM_COND_IF([GENERIC],
|
||||
[
|
||||
enable_untuned="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
RB_DEFINE([UNTUNED], [1], [Building binary without extended-feature cpu instructions.])
|
||||
], [
|
||||
enable_untuned="no"
|
||||
AC_MSG_RESULT([no])
|
||||
RB_DEFINE([GENERIC], [1], [Building binary tuned for generic architectures])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([UNTUNED], [[[[ "$enable_untuned" = "yes" ]]]])
|
||||
dnl
|
||||
dnl Tuned compilation
|
||||
dnl
|
||||
|
||||
machine=""
|
||||
AC_MSG_CHECKING(whether to emit specific architecture features)
|
||||
AC_ARG_WITH(machine, RB_HELP_STRING([--with-machine], [Emit special feature instructions]),
|
||||
[
|
||||
if [[ "$withval" != "yes" ]]; then
|
||||
machine=$withval
|
||||
fi
|
||||
])
|
||||
|
||||
if [[ ! -z "$machine" ]]; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Disable third-party allocators
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to allow available third-party allocator libraries from being used)
|
||||
AC_ARG_ENABLE(malloc-libs, RB_HELP_STRING([--disable-malloc-libs], [Disable third-party dynamic memory libraries (jemalloc/tcmalloc/etc)]),
|
||||
AC_ARG_ENABLE(malloc-libs, RB_HELP_STRING([--enable-malloc-libs], [Enable third-party dynamic memory libraries (jemalloc/tcmalloc/etc)]),
|
||||
[
|
||||
use_malloc_libs=$enableval
|
||||
AC_MSG_RESULT([$enableval])
|
||||
], [
|
||||
use_malloc_libs="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$use_malloc_libs])
|
||||
AM_CONDITIONAL([MALLOC_LIBS], [[[[ "$use_malloc_libs" = "yes" ]]]])
|
||||
|
||||
dnl
|
||||
|
@ -493,6 +524,7 @@ AC_ARG_ENABLE(lowmem-compile, RB_HELP_STRING([--enable-lowmem-compile], [Enable
|
|||
lowmem_compile="no"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$lowmem_compile])
|
||||
AM_CONDITIONAL([LOWMEM_COMPILE], [[[[ $lowmem_compile = "yes" ]]]])
|
||||
|
||||
dnl
|
||||
|
@ -760,40 +792,66 @@ dnl
|
|||
dnl Machine Tuning
|
||||
dnl
|
||||
|
||||
TUNE_FLAGS=""
|
||||
AM_COND_IF([UNTUNED],
|
||||
MACHINE_FLAGS=""
|
||||
|
||||
dnl Initial machine
|
||||
machine_arch="native"
|
||||
machine_tune="native"
|
||||
AM_COND_IF([GENERIC],
|
||||
[
|
||||
machine_tuning="generic ${host_cpu} and untuned"
|
||||
RB_VAR_PREPEND([TUNE_FLAGS], ["-mno-default"])
|
||||
], [
|
||||
AM_COND_IF([GENERIC],
|
||||
machine_tune="generic"
|
||||
AS_CASE([$target_cpu],
|
||||
[x86_64],
|
||||
[
|
||||
machine_tuning="generic ${host_cpu}"
|
||||
RB_VAR_PREPEND([TUNE_FLAGS], ["-mtune=generic"])
|
||||
], [
|
||||
machine_tuning="${host_cpu} native"
|
||||
|
||||
AS_CASE([$host_cpu],
|
||||
[x86_64],
|
||||
[
|
||||
dnl AMD K10's SSE4a doesn't work with valgrind
|
||||
RB_VAR_PREPEND([TUNE_FLAGS], ["-mno-sse4a"])
|
||||
|
||||
dnl Not accepted by clang on aarch64
|
||||
RB_VAR_PREPEND([TUNE_FLAGS], ["-march=native"])
|
||||
])
|
||||
|
||||
RB_VAR_PREPEND([TUNE_FLAGS], ["-mtune=native"])
|
||||
machine_arch="x86-64"
|
||||
])
|
||||
])
|
||||
|
||||
RB_VAR_PREPEND([CXXFLAGS], ["$TUNE_FLAGS"])
|
||||
dnl Specific extension specification
|
||||
machine_feat=""
|
||||
for feature in $machine; do
|
||||
if [[ $(echo $feature | cut -d"=" -f1) == "arch" ]]; then
|
||||
machine_arch=$(echo $feature | cut -d"=" -f2)
|
||||
elif [[ $(echo $feature | cut -d"=" -f1) == "tune" ]]; then
|
||||
machine_tune=$(echo $feature | cut -d"=" -f2)
|
||||
else
|
||||
machine_feat="$feature $machine_feat"
|
||||
RB_VAR_PREPEND([MACHINE_FLAGS], ["-m${feature}"])
|
||||
fi
|
||||
done
|
||||
|
||||
dnl Ensures mtune=generic accompanies one of the generic march= options
|
||||
dnl even if --enable-generic wasn't given, otherwise gcc will reject.
|
||||
AM_COND_IF_NOT([GENERIC],
|
||||
[
|
||||
AS_CASE([$machine_arch],
|
||||
[x86-64*],
|
||||
[
|
||||
machine_tune="generic"
|
||||
], [
|
||||
machine_tune=$machine_arch
|
||||
])
|
||||
])
|
||||
|
||||
dnl Specific extension underrides
|
||||
AS_CASE([$target_cpu],
|
||||
[x86_64],
|
||||
[
|
||||
dnl AMD K10's SSE4a doesn't work with valgrind
|
||||
RB_VAR_PREPEND([MACHINE_FLAGS], ["-mno-sse4a"])
|
||||
])
|
||||
|
||||
RB_VAR_PREPEND([MACHINE_FLAGS], ["-mtune=$machine_tune"])
|
||||
RB_VAR_PREPEND([MACHINE_FLAGS], ["-march=$machine_arch"])
|
||||
|
||||
machine_tuning="${target_cpu} arch=$machine_arch tune=$machine_tune :$machine_feat"
|
||||
RB_VAR_PREPEND([CXXFLAGS], ["$MACHINE_FLAGS"])
|
||||
|
||||
dnl Get the target features for this build from gcc into a readable string
|
||||
AM_COND_IF([GCC],
|
||||
[
|
||||
_cxx=$(echo "${CXX}" | cut -d' ' -f1)
|
||||
_cmd="${_cxx} -Q --help=target ${TUNE_FLAGS}"
|
||||
_cmd="${_cxx} -Q --help=target ${MACHINE_FLAGS}"
|
||||
machine_features=$(${_cmd} | grep enabled | grep -v 'mno-')
|
||||
machine_features=$(printf "\n${machine_features}")
|
||||
])
|
||||
|
@ -803,7 +861,7 @@ AM_COND_IF([CLANG],
|
|||
[
|
||||
_flag=0
|
||||
_cxx=$(echo "${CXX}" | cut -d' ' -f1)
|
||||
_str=$(${_cxx} -E ${TUNE_FLAGS} - -### 2>&1)
|
||||
_str=$(${_cxx} -E ${MACHINE_FLAGS} - -### 2>&1)
|
||||
machine_features=""
|
||||
for i in $_str; do
|
||||
if [[ $i == '"-target-feature"' ]]; then
|
||||
|
@ -822,22 +880,24 @@ dnl
|
|||
dnl Compiler warnings
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(whether to disable warnings)
|
||||
AC_MSG_CHECKING(whether to enable warnings)
|
||||
AC_ARG_ENABLE(warnings,
|
||||
RB_HELP_STRING([--disable-warnings], [Disable all sorts of warnings like a rockstar]),
|
||||
RB_HELP_STRING([--enable-warnings], [Disable all sorts of warnings like a rockstar]),
|
||||
[
|
||||
AC_MSG_RESULT([$enableval])
|
||||
warnings="$enableval"
|
||||
warnings=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
warnings="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$warnings])
|
||||
AM_CONDITIONAL([WARNINGS], [[[[ "$warnings" = "yes" ]]]])
|
||||
|
||||
AC_DEFUN([RB_MAYBE_CWARN],
|
||||
[
|
||||
if test x"$warnings" == x"yes"; then
|
||||
AM_COND_IF([WARNINGS],
|
||||
[
|
||||
RB_MAYBE_CXXFLAG([$1], [$2])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
STACK_USAGE_WARNING=16384
|
||||
|
@ -956,10 +1016,13 @@ AM_COND_IF([DEBUG],
|
|||
])
|
||||
], [
|
||||
RB_MAYBE_CWARN([-Wno-unknown-pragmas], charybdis_cv_c_gcc_w_no_unknown_pragmas)
|
||||
RB_MAYBE_CWARN([-Wno-deprecated-declarations], charybdis_cv_c_gcc_w_no_deprecated_declarations)
|
||||
RB_MAYBE_CWARN([-Wno-deprecated], charybdis_cv_c_gcc_w_no_deprecated)
|
||||
|
||||
AM_COND_IF([CLANG],
|
||||
[
|
||||
RB_MAYBE_CWARN([-Wno-unknown-attributes], charybdis_cv_c_gcc_w_no_unknown_attributes)
|
||||
RB_MAYBE_CWARN([-Wno-uninitialized], charybdis_cv_c_gcc_w_no_uninitialized)
|
||||
])
|
||||
|
||||
AM_COND_IF([GCC],
|
||||
|
@ -980,6 +1043,7 @@ AC_MSG_CHECKING(whether to enable warning discovery)
|
|||
AC_ARG_ENABLE(every-warning,
|
||||
RB_HELP_STRING([--enable-every-warning], [Enable warning discovery (-Weverything)]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
RB_MAYBE_CWARN([-Weverything], charybdis_cv_c_gcc_w_everything)
|
||||
|
||||
dnl Ignored a priori
|
||||
|
@ -1017,9 +1081,11 @@ RB_HELP_STRING([--enable-every-warning], [Enable warning discovery (-Weverything
|
|||
dnl Ignored with issue high priority
|
||||
RB_MAYBE_CWARN([-Wno-reserved-identifier], charybdis_cv_c_gcc_w_no_reserved_identifier)
|
||||
RB_MAYBE_CWARN([-Wno-reserved-macro-identifier], charybdis_cv_c_gcc_w_no_reserved_macro_identifier)
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AM_COND_IF_NOT([UNTUNED],
|
||||
AM_COND_IF_NOT([GENERIC],
|
||||
[
|
||||
dnl When tuning for a specific target ignore the ABI compat warnings
|
||||
RB_MAYBE_CWARN([-Wno-psabi], charybdis_cv_c_gcc_w_psabi)
|
||||
|
@ -1117,7 +1183,7 @@ AC_TYPE_INTPTR_T
|
|||
AC_TYPE_UINTPTR_T
|
||||
|
||||
dnl C standard type sizes on this platform
|
||||
AC_CHECK_SIZEOF([char])
|
||||
RB_CHECK_SIZEOF([char], 1)
|
||||
AC_CHECK_SIZEOF([short])
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([float])
|
||||
|
@ -1343,19 +1409,20 @@ dnl
|
|||
dnl ip6
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ipv6, RB_HELP_STRING([--disable-ipv6], [Disable IPv6 support]),
|
||||
AC_ARG_ENABLE(ipv6, RB_HELP_STRING([--enable-ipv6], [Enable IPv6 support]),
|
||||
[
|
||||
ipv6=$enableval
|
||||
], [
|
||||
ipv6="yes"
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([HAVE_IPV6], [[[[ "$ipv6" = "yes" ]]]])
|
||||
AM_CONDITIONAL([IPV6], [[[[ "$ipv6" = "yes" ]]]])
|
||||
|
||||
AM_COND_IF(HAVE_IPV6,
|
||||
AM_COND_IF(IPV6,
|
||||
[
|
||||
AC_DEFINE([HAVE_IPV6], [1], [IPv6 is supported])
|
||||
],[])
|
||||
AC_SUBST(IPV6, 1)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl netdb / libnss_db
|
||||
|
@ -1414,12 +1481,14 @@ dnl
|
|||
|
||||
AM_COND_IF(LINUX,
|
||||
[
|
||||
AC_ARG_ENABLE(aio, RB_HELP_STRING([--disable-aio], [Disable kernel AIO support]),
|
||||
AC_ARG_ENABLE(aio, RB_HELP_STRING([--enable-aio], [Enable kernel AIO support]),
|
||||
[
|
||||
aio=$enableval
|
||||
], [
|
||||
aio=yes
|
||||
aio="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$aio])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([AIO], [test "x$aio" = "xyes" ])
|
||||
|
@ -1437,12 +1506,14 @@ dnl
|
|||
|
||||
AM_COND_IF(LINUX,
|
||||
[
|
||||
AC_ARG_ENABLE(iou, RB_HELP_STRING([--disable-iou], [Disable kernel io_uring support]),
|
||||
AC_ARG_ENABLE(iou, RB_HELP_STRING([--enable-iou], [Enable kernel io_uring support]),
|
||||
[
|
||||
iou=$enableval
|
||||
], [
|
||||
iou=yes
|
||||
iou="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$iou])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([IOU], [test "x$iou" = "xyes" ])
|
||||
|
@ -2311,20 +2382,15 @@ PKG_CHECK_MODULES(jemalloc, [jemalloc],
|
|||
])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to disable use of any found jemalloc)
|
||||
AC_ARG_ENABLE(jemalloc, RB_HELP_STRING([--disable-jemalloc], [Disable jemalloc as third-party dynamic memory manager]),
|
||||
AC_MSG_CHECKING(whether to enable use of any found jemalloc)
|
||||
AC_ARG_ENABLE(jemalloc, RB_HELP_STRING([--enable-jemalloc], [Enable jemalloc as dynamic memory manager]),
|
||||
[
|
||||
enable_jemalloc=$enableval
|
||||
if test "$enable_jemalloc" = "no"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
enable_jemalloc="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_jemalloc])
|
||||
AM_CONDITIONAL([JEMALLOC], [test "x$have_jemalloc" = "xyes" && test "x$enable_jemalloc" = "xyes" ])
|
||||
|
||||
dnl
|
||||
|
@ -2500,16 +2566,15 @@ dnl pop
|
|||
CPPFLAGS=$restore_cppflags
|
||||
LDFLAGS=$restore_ldflags
|
||||
|
||||
AC_MSG_CHECKING(whether to disable use of any found ROCm)
|
||||
AC_ARG_ENABLE(rocm, RB_HELP_STRING([--disable-rocm], [Disable ROCm support]),
|
||||
AC_MSG_CHECKING(whether to enable use of any found ROCm)
|
||||
AC_ARG_ENABLE(rocm, RB_HELP_STRING([--enable-rocm], [Enable ROCm support]),
|
||||
[
|
||||
AC_MSG_RESULT([$enableval])
|
||||
enable_rocm=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
enable_rocm="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_rocm])
|
||||
AM_CONDITIONAL([ROCM], [test "x$have_rocm" = "xyes" && test "x$enable_rocm" = "xyes" ])
|
||||
|
||||
AM_COND_IF([ROCM],
|
||||
|
@ -2566,16 +2631,15 @@ dnl pop
|
|||
CPPFLAGS=$restore_cppflags
|
||||
LDFLAGS=$restore_ldflags
|
||||
|
||||
AC_MSG_CHECKING(whether to disable use of any found GPA)
|
||||
AC_ARG_ENABLE(gpa, RB_HELP_STRING([--disable-gpa], [Disable GPA support]),
|
||||
AC_MSG_CHECKING(whether to enable use of any found GPA)
|
||||
AC_ARG_ENABLE(gpa, RB_HELP_STRING([--enable-gpa], [Enable GPA support]),
|
||||
[
|
||||
AC_MSG_RESULT([$enableval])
|
||||
enable_gpa=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
enable_gpa="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_gpa])
|
||||
AM_CONDITIONAL([GPA], [test "x$have_gpa" = "xyes" && test "x$enable_gpa" = "xyes" ])
|
||||
|
||||
AM_COND_IF([GPA],
|
||||
|
@ -2623,22 +2687,19 @@ PKG_CHECK_MODULES(OpenCL, [OpenCL],
|
|||
])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to disable use of any found OpenCL)
|
||||
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--disable-opencl], [Disable OpenCL support]),
|
||||
AC_MSG_CHECKING(whether to enable use of any found OpenCL)
|
||||
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--enable-opencl], [Enable OpenCL support]),
|
||||
[
|
||||
AC_MSG_RESULT([$enableval])
|
||||
enable_opencl=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
enable_opencl="yes"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable use of any found OpenCL)
|
||||
AC_MSG_RESULT([$enable_opencl])
|
||||
AM_CONDITIONAL([OPENCL], [test "x$have_opencl" = "xyes" && test "x$enable_opencl" = "xyes" ])
|
||||
|
||||
AM_COND_IF([OPENCL],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
IRCD_DEFINE(USE_OPENCL, [1], [OpenCL support is available and enabled])
|
||||
RB_VAR_APPEND([OPENCL_LIBS], ["-lOpenCL"])
|
||||
], [
|
||||
|
@ -2683,15 +2744,14 @@ PKG_CHECK_MODULES(armnn, [armnn],
|
|||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable use of any found ArmNN)
|
||||
AC_ARG_ENABLE(armnn, RB_HELP_STRING([--disable-armnn], [Disable Arm NN support]),
|
||||
AC_ARG_ENABLE(armnn, RB_HELP_STRING([--enable-armnn], [Enable Arm NN support]),
|
||||
[
|
||||
AC_MSG_RESULT([$enableval])
|
||||
enable_armnn=$enableval
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
enable_armnn="yes"
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$enable_armnn])
|
||||
AM_CONDITIONAL([ARMNN], [test "x$have_armnn" = "xyes" && test "x$enable_armnn" = "xyes" ])
|
||||
|
||||
AM_COND_IF([ARMNN],
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
FROM --platform=$TARGETPLATFORM alpine:3.16.1
|
||||
ARG dist_name alpine
|
||||
ARG dist_version 3.16
|
||||
|
||||
FROM --platform=$TARGETPLATFORM ${dist_name}:${dist_version}
|
||||
|
||||
ENV packages="\
|
||||
boost-chrono \
|
|
@ -1,8 +1,11 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG feature
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:alpine-3.16-${feature}-${TARGETARCH}
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-${feature}-${machine}
|
||||
|
||||
ARG cc
|
||||
ARG cxx
|
||||
|
@ -12,6 +15,7 @@ ARG extra_packages_dev2
|
|||
ARG rocksdb_version 7.4.3
|
||||
ARG rocksdb_url
|
||||
ARG ctor_url https://github.com/matrix-construct/construct
|
||||
ARG machine_spec
|
||||
|
||||
ENV CC ${cc}
|
||||
ENV CXX ${cxx}
|
||||
|
@ -20,12 +24,12 @@ ENV CONFIG_SHELL bash
|
|||
ENV rocksdb_version ${rocksdb_version}
|
||||
ENV rocksdb_url https://codeload.github.com/facebook/rocksdb/tar.gz/refs/tags/v${rocksdb_version}
|
||||
ENV ctor_url ${ctor_url}
|
||||
ENV machine_spec ${machine_spec}
|
||||
|
||||
ENV packages_dev="\
|
||||
${packages_dev} \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
autoconf2.13 \
|
||||
automake \
|
||||
bash \
|
||||
binutils-gold \
|
||||
|
@ -50,7 +54,7 @@ RUN true \
|
|||
&& ln -sv /usr/src/rocksdb construct/deps/rocksdb \
|
||||
&& cd /usr/src/construct \
|
||||
&& ./autogen.sh \
|
||||
&& (./configure --disable-iou || (cat config.log; exit 1)) \
|
||||
&& (./configure --disable-iou --enable-generic --with-machine="${machine_spec}" || (cat config.log; exit 1)) \
|
||||
&& make -j `nproc` EXTRA_LDFLAGS="-Wl,--strip-all" install \
|
||||
&& rm -rf /usr/src/rocksdb \
|
||||
&& rm -rf /usr/src/construct \
|
|
@ -1,7 +1,10 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:alpine-3.16-base-${TARGETARCH}
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-base-${machine}
|
||||
|
||||
ENV packages="\
|
||||
freetype \
|
|
@ -1,9 +1,12 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG feature
|
||||
ARG cc
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:alpine-3.16-${feature}-built-${cc}-${TARGETARCH}
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-${feature}-built-${cc}-${machine}
|
||||
|
||||
ENV ircd_mods_unload_check=false
|
||||
WORKDIR /root
|
|
@ -3,144 +3,195 @@
|
|||
BASEDIR=$(dirname "$0")
|
||||
ACCT=jevolk
|
||||
REPO=construct
|
||||
ctor_url="https://github.com/matrix-construct/construct"
|
||||
rocksdb_version=7.4.3
|
||||
|
||||
ARGS_=""
|
||||
ARGS_="$ARGS_ --compress=true"
|
||||
ARGS_="$ARGS_ --build-arg acct=$ACCT"
|
||||
ARGS_="$ARGS_ --build-arg repo=$REPO"
|
||||
ARGS_="$ARGS_ --build-arg ctor_url=$ctor_url"
|
||||
ARGS_="$ARGS_ --build-arg rocksdb_version=$rocksdb_version"
|
||||
CTOR_URL="https://github.com/matrix-construct/construct"
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
#export BUILDKIT_PROGRESS=plain
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Alpine 3.16
|
||||
#
|
||||
features="base full"
|
||||
distros="ubuntu-22.04 ubuntu-22.10 alpine-3.16 alpine-3.17"
|
||||
machines="arm64 amd64 amd64-avx amd64-avx2 amd64-avx512"
|
||||
toolchains="gcc-10 gcc-11 gcc-12 clang-14 clang-15"
|
||||
stages="built test"
|
||||
|
||||
#
|
||||
# L0 - Base featured image
|
||||
#
|
||||
matrix()
|
||||
{
|
||||
for feature_ in $features; do
|
||||
for distro_ in $distros; do
|
||||
for machine_ in $machines; do
|
||||
for toolchain_ in $toolchains; do
|
||||
for stage_ in $stages; do
|
||||
build $feature_ $distro_ $machine_ $toolchain_ $stage_
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-amd64 $BASEDIR/alpine/3.16/base
|
||||
build()
|
||||
{
|
||||
feature=$1
|
||||
distro=$2
|
||||
machine=$3
|
||||
toolchain=$4
|
||||
stage=$5
|
||||
|
||||
#
|
||||
# L1 - Fully featured image
|
||||
#
|
||||
dist_name=$(echo $distro | cut -d"-" -f1)
|
||||
dist_version=$(echo $distro | cut -d"-" -f2)
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-amd64 $BASEDIR/alpine/3.16/full
|
||||
args=""
|
||||
args="$args --compress=true"
|
||||
args="$args --build-arg acct=$ACCT"
|
||||
args="$args --build-arg repo=$REPO"
|
||||
args="$args --build-arg ctor_url=$CTOR_URL"
|
||||
args="$args --build-arg dist_name=${dist_name}"
|
||||
args="$args --build-arg dist_version=${dist_version}"
|
||||
args="$args --build-arg feature=${feature}"
|
||||
args="$args --build-arg machine=${machine}"
|
||||
|
||||
#
|
||||
# L2/L3 - Built/Test images
|
||||
#
|
||||
args_dist $dist_name $dist_version
|
||||
if test $? -ne 0; then return 1; fi
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=base"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=gcc"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=g++"
|
||||
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-gcc-amd64 $BASEDIR/alpine/3.16/built
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-gcc-amd64 $BASEDIR/alpine/3.16/test
|
||||
docker push $ACCT/$REPO:alpine-3.16-base-built-gcc-amd64
|
||||
args_toolchain $toolchain $dist_name $dist_version
|
||||
if test $? -ne 0; then return 1; fi
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=base"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=clang"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=llvm"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev2=llvm-dev"
|
||||
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-clang-amd64 $BASEDIR/alpine/3.16/built
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-clang-amd64 $BASEDIR/alpine/3.16/test
|
||||
docker push $ACCT/$REPO:alpine-3.16-base-built-clang-amd64
|
||||
args_machine $machine
|
||||
if test $? -ne 0; then return 1; fi
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=full"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=gcc"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=g++"
|
||||
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-gcc-amd64 $BASEDIR/alpine/3.16/built
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-gcc-amd64 $BASEDIR/alpine/3.16/test
|
||||
docker push $ACCT/$REPO:alpine-3.16-full-built-gcc-amd64
|
||||
args_platform $machine
|
||||
if test $? -ne 0; then return 1; fi
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=full"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=clang"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=llvm"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev2=llvm-dev"
|
||||
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-clang-amd64 $BASEDIR/alpine/3.16/built
|
||||
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-clang-amd64 $BASEDIR/alpine/3.16/test
|
||||
docker push $ACCT/$REPO:alpine-3.16-full-built-clang-amd64
|
||||
# Intermediate stage build; usually cached from prior iteration.
|
||||
tag="$ACCT/$REPO:${distro}-${feature}-${machine}"
|
||||
cmd="$args -t $tag $BASEDIR/${dist_name}/${feature}"
|
||||
docker build $cmd
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Ubuntu 22.04
|
||||
#
|
||||
# Leaf stage build; unique to each iteration.
|
||||
tag="$ACCT/$REPO:${distro}-${feature}-${stage}-${toolchain}-${machine}"
|
||||
cmd="$args -t $tag $BASEDIR/${dist_name}/${stage}"
|
||||
docker build $cmd
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# L0 - Base featured image
|
||||
#
|
||||
args_dist()
|
||||
{
|
||||
case $1 in
|
||||
alpine)
|
||||
case $2 in
|
||||
3.16)
|
||||
args="$args --build-arg rocksdb_version=7.2.2"
|
||||
return 0
|
||||
;;
|
||||
3.17)
|
||||
args="$args --build-arg rocksdb_version=7.7.3"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ubuntu)
|
||||
case $2 in
|
||||
22.04)
|
||||
args="$args --build-arg rocksdb_version=7.4.3"
|
||||
args="$args --build-arg boost_version=1.74"
|
||||
args="$args --build-arg icu_version=70"
|
||||
return 0
|
||||
;;
|
||||
22.10)
|
||||
args="$args --build-arg rocksdb_version=7.10.2"
|
||||
args="$args --build-arg boost_version=1.74"
|
||||
args="$args --build-arg icu_version=71"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-amd64 $BASEDIR/ubuntu/22.04/base
|
||||
args_toolchain()
|
||||
{
|
||||
_name=$(echo $1 | cut -d"-" -f1)
|
||||
_version=$(echo $1 | cut -d"-" -f2)
|
||||
|
||||
#
|
||||
# L1 - Fully featured image
|
||||
#
|
||||
case $2 in
|
||||
alpine)
|
||||
toolchain=$_name
|
||||
case $1 in
|
||||
gcc*)
|
||||
args="$args --build-arg extra_packages_dev=gcc"
|
||||
args="$args --build-arg extra_packages_dev1=g++"
|
||||
args="$args --build-arg cc=gcc --build-arg cxx=g++"
|
||||
return 0
|
||||
;;
|
||||
clang*)
|
||||
args="$args --build-arg extra_packages_dev=clang"
|
||||
args="$args --build-arg extra_packages_dev1=llvm"
|
||||
args="$args --build-arg extra_packages_dev2=llvm-dev"
|
||||
args="$args --build-arg cc=clang --build-arg cxx=clang++"
|
||||
test $3 != "3.16"
|
||||
return $?
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ubuntu)
|
||||
case $1 in
|
||||
gcc*)
|
||||
args="$args --build-arg extra_packages_dev=gcc-${_version}"
|
||||
args="$args --build-arg extra_packages_dev1=g++-${_version}"
|
||||
args="$args --build-arg cc=gcc-${_version} --build-arg cxx=g++-${_version}"
|
||||
return 0
|
||||
;;
|
||||
clang*)
|
||||
args="$args --build-arg extra_packages_dev=clang-${_version}"
|
||||
args="$args --build-arg extra_packages_dev1=llvm-${_version}-dev"
|
||||
args="$args --build-arg extra_packages_dev2=llvm-spirv-${_version}"
|
||||
args="$args --build-arg cc=clang-${_version} --build-arg cxx=clang++-${_version}"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-full-amd64 $BASEDIR/ubuntu/22.04/full
|
||||
args_machine()
|
||||
{
|
||||
case $1 in
|
||||
amd64)
|
||||
args="$args --build-arg machine_spec=arch=amdfam10"
|
||||
;;
|
||||
amd64-avx)
|
||||
args="$args --build-arg machine_spec=arch=sandybridge"
|
||||
args="$args --build-arg rocksdb_avx=1"
|
||||
;;
|
||||
amd64-avx2)
|
||||
args="$args --build-arg machine_spec=arch=haswell"
|
||||
args="$args --build-arg rocksdb_avx2=1"
|
||||
;;
|
||||
amd64-avx512)
|
||||
args="$args --build-arg machine_spec=arch=skylake-avx512"
|
||||
args="$args --build-arg rocksdb_avx2=1"
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# L2/L3 - Build/Built/Test
|
||||
#
|
||||
args_platform()
|
||||
{
|
||||
case $1 in
|
||||
amd64*)
|
||||
args="$args --platform linux/amd64"
|
||||
test $(uname -m) = "x86_64"
|
||||
return $?
|
||||
;;
|
||||
arm64*)
|
||||
args="$args --platform linux/arm64"
|
||||
test $(uname -m) = "aarch64"
|
||||
return $?
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=base"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=gcc-10"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=g++-10"
|
||||
ARGS="$ARGS --build-arg cc=gcc-10 --build-arg cxx=g++-10"
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-build-gcc-10-amd64 $BASEDIR/ubuntu/22.04/build
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-built-gcc-10-amd64 $BASEDIR/ubuntu/22.04/built
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-test-gcc-10-amd64 $BASEDIR/ubuntu/22.04/test
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-base-build-gcc-10-amd64
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-base-built-gcc-10-amd64
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=base"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=gcc-12"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=g++-12"
|
||||
ARGS="$ARGS --build-arg cc=gcc-12 --build-arg cxx=g++-12"
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-build-gcc-12-amd64 $BASEDIR/ubuntu/22.04/build
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-built-gcc-12-amd64 $BASEDIR/ubuntu/22.04/built
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-base-test-gcc-12-amd64 $BASEDIR/ubuntu/22.04/test
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-base-build-gcc-12-amd64
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-base-built-gcc-12-amd64
|
||||
|
||||
ARGS="$ARGS_"
|
||||
ARGS="$ARGS --platform linux/amd64"
|
||||
ARGS="$ARGS --build-arg feature=full"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev=clang-15"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev1=llvm-15-dev"
|
||||
ARGS="$ARGS --build-arg extra_packages_dev2=llvm-spirv-15"
|
||||
ARGS="$ARGS --build-arg cc=clang-15 --build-arg cxx=clang++-15"
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-full-build-clang-15-amd64 $BASEDIR/ubuntu/22.04/build
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-full-built-clang-15-amd64 $BASEDIR/ubuntu/22.04/built
|
||||
docker build $ARGS -t $ACCT/$REPO:ubuntu-22.04-full-test-clang-15-amd64 $BASEDIR/ubuntu/22.04/test
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-full-build-clang-15-amd64
|
||||
docker push $ACCT/$REPO:ubuntu-22.04-full-built-clang-15-amd64
|
||||
matrix
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
FROM ubuntu:20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y software-properties-common && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
autoconf2.13 \
|
||||
automake \
|
||||
autotools-dev \
|
||||
boost1.71 \
|
||||
build-essential \
|
||||
cmake \
|
||||
curl \
|
||||
git \
|
||||
libbz2-dev \
|
||||
liblz4-dev \
|
||||
libgraphicsmagick1-dev \
|
||||
libicu-dev \
|
||||
libjemalloc-dev \
|
||||
libmagic-dev \
|
||||
libnss-db \
|
||||
libsodium-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libzstd-dev \
|
||||
shtool \
|
||||
xz-utils && \
|
||||
apt-get purge -y software-properties-common && \
|
||||
apt-get clean && \
|
||||
apt-get autoremove --purge -y && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV ROCKSDB_VERSION=6.6.4
|
||||
|
||||
RUN \
|
||||
cd /usr/src && \
|
||||
curl -sL https://github.com/facebook/rocksdb/archive/v${ROCKSDB_VERSION}.tar.gz -o rocksdb-${ROCKSDB_VERSION}.tar.gz && \
|
||||
tar xfvz rocksdb-${ROCKSDB_VERSION}.tar.gz && \
|
||||
rm rocksdb-${ROCKSDB_VERSION}.tar.gz && \
|
||||
ln -s /usr/src/rocksdb-${ROCKSDB_VERSION} /usr/src/rocksdb && \
|
||||
cd /usr/src/rocksdb-${ROCKSDB_VERSION} && \
|
||||
CFLAGS="-g0" \
|
||||
cmake -H. -Bbuild \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DWITH_TESTS=0 \
|
||||
-DWITH_TOOLS=0 \
|
||||
-DUSE_RTTI=1 \
|
||||
-DWITH_LZ4=1 \
|
||||
-DWITH_GFLAGS=0 \
|
||||
-DBUILD_SHARED_LIBS=1 && \
|
||||
cmake --build build --target install && \
|
||||
rm -rf build
|
||||
|
||||
RUN mkdir /build
|
||||
WORKDIR /build
|
|
@ -1,10 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CC clang-10
|
||||
ENV CXX clang++-10
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y clang-10 llvm-10-dev \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CC clang-11
|
||||
ENV CXX clang++-11
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y clang-11 llvm-11-dev \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CC clang-12
|
||||
ENV CXX clang++-12
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y clang-12 llvm-12-dev \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CC clang-9
|
||||
ENV CXX clang++-9
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y clang-9 llvm-9-dev \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CXX g++-10
|
||||
ENV CC gcc-10
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y software-properties-common \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends -y g++-10 gcc-10 \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
|
@ -1,9 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CXX g++-8
|
||||
ENV CC gcc-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y g++-8 gcc-8 \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
|
@ -1,11 +0,0 @@
|
|||
FROM jevolk/construct:ubuntu-20.04
|
||||
|
||||
ENV CXX g++-9
|
||||
ENV CC gcc-9
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y software-properties-common \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends -y g++-9 gcc-9 \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
|
@ -1,35 +0,0 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG feature
|
||||
|
||||
FROM ${acct}/${repo}:ubuntu-22.04-${feature}-${TARGETARCH}
|
||||
|
||||
ARG cc
|
||||
ARG cxx
|
||||
ARG extra_packages_dev
|
||||
ARG extra_packages_dev1
|
||||
ARG extra_packages_dev2
|
||||
ARG ctor_url https://github.com/matrix-construct/construct
|
||||
|
||||
ENV CC ${cc}
|
||||
ENV CXX ${cxx}
|
||||
ENV ctor_url ${ctor_url}
|
||||
|
||||
ENV packages_dev="\
|
||||
${packages_dev} \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
autoconf2.13 \
|
||||
automake \
|
||||
autotools-dev \
|
||||
libtool \
|
||||
shtool \
|
||||
${extra_packages_dev} \
|
||||
${extra_packages_dev1} \
|
||||
${extra_packages_dev2} \
|
||||
"
|
||||
|
||||
RUN true \
|
||||
&& eval ${do_install} ${packages_dev} \
|
||||
&& eval ${do_clean} \
|
||||
&& true
|
|
@ -1,11 +0,0 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG feature
|
||||
ARG cc
|
||||
|
||||
FROM ${acct}/${repo}:ubuntu-22.04-${feature}-built-${cc}-${TARGETARCH}
|
||||
|
||||
WORKDIR /root
|
||||
RUN true \
|
||||
&& construct -debug -smoketest localhost \
|
||||
&& true
|
|
@ -0,0 +1,133 @@
|
|||
ARG dist_name ubuntu
|
||||
ARG dist_version 22.04
|
||||
|
||||
FROM --platform=$TARGETPLATFORM ${dist_name}:${dist_version}
|
||||
|
||||
ARG skiprocks
|
||||
ARG rocksdb_version 7.4.5
|
||||
ARG rocksdb_url
|
||||
ARG rocksdb_avx 0
|
||||
ARG rocksdb_avx2 0
|
||||
ARG boost_version 1.74
|
||||
ARG icu_version 70
|
||||
|
||||
ENV rocksdb_version ${rocksdb_version}
|
||||
ENV rocksdb_url https://codeload.github.com/facebook/rocksdb/tar.gz/refs/tags/v${rocksdb_version}
|
||||
ENV rocksdb_avx ${rocksdb_avx}
|
||||
ENV rocksdb_avx2 ${rocksdb_avx2}
|
||||
ENV boost_version ${boost_version}
|
||||
ENV icu_version ${icu_version}
|
||||
|
||||
ENV packages="\
|
||||
ca-certificates \
|
||||
libatomic1 \
|
||||
libjemalloc2 \
|
||||
libboost-chrono${boost_version}.0 \
|
||||
libboost-context${boost_version}.0 \
|
||||
libboost-coroutine${boost_version}.0 \
|
||||
libboost-system${boost_version}.0 \
|
||||
libboost-thread${boost_version}.0 \
|
||||
libicu${icu_version} \
|
||||
libnss-db \
|
||||
libsodium23 \
|
||||
libssl3 \
|
||||
liblz4-1 \
|
||||
libmagic1 \
|
||||
libzstd1 \
|
||||
"
|
||||
|
||||
ENV packages_rocksdb_dev="\
|
||||
build-essential \
|
||||
cmake \
|
||||
libjemalloc-dev \
|
||||
liblz4-dev \
|
||||
libzstd-dev \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
ENV packages_dev="\
|
||||
${packages_rocksdb_dev} \
|
||||
libboost-chrono${boost_version}-dev \
|
||||
libboost-context${boost_version}-dev \
|
||||
libboost-coroutine${boost_version}-dev \
|
||||
libboost-system${boost_version}-dev \
|
||||
libboost-thread${boost_version}-dev \
|
||||
libicu-dev \
|
||||
libmagic-dev \
|
||||
libsodium-dev \
|
||||
libssl-dev \
|
||||
"
|
||||
|
||||
ENV rocksdb_cmake="\
|
||||
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=1 \
|
||||
-DFAIL_ON_WARNINGS=0 \
|
||||
-DUSE_RTTI=1 \
|
||||
-DPORTABLE=1 \
|
||||
-DFORCE_AVX=${rocksdb_avx} \
|
||||
-DFORCE_AVX2=${rocksdb_avx2} \
|
||||
-DWITH_JNI=0 \
|
||||
-DWITH_TESTS=0 \
|
||||
-DWITH_BENCHMARK_TOOLS=0 \
|
||||
-DWITH_CORE_TOOLS=0 \
|
||||
-DWITH_GFLAGS=0 \
|
||||
-DWITH_LIBURING=0 \
|
||||
-DWITH_JEMALLOC=1 \
|
||||
-DWITH_LZ4=1 \
|
||||
-DWITH_ZSTD=1 \
|
||||
"
|
||||
|
||||
ENV do_install true \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends -y -f
|
||||
|
||||
ENV do_purge true \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get purge -y
|
||||
|
||||
ENV do_clean true \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get clean \
|
||||
&& apt-get autoremove --purge -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& true
|
||||
|
||||
ENV do_fetch_rocksdb true \
|
||||
&& eval ${do_install} curl \
|
||||
&& cd /usr/src \
|
||||
&& curl -sL ${rocksdb_url} -o rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& tar xfvz rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& rm rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& mv /usr/src/rocksdb-${rocksdb_version} /usr/src/rocksdb \
|
||||
&& cd - \
|
||||
&& eval ${do_purge} curl \
|
||||
&& true
|
||||
|
||||
RUN true \
|
||||
&& eval ${do_install} ${packages} \
|
||||
&& update-ca-certificates \
|
||||
&& eval ${do_clean} \
|
||||
&& mkdir /build \
|
||||
&& true
|
||||
|
||||
WORKDIR /build
|
||||
RUN true \
|
||||
&& if test -n "$skiprocks"; then \
|
||||
exit 0; \
|
||||
fi \
|
||||
&& eval ${do_install} ${packages_rocksdb_dev} \
|
||||
&& eval ${do_fetch_rocksdb} \
|
||||
&& cd /usr/src/rocksdb \
|
||||
&& \
|
||||
CFLAGS="-g0 -ftls-model=initial-exec" \
|
||||
LDFLAGS="-Wl,--strip-all" \
|
||||
cmake -H. -Bbuild ${rocksdb_cmake} \
|
||||
&& cmake --build build --target install --parallel `nproc` \
|
||||
&& rm -rf /usr/lib/$(uname -m)-linux-gnu/librocksdb.a \
|
||||
&& rm -rf /usr/src/rocksdb \
|
||||
&& eval ${do_purge} ${packages_rocksdb_dev} \
|
||||
&& eval ${do_clean} \
|
||||
&& true
|
|
@ -1,21 +1,29 @@
|
|||
FROM ubuntu:22.04
|
||||
ARG distribution
|
||||
|
||||
FROM --platform=$TARGETPLATFORM $distribution
|
||||
|
||||
ARG skiprocks
|
||||
ARG rocksdb_version 7.4.5
|
||||
ARG rocksdb_url
|
||||
ARG rocksdb_portable 1
|
||||
ARG rocksdb_avx 0
|
||||
ARG rocksdb_avx2 0
|
||||
|
||||
ENV rocksdb_version ${rocksdb_version}
|
||||
ENV rocksdb_url https://codeload.github.com/facebook/rocksdb/tar.gz/refs/tags/v${rocksdb_version}
|
||||
ENV rocksdb_portable ${rocksdb_portable}
|
||||
ENV rocksdb_avx ${rocksdb_avx}
|
||||
ENV rocksdb_avx2 ${rocksdb_avx2}
|
||||
|
||||
ENV packages="\
|
||||
ca-certificates \
|
||||
libatomic1 \
|
||||
libjemalloc2 \
|
||||
libboost-chrono1.74 \
|
||||
libboost-context1.74 \
|
||||
libboost-coroutine1.74 \
|
||||
libboost-system1.74 \
|
||||
libboost-thread1.74 \
|
||||
libboost-chrono1.74.0 \
|
||||
libboost-context1.74.0 \
|
||||
libboost-coroutine1.74.0 \
|
||||
libboost-system1.74.0 \
|
||||
libboost-thread1.74.0 \
|
||||
libicu70 \
|
||||
libnss-db \
|
||||
libsodium23 \
|
||||
|
@ -28,8 +36,6 @@ libzstd1 \
|
|||
ENV packages_rocksdb_dev="\
|
||||
build-essential \
|
||||
cmake \
|
||||
curl \
|
||||
git \
|
||||
libjemalloc-dev \
|
||||
liblz4-dev \
|
||||
libzstd-dev \
|
||||
|
@ -52,19 +58,22 @@ libssl-dev \
|
|||
ENV rocksdb_cmake="\
|
||||
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=1 \
|
||||
-DFAIL_ON_WARNINGS=0 \
|
||||
-DUSE_RTTI=1 \
|
||||
-DPORTABLE=${rocksdb_portable} \
|
||||
-DFORCE_AVX=${rocksdb_avx} \
|
||||
-DFORCE_AVX2=${rocksdb_avx2} \
|
||||
-DWITH_JNI=0 \
|
||||
-DWITH_TESTS=0 \
|
||||
-DWITH_BENCHMARK_TOOLS=0 \
|
||||
-DWITH_CORE_TOOLS=0 \
|
||||
-DFAIL_ON_WARNINGS=0 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DWITH_GFLAGS=0 \
|
||||
-DWITH_LIBURING=0 \
|
||||
-DWITH_JEMALLOC=1 \
|
||||
-DWITH_LZ4=1 \
|
||||
-DWITH_ZSTD=1 \
|
||||
-DUSE_RTTI=1 \
|
||||
-DBUILD_SHARED_LIBS=1 \
|
||||
"
|
||||
|
||||
ENV do_install true \
|
||||
|
@ -83,6 +92,17 @@ ENV do_clean true \
|
|||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& true
|
||||
|
||||
ENV do_fetch_rocksdb true \
|
||||
&& eval ${do_install} curl \
|
||||
&& cd /usr/src \
|
||||
&& curl -sL ${rocksdb_url} -o rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& tar xfvz rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& rm rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& mv /usr/src/rocksdb-${rocksdb_version} /usr/src/rocksdb \
|
||||
&& cd - \
|
||||
&& eval ${do_purge} curl \
|
||||
&& true
|
||||
|
||||
RUN true \
|
||||
&& eval ${do_install} ${packages} \
|
||||
&& update-ca-certificates \
|
||||
|
@ -96,18 +116,15 @@ RUN true \
|
|||
exit 0; \
|
||||
fi \
|
||||
&& eval ${do_install} ${packages_rocksdb_dev} \
|
||||
&& cd /usr/src \
|
||||
&& curl -sL ${rocksdb_url} -o rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& tar xfvz rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& rm rocksdb-${rocksdb_version}.tar.gz \
|
||||
&& ln -s /usr/src/rocksdb-${rocksdb_version} /usr/src/rocksdb \
|
||||
&& cd /usr/src/rocksdb-${rocksdb_version} \
|
||||
&& eval ${do_fetch_rocksdb} \
|
||||
&& cd /usr/src/rocksdb \
|
||||
&& \
|
||||
CFLAGS="-g0 -ftls-model=initial-exec" \
|
||||
LDFLAGS="-Wl,--strip-all" \
|
||||
cmake -H. -Bbuild ${rocksdb_cmake} \
|
||||
&& cmake --build build --target install --parallel `nproc` \
|
||||
&& rm -rf build \
|
||||
&& rm -rf /usr/lib/$(uname -m)-linux-gnu/librocksdb.a \
|
||||
&& rm -rf /usr/src/rocksdb \
|
||||
&& eval ${do_purge} ${packages_rocksdb_dev} \
|
||||
&& eval ${do_clean} \
|
||||
&& true
|
|
@ -1,8 +1,11 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG feature
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:ubuntu-22.04-${feature}-${TARGETARCH}
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-${feature}-${machine}
|
||||
|
||||
ARG cc
|
||||
ARG cxx
|
||||
|
@ -10,10 +13,12 @@ ARG extra_packages_dev
|
|||
ARG extra_packages_dev1
|
||||
ARG extra_packages_dev2
|
||||
ARG ctor_url https://github.com/matrix-construct/construct
|
||||
ARG machine_spec
|
||||
|
||||
ENV CC ${cc}
|
||||
ENV CXX ${cxx}
|
||||
ENV ctor_url ${ctor_url}
|
||||
ENV machine_spec ${machine_spec}
|
||||
|
||||
ENV packages_dev="\
|
||||
${packages_dev} \
|
||||
|
@ -22,6 +27,7 @@ autoconf-archive \
|
|||
autoconf2.13 \
|
||||
automake \
|
||||
autotools-dev \
|
||||
git \
|
||||
libtool \
|
||||
shtool \
|
||||
${extra_packages_dev} \
|
||||
|
@ -31,17 +37,18 @@ ${extra_packages_dev2} \
|
|||
|
||||
RUN true \
|
||||
&& eval ${do_install} ${packages_dev} \
|
||||
&& eval ${do_fetch_rocksdb} \
|
||||
&& git clone ${ctor_url} construct \
|
||||
&& cd construct \
|
||||
&& rmdir -v deps/rocksdb \
|
||||
&& ln -sv /usr/src/rocksdb deps \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& ./configure --enable-generic --with-machine="${machine_spec}" \
|
||||
&& make -j `nproc` \
|
||||
&& make install \
|
||||
&& cd .. \
|
||||
&& rm -rf construct \
|
||||
&& rm -rf /usr/src/rocksdb* \
|
||||
&& rm -rf /usr/src/rocksdb \
|
||||
&& eval ${do_purge} ${packages_dev} \
|
||||
&& eval ${do_clean} \
|
||||
&& true
|
|
@ -1,7 +1,10 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:ubuntu-22.04-base-${TARGETARCH}
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-base-${machine}
|
||||
|
||||
ENV packages="\
|
||||
libgraphicsmagick-q16-3 \
|
|
@ -0,0 +1,14 @@
|
|||
ARG acct
|
||||
ARG repo
|
||||
ARG dist_name
|
||||
ARG dist_version
|
||||
ARG feature
|
||||
ARG cc
|
||||
ARG machine
|
||||
|
||||
FROM ${acct}/${repo}:${dist_name}-${dist_version}-${feature}-built-${cc}-${machine}
|
||||
|
||||
WORKDIR /root
|
||||
RUN true \
|
||||
&& construct -debug -smoketest localhost \
|
||||
&& true
|
|
@ -44,8 +44,8 @@ namespace ircd::b64
|
|||
size_t encode_unpadded_size(const const_buffer &in) noexcept;
|
||||
|
||||
const_buffer decode(const mutable_buffer out, const string_view in);
|
||||
string_view encode_unpadded(const mutable_buffer out, const const_buffer in, const dictionary & = dict_rfc1421) noexcept;
|
||||
string_view encode(const mutable_buffer out, const const_buffer in, const dictionary & = dict_rfc1421) noexcept;
|
||||
string_view encode_unpadded(const mutable_buffer out, const const_buffer in, const dictionary = dict_rfc1421) noexcept;
|
||||
string_view encode(const mutable_buffer out, const const_buffer in, const dictionary = dict_rfc1421) noexcept;
|
||||
}
|
||||
|
||||
inline size_t
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace ircd::info::hardware::x86
|
|||
extern const string_view vendor;
|
||||
extern const bool sse, sse2, sse3, ssse3, sse4a, sse4_1, sse4_2;
|
||||
extern const bool avx, avx2, avx512f;
|
||||
extern const bool tsc, tsc_constant;
|
||||
extern const bool tsc, tsc_constant, tsc_nonstop;
|
||||
}
|
||||
|
||||
namespace ircd::info::hardware::arm
|
||||
|
|
|
@ -24,23 +24,24 @@ namespace ircd::simd
|
|||
/// T = inner aligned type
|
||||
template<class T>
|
||||
struct
|
||||
__attribute__((packed))
|
||||
__attribute__((aligned(1)))
|
||||
__attribute__((visibility("internal")))
|
||||
[[using clang: internal_linkage, nodebug]]
|
||||
[[using gnu: packed, aligned(1), visibility("internal")]]
|
||||
ircd::simd::unaligned
|
||||
{
|
||||
using value_type = T;
|
||||
|
||||
T val;
|
||||
|
||||
operator T() const
|
||||
[[gnu::always_inline]]
|
||||
operator T() const noexcept
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
unaligned(U&& val)
|
||||
:val(std::forward<U>(val))
|
||||
[[gnu::always_inline]]
|
||||
unaligned(const U val) noexcept
|
||||
:val(val)
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
|
@ -140,6 +140,34 @@ struct is_specialization_of<T<args...>, T>
|
|||
:std::true_type
|
||||
{};
|
||||
|
||||
//
|
||||
// Convenience signedness cast template
|
||||
//
|
||||
|
||||
template<class T>
|
||||
using enable_if_s2u = std::enable_if<std::is_signed<T>::value, typename std::make_unsigned<T>::type>;
|
||||
|
||||
template<class T>
|
||||
[[using gnu: always_inline, gnu_inline, artificial]]
|
||||
extern inline typename enable_if_s2u<T>::type *
|
||||
sign_cast(T *const t)
|
||||
{
|
||||
using type = typename std::make_unsigned<T>::type;
|
||||
return reinterpret_cast<type *>(t);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
using enable_if_u2s = std::enable_if<std::is_unsigned<T>::value, typename std::make_signed<T>::type>;
|
||||
|
||||
template<class T>
|
||||
[[using gnu: always_inline, gnu_inline, artificial]]
|
||||
extern inline typename enable_if_u2s<T>::type *
|
||||
sign_cast(T *const t)
|
||||
{
|
||||
using type = typename std::make_signed<T>::type;
|
||||
return reinterpret_cast<type *>(t);
|
||||
}
|
||||
|
||||
//
|
||||
// Convenience const_cast deduction template
|
||||
//
|
||||
|
|
113
ircd/b64.cc
113
ircd/b64.cc
|
@ -29,7 +29,7 @@ namespace ircd::b64
|
|||
static u8x64 decode_block(const u8x64 block, i64x8 &__restrict__ err) noexcept;
|
||||
|
||||
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
|
||||
static u8x64 encode_block(const u8x64 block, const dictionary &) noexcept;
|
||||
static u8x64 encode_block(const u8x64 block, const dictionary) noexcept;
|
||||
}
|
||||
#pragma GCC visibility pop
|
||||
|
||||
|
@ -157,7 +157,7 @@ alignas(64)
|
|||
ircd::string_view
|
||||
ircd::b64::encode(const mutable_buffer out,
|
||||
const const_buffer in,
|
||||
const dictionary &dict)
|
||||
const dictionary dict)
|
||||
noexcept
|
||||
{
|
||||
const auto pads
|
||||
|
@ -193,19 +193,9 @@ noexcept
|
|||
ircd::string_view
|
||||
ircd::b64::encode_unpadded(const mutable_buffer out,
|
||||
const const_buffer in,
|
||||
const dictionary &dict)
|
||||
const dictionary dict)
|
||||
noexcept
|
||||
{
|
||||
char *const __restrict__ dst
|
||||
{
|
||||
data(out)
|
||||
};
|
||||
|
||||
const char *const __restrict__ src
|
||||
{
|
||||
data(in)
|
||||
};
|
||||
|
||||
const size_t res_len
|
||||
{
|
||||
encode_unpadded_size(in)
|
||||
|
@ -216,38 +206,49 @@ noexcept
|
|||
std::min(res_len, size(out))
|
||||
};
|
||||
|
||||
u8x64 block {0};
|
||||
size_t i(0), j(0);
|
||||
for(; i < size(in) / 48 && i < out_len / 64; ++i)
|
||||
uint i;
|
||||
for(i = 0; i < size(in) / 48 && i < out_len / 64; ++i)
|
||||
{
|
||||
// Destination is indexed at 64 byte stride
|
||||
const auto di
|
||||
u512x1_u *const __restrict__ dx
|
||||
{
|
||||
reinterpret_cast<u512x1_u *__restrict__>(dst + (i * 64))
|
||||
reinterpret_cast<u512x1_u *>(data(out))
|
||||
};
|
||||
|
||||
// Source is indexed at 48 byte stride
|
||||
const auto si
|
||||
const auto *const __restrict__ si
|
||||
{
|
||||
reinterpret_cast<const u512x1_u *__restrict__>(src + (i * 48))
|
||||
data(in) + i * 48
|
||||
};
|
||||
|
||||
block = *si;
|
||||
u8x64 block {0};
|
||||
#pragma clang loop vectorize(enable) unroll(full)
|
||||
for(uint j(0); j < 48; ++j)
|
||||
block[j] = si[j];
|
||||
|
||||
block = encode_block(block, dict);
|
||||
*di = block;
|
||||
dx[i] = block;
|
||||
}
|
||||
|
||||
for(; i * 48 < size(in) && i * 64 < out_len; ++i)
|
||||
{
|
||||
#if !defined(__AVX__)
|
||||
#pragma clang loop unroll_count(2)
|
||||
#endif
|
||||
for(j = 0; j < 48 && i * 48 + j < size(in); ++j)
|
||||
block[j] = src[i * 48 + j];
|
||||
auto *const __restrict__ di
|
||||
{
|
||||
data(out) + i * 64
|
||||
};
|
||||
|
||||
const auto *const __restrict__ si
|
||||
{
|
||||
data(in) + i * 48
|
||||
};
|
||||
|
||||
u8x64 block {0};
|
||||
for(uint j(0); j < 48 && i * 48 + j < size(in); ++j)
|
||||
block[j] = si[j];
|
||||
|
||||
block = encode_block(block, dict);
|
||||
for(j = 0; j < 64 && i * 64 + j < out_len; ++j)
|
||||
dst[i * 64 + j] = block[j];
|
||||
for(uint j(0); j < 64 && i * 64 + j < out_len; ++j)
|
||||
di[j] = block[j];
|
||||
}
|
||||
|
||||
return string_view
|
||||
|
@ -270,7 +271,7 @@ noexcept
|
|||
[[IRCD_CLONES(IRCD_B64_TARGETS)]]
|
||||
ircd::u8x64
|
||||
ircd::b64::encode_block(const u8x64 in,
|
||||
const dictionary &dict)
|
||||
const dictionary dict)
|
||||
noexcept
|
||||
{
|
||||
size_t i, j, k;
|
||||
|
@ -319,16 +320,6 @@ ircd::const_buffer
|
|||
ircd::b64::decode(const mutable_buffer out,
|
||||
const string_view in)
|
||||
{
|
||||
char *const __restrict__ dst
|
||||
{
|
||||
data(out)
|
||||
};
|
||||
|
||||
const char *const __restrict__ src
|
||||
{
|
||||
data(in)
|
||||
};
|
||||
|
||||
const size_t pads
|
||||
{
|
||||
endswith_count(in, '=')
|
||||
|
@ -344,39 +335,51 @@ ircd::b64::decode(const mutable_buffer out,
|
|||
std::min(decode_size(in_len), size(out))
|
||||
};
|
||||
|
||||
uint i;
|
||||
i64x8 err {0};
|
||||
u8x64 block {0};
|
||||
size_t i(0), j(0);
|
||||
for(; i < in_len / 64 && i < out_len / 48; ++i)
|
||||
for(i = 0; i < in_len / 64 && i < out_len / 48; ++i)
|
||||
{
|
||||
// Destination is indexed at 48 byte stride
|
||||
const auto di
|
||||
auto *const __restrict__ di
|
||||
{
|
||||
reinterpret_cast<u512x1_u *__restrict__>(dst + (i * 48))
|
||||
data(out) + i * 48
|
||||
};
|
||||
|
||||
// Source is indexed at 64 byte stride
|
||||
const auto si
|
||||
const u512x1_u *const __restrict__ sx
|
||||
{
|
||||
reinterpret_cast<const u512x1_u *__restrict__>(src + (i * 64))
|
||||
reinterpret_cast<const u512x1_u *>(data(in))
|
||||
};
|
||||
|
||||
block = *si;
|
||||
u8x64 block;
|
||||
block = sx[i];
|
||||
block = decode_block(block, err);
|
||||
*di = block;
|
||||
#pragma clang loop vectorize(enable) unroll(full)
|
||||
for(uint j(0); j < 48; ++j)
|
||||
di[j] = block[j];
|
||||
}
|
||||
|
||||
for(; i * 64 < in_len && i * 48 < out_len; ++i)
|
||||
{
|
||||
u8x64 mask {0};
|
||||
for(j = 0; j < 64 && i * 64 + j < in_len; ++j)
|
||||
block[j] = src[i * 64 + j],
|
||||
auto *const __restrict__ di
|
||||
{
|
||||
data(out) + i * 48
|
||||
};
|
||||
|
||||
const auto *const __restrict__ si
|
||||
{
|
||||
data(in) + i * 64
|
||||
};
|
||||
|
||||
u8x64 block {0}, mask {0};
|
||||
for(uint j(0); j < 64 && i * 64 + j < in_len; ++j)
|
||||
block[j] = si[j],
|
||||
mask[j] = 0xff;
|
||||
|
||||
i64x8 _err {0};
|
||||
block = decode_block(block, _err);
|
||||
for(j = 0; j < 48 && i * 48 + j < out_len; ++j)
|
||||
dst[i * 48 + j] = block[j];
|
||||
for(uint j(0); j < 48 && i * 48 + j < out_len; ++j)
|
||||
di[j] = block[j];
|
||||
|
||||
err |= _err & i64x8(mask);
|
||||
}
|
||||
|
@ -438,7 +441,7 @@ noexcept
|
|||
|
||||
u8x64 c(b), ret;
|
||||
#pragma clang loop vectorize(enable) unroll(full)
|
||||
for(i = 0; i < 64; ++i)
|
||||
for(i = 0; i < 48; ++i)
|
||||
ret[i] = c[decode_permute_tab_le[i]];
|
||||
|
||||
err |= i64x8(_err);
|
||||
|
|
|
@ -4892,7 +4892,7 @@ ircd::db::_read(const vector_view<_read_op> &op,
|
|||
|
||||
const bool parallelize
|
||||
{
|
||||
#ifdef IRCD_DB_HAS_MULTIGET_DIRECT
|
||||
#if defined(IRCD_DB_HAS_MULTIGET_DIRECT) && defined(IRCD_DB_HAS_MULTIREAD_FIX)
|
||||
true && num > 1
|
||||
#else
|
||||
false
|
||||
|
|
|
@ -3265,7 +3265,11 @@ catch(const std::exception &e)
|
|||
return error_to_status{e};
|
||||
}
|
||||
|
||||
#ifdef IRCD_DB_HAS_ENV_MULTIREAD
|
||||
#if defined(IRCD_DB_HAS_ENV_MULTIREAD) && !defined(IRCD_DB_HAS_MULTIREAD_FIX)
|
||||
#warning "RocksDB MultiRead is buggy in this version. Please upgrade to 6.12.6+"
|
||||
#endif
|
||||
|
||||
#if defined(IRCD_DB_HAS_ENV_MULTIREAD)
|
||||
rocksdb::Status
|
||||
ircd::db::database::env::random_access_file::MultiRead(rocksdb::ReadRequest *const req,
|
||||
size_t num)
|
||||
|
|
|
@ -94,13 +94,13 @@
|
|||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 12) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 12 && ROCKSDB_PATCH >= 6)
|
||||
#define IRCD_DB_HAS_MANIFEST_WRITE
|
||||
#define IRCD_DB_HAS_MULTIREAD_FIX
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 14) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 14 && ROCKSDB_PATCH >= 5)
|
||||
#define IRCD_DB_HAS_FLUSH_RETRY
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 12) \
|
||||
|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 12 && ROCKSDB_PATCH >= 6)
|
||||
#define IRCD_DB_HAS_MANIFEST_WRITE
|
||||
#endif
|
||||
|
||||
#if ROCKSDB_MAJOR > 6 \
|
||||
|
|
25
ircd/info.cc
25
ircd/info.cc
|
@ -175,7 +175,7 @@ ircd::info::dump_cpu_info_x86()
|
|||
const auto append{[&support]
|
||||
(const string_view &name, const bool &avail, const int &enable)
|
||||
{
|
||||
strlcat(support, fmt::bsprintf<64>
|
||||
strlcat(support, fmt::bsprintf<32>
|
||||
{
|
||||
" %s:%c%s",
|
||||
name,
|
||||
|
@ -193,7 +193,14 @@ ircd::info::dump_cpu_info_x86()
|
|||
append("avx", hardware::x86::avx, simd::support::avx);
|
||||
append("avx2", hardware::x86::avx2, simd::support::avx2);
|
||||
append("avx512f", hardware::x86::avx512f, simd::support::avx512f);
|
||||
append("constant_tsc", hardware::x86::tsc_constant, -1);
|
||||
|
||||
strlcat(support, fmt::bsprintf<32>
|
||||
{
|
||||
"%s%s%s",
|
||||
hardware::x86::tsc? " tsc": "",
|
||||
hardware::x86::tsc_constant? ":constant": "",
|
||||
hardware::x86::tsc_nonstop? ":nonstop": "",
|
||||
});
|
||||
|
||||
log::info
|
||||
{
|
||||
|
@ -415,25 +422,31 @@ ircd::info::hardware::x86::avx
|
|||
decltype(ircd::info::hardware::x86::avx2)
|
||||
ircd::info::hardware::x86::avx2
|
||||
{
|
||||
bool(features & (uint128_t(1) << (32 + 5)))
|
||||
bool(extended_features & (uint128_t(1) << (32 + 5)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::avx512f)
|
||||
ircd::info::hardware::x86::avx512f
|
||||
{
|
||||
bool(features & (uint128_t(1) << (32 + 16)))
|
||||
bool(extended_features & (uint128_t(1) << (32 + 16)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc)
|
||||
ircd::info::hardware::x86::tsc
|
||||
{
|
||||
bool(features & (uint128_t(1) << 4))
|
||||
bool(features & (uint128_t(1) << (96 + 4)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc_constant)
|
||||
ircd::info::hardware::x86::tsc_constant
|
||||
{
|
||||
bool(_apmi & (uint128_t(1) << (8)))
|
||||
bool(_apmi & (uint128_t(1) << (96 + 8)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc_nonstop)
|
||||
ircd::info::hardware::x86::tsc_nonstop
|
||||
{
|
||||
bool(_apmi & (uint128_t(1) << (96 + 24)))
|
||||
};
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
|
|
@ -12342,19 +12342,34 @@ console_cmd__room__msghtml(opt &out, const string_view &line)
|
|||
bool
|
||||
console_cmd__room__join(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"room_id", "user_id", "remote", "event_id"
|
||||
}};
|
||||
|
||||
const string_view room_id_or_alias
|
||||
{
|
||||
token(line, ' ', 0)
|
||||
param.at("room_id")
|
||||
};
|
||||
|
||||
const m::user::id &user_id
|
||||
const m::user::id user_id
|
||||
{
|
||||
token(line, ' ', 1)
|
||||
param.at("user_id")
|
||||
};
|
||||
|
||||
const string_view &event_id
|
||||
const string_view event_id
|
||||
{
|
||||
token(line, ' ', 2, {})
|
||||
param["event_id"]
|
||||
};
|
||||
|
||||
const string_view remote
|
||||
{
|
||||
param["remote"]
|
||||
};
|
||||
|
||||
const vector_view<const string_view> remotes
|
||||
{
|
||||
&remote, 1
|
||||
};
|
||||
|
||||
switch(m::sigil(room_id_or_alias))
|
||||
|
@ -12368,7 +12383,7 @@ console_cmd__room__join(opt &out, const string_view &line)
|
|||
|
||||
const auto join_event
|
||||
{
|
||||
m::join(room, user_id)
|
||||
m::join(room, user_id, remotes)
|
||||
};
|
||||
|
||||
out << join_event << std::endl;
|
||||
|
|
|
@ -134,6 +134,7 @@ run git submodule update --init --recursive --checkout libs/container_hash
|
|||
run git submodule update --init --recursive --checkout libs/container
|
||||
run git submodule update --init --recursive --checkout libs/move
|
||||
run git submodule update --init --recursive --checkout libs/math
|
||||
run git submodule update --init --recursive --checkout libs/mp11
|
||||
|
||||
run git submodule update --init --recursive --checkout libs/tokenizer
|
||||
run git submodule update --init --recursive --checkout libs/iterator
|
||||
|
|
|
@ -65,3 +65,11 @@ AC_DEFUN([RB_CHK_SYSHEADER],
|
|||
])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([RB_CHECK_SIZEOF],
|
||||
[
|
||||
AC_CHECK_SIZEOF([$1])
|
||||
if [[ "${ac_cv_sizeof_$1}" != "$2" ]]; then
|
||||
AC_MSG_ERROR([sizeof($1) must be $2 not ${ac_cv_sizeof_$1}. Check config.log for compiler error.])
|
||||
fi
|
||||
])
|
||||
|
|
Loading…
Reference in New Issue