Skip to content

Commit

Permalink
-latomic check
Browse files Browse the repository at this point in the history
  • Loading branch information
traversc committed Mar 19, 2024
1 parent 7b5f3fe commit e5bb578
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 77 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 0.26.2 (2024-03-18)
* Change check for requiring `-latomic` flag to use `AC_COMPILE_IFELSE` (https://github.com/traversc/qs/issues/88, https://github.com/traversc/qs/issues/91, https://github.com/traversc/qs/issues/76)

Version 0.26.1 (2024-03-07)
* Add ALTREP serialization
* Minor bug fix (strict aliasing rules)
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: qs
Type: Package
Title: Quick Serialization of R Objects
Version: 0.26.1
Date: 2024-03-08
Version: 0.26.2
Date: 2024-03-18
Authors@R: c(
person("Travers", "Ching", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Yann", "Collet", role = c("ctb", "cph"), comment = "Yann Collet is the author of the bundled zstd, lz4 and xxHash code"),
Expand Down
96 changes: 23 additions & 73 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for qs 0.25.6.
# Generated by GNU Autoconf 2.69 for qs 0.26.1.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='qs'
PACKAGE_TARNAME='qs'
PACKAGE_VERSION='0.25.6'
PACKAGE_STRING='qs 0.25.6'
PACKAGE_VERSION='0.26.1'
PACKAGE_STRING='qs 0.26.1'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1213,7 +1213,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures qs 0.25.6 to adapt to many kinds of systems.
\`configure' configures qs 0.26.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1275,7 +1275,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of qs 0.25.6:";;
short | recursive ) echo "Configuration of qs 0.26.1:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1370,7 +1370,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
qs configure 0.25.6
qs configure 0.26.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1425,7 +1425,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by qs $as_me 0.25.6, which was
It was created by qs $as_me 0.26.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2406,81 +2406,31 @@ echo $(($MAJOR*100000+$MINOR*100+$RELEASE))
########################################################
#### Compiler specific flags
# Check if simple C++ program using atomic header can compile using AC_COMPILE_IFELSE
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler vendor" >&5
$as_echo_n "checking for C++ compiler vendor... " >&6; }
if ${ax_cv_cxx_compiler_vendor+:} false; then :
$as_echo_n "(cached) " >&6
else
vendors="
intel: __ICC,__ECC,__INTEL_COMPILER
ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__
pathscale: __PATHCC__,__PATHSCALE__
clang: __clang__
cray: _CRAYC
fujitsu: __FUJITSU
sdcc: SDCC,__SDCC
sx: _SX
nvhpc: __NVCOMPILER
portland: __PGI
gnu: __GNUC__
sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95
hp: __HP_cc,__HP_aCC
dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
comeau: __COMO__
kai: __KCC
lcc: __LCC__
sgi: __sgi,sgi
microsoft: _MSC_VER
metrowerks: __MWERKS__
watcom: __WATCOMC__
tcc: __TINYC__
unknown: UNKNOWN
"
for ventest in $vendors; do
case $ventest in
*:)
vendor=$ventest
continue
;;
*)
vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")"
;;
esac
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#if !($vencpp)
thisisanerror;
#endif
;
return 0;
#include <atomic>
std::atomic<int> x{0};
int main() {
x.fetch_add(1);
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
break
NEED_LIBATOMIC="no"
else
NEED_LIBATOMIC="yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
ax_cv_cxx_compiler_vendor=`echo $vendor | cut -d: -f1`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compiler_vendor" >&5
$as_echo "$ax_cv_cxx_compiler_vendor" >&6; }
if test xx$ax_cv_cxx_compiler_vendor = "xxgnu"; then
if test xx$NEED_LIBATOMIC = "xxyes"; then
echo "Requires -latomic flag"
COMPILER_SPECIFIC_LIBS="-latomic"
else
echo "Does not require -latomic flag"
COMPILER_SPECIFIC_LIBS=""
fi
Expand Down Expand Up @@ -3157,7 +3107,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by qs $as_me 0.25.6, which was
This file was extended by qs $as_me 0.26.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -3210,7 +3160,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
qs config.status 0.25.6
qs config.status 0.26.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
14 changes: 12 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@ echo $(($MAJOR*100000+$MINOR*100+$RELEASE))
########################################################
#### Compiler specific flags

AX_COMPILER_VENDOR
# Check if simple C++ program using atomic header can compile using AC_COMPILE_IFELSE
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <atomic>
std::atomic<int> x{0};
int main() {
x.fetch_add(1);
return 0;
}
]])], [NEED_LIBATOMIC="no"], [NEED_LIBATOMIC="yes"])

if test xx$ax_cv_cxx_compiler_vendor = "xxgnu"; then
if test xx$NEED_LIBATOMIC = "xxyes"; then
echo "Requires -latomic flag"
COMPILER_SPECIFIC_LIBS="-latomic"
else
echo "Does not require -latomic flag"
COMPILER_SPECIFIC_LIBS=""
fi

Expand Down

0 comments on commit e5bb578

Please sign in to comment.