Project

General

Profile

RE: Configure error with intel compiler regarding C++14 s... ยป config.log

ep gupal, 2022-05-09 18:21

 
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by cdo configure 2.0.5, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ ./configure --prefix=/gpfs/home/jin/tools/pkgs/cdo-2.0.5 --with-netcdf=/gpfs/software/netcdf/intel/netcdf-c-4.7.4 --with-udunits2=/gpfs/software/udunits-2.2.26 --with-hdf5=/gpfs/software/hdf5/intel/1.10.5

## --------- ##
## Platform. ##
## --------- ##

hostname = login2
uname -m = x86_64
uname -r = 3.10.0-1160.24.1.el7.x86_64
uname -s = Linux
uname -v = #1 SMP Thu Apr 8 19:51:47 UTC 2021

/usr/bin/uname -p = x86_64
/bin/uname -X = unknown

/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /gpfs/software/netcdf-fortran/intel/4.5.3//bin/
PATH: /gpfs/software/netcdf/intel/netcdf-c-4.7.4/bin/
PATH: /gpfs/software/pnetcdf/intel/1.12.1/bin/
PATH: /gpfs/software/hdf5/intel/1.10.5/bin/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/mpi/intel64/bin/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/mpi/intel64/libfrabric/bin/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/mkl/bin/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/bin/intel64/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/bin/
PATH: /gpfs/software/intel/parallel-studio-xe/2020_2/compilers_and_libraries_2020/linux/../../debugger_2020/gdb/intel64/bin/
PATH: /cm/shared/apps/slurm/17.11.12/sbin/
PATH: /cm/shared/apps/slurm/17.11.12/bin/
PATH: /gpfs/home/jin/model/SAM6.11.6/UTIL/
PATH: /cm/local/apps/environment-modules/4.0.0//bin/
PATH: /usr/local/bin/
PATH: /usr/bin/
PATH: /usr/local/sbin/
PATH: /usr/sbin/
PATH: /opt/ibutils/bin/
PATH: /sbin/
PATH: /usr/sbin/
PATH: /cm/local/apps/environment-modules/4.0.0/bin/
PATH: /gpfs/home/jin/bin/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:3292: looking for aux files: tap-driver.sh ltmain.sh compile ar-lib missing install-sh config.guess config.sub
configure:3305: trying ./config/
configure:3334: ./config/tap-driver.sh found
configure:3334: ./config/ltmain.sh found
configure:3334: ./config/compile found
configure:3334: ./config/ar-lib found
configure:3334: ./config/missing found
configure:3316: ./config/install-sh found
configure:3334: ./config/config.guess found
configure:3334: ./config/config.sub found
configure:3460: checking build system type
configure:3475: result: x86_64-pc-linux-gnu
configure:3495: checking host system type
configure:3509: result: x86_64-pc-linux-gnu
configure:3549: checking for a BSD-compatible install
configure:3622: result: /usr/bin/install -c
configure:3633: checking whether build environment is sane
configure:3688: result: yes
configure:3847: checking for a race-free mkdir -p
configure:3891: result: /usr/bin/mkdir -p
configure:3898: checking for gawk
configure:3919: found /usr/bin/gawk
configure:3930: result: gawk
configure:3941: checking whether make sets $(MAKE)
configure:3964: result: yes
configure:3994: checking whether make supports nested variables
configure:4012: result: yes
configure:4152: checking whether to enable maintainer-specific portions of Makefiles
configure:4162: result: no
configure:4190: checking whether make supports the include directive
configure:4205: make -f confmf.GNU && cat confinc.out
this is the am__doit target
configure:4208: $? = 0
configure:4227: result: yes (GNU style)
configure:4303: checking for gcc
configure:4335: result: icc
configure:4688: checking for C compiler version
configure:4697: icc --version >&5
icc (ICC) 19.1.2.254 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:4708: $? = 0
configure:4697: icc -v >&5
icc version 19.1.2.254 (gcc version 4.8.5 compatibility)
configure:4708: $? = 0
configure:4697: icc -V >&5
Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.2.254 Build 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:4708: $? = 0
configure:4697: icc -qversion >&5
icc: command line warning #10006: ignoring unknown option '-qversion'
icc: command line error: no files specified; for help type "icc -help"
configure:4708: $? = 1
configure:4697: icc -version >&5
icc: command line warning #10006: ignoring unknown option '-version'
icc: command line error: no files specified; for help type "icc -help"
configure:4708: $? = 1
configure:4728: checking whether the C compiler works
configure:4750: icc conftest.c >&5
configure:4754: $? = 0
configure:4804: result: yes
configure:4807: checking for C compiler default output file name
configure:4809: result: a.out
configure:4815: checking for suffix of executables
configure:4822: icc -o conftest conftest.c >&5
configure:4826: $? = 0
configure:4849: result:
configure:4871: checking whether we are cross compiling
configure:4879: icc -o conftest conftest.c >&5
configure:4883: $? = 0
configure:4890: ./conftest
configure:4894: $? = 0
configure:4909: result: no
configure:4914: checking for suffix of object files
configure:4937: icc -c conftest.c >&5
configure:4941: $? = 0
configure:4963: result: o
configure:4967: checking whether the compiler supports GNU C
configure:4987: icc -c conftest.c >&5
configure:4987: $? = 0
configure:4997: result: yes
configure:5008: checking whether icc accepts -g
configure:5029: icc -c -g conftest.c >&5
configure:5029: $? = 0
configure:5073: result: yes
configure:5093: checking for icc option to enable C11 features
configure:5108: icc -c -g -O2 conftest.c >&5
conftest.c(64): error: #error directive: "Compiler does not advertise C99 conformance"
# error "Compiler does not advertise C99 conformance"
^

conftest.c(119): error: expected a ")"
test_restrict (ccp restrict text)
^

conftest.c(124): error: expected an expression
for (unsigned int i = 0; *(text+i) != '\0'; ++i)
^

conftest.c(124): error: identifier "text" is undefined
for (unsigned int i = 0; *(text+i) != '\0'; ++i)
^

conftest.c(124): error: identifier "i" is undefined
for (unsigned int i = 0; *(text+i) != '\0'; ++i)
^

conftest.c(168): error: #error directive: "Compiler does not advertise C11 conformance"
# error "Compiler does not advertise C11 conformance"
^

conftest.c(200): error: identifier "syntax" is undefined
char const utf8_literal[] = u8"happens to be ASCII" "another string";
^

conftest.c(200): error: expected a ";"
char const utf8_literal[] = u8"happens to be ASCII" "another string";
^

conftest.c(233): error: expected a ";"
char *restrict newvar = "Another string";
^

conftest.c(243): error: expected an expression
for (int i = 0; i < ia->datasize; ++i)
^

conftest.c(243): error: identifier "i" is undefined
for (int i = 0; i < ia->datasize; ++i)
^

conftest.c(260): error: identifier "newvar" is undefined
ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
^

compilation aborted for conftest.c (code 2)
configure:5108: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| /* end confdefs.h. */
|
| /* Does the compiler advertise C89 conformance?
| Do not test the value of __STDC__, because some compilers set it to 0
| while being otherwise adequately conformant. */
| #if !defined __STDC__
| # error "Compiler does not advertise C89 conformance"
| #endif
|
| #include <stddef.h>
| #include <stdarg.h>
| struct stat;
| /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
| struct buf { int x; };
| struct buf * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not \xHH hex character constants.
| These do not provoke an error unfortunately, instead are silently treated
| as an "x". The following induces an error, until -std is added to get
| proper ANSI mode. Curiously \x00 != x always comes out true, for an
| array size at least. It is necessary to write \x00 == 0 to get something
| that is true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
| int, int);
|
| // Does the compiler advertise C99 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
| # error "Compiler does not advertise C99 conformance"
| #endif
|
| #include <stdbool.h>
| extern int puts (const char *);
| extern int printf (const char *, ...);
| extern int dprintf (int, const char *, ...);
| extern void *malloc (size_t);
|
| // Check varargs macros. These examples are taken from C99 6.10.3.5.
| // dprintf is used instead of fprintf to avoid needing to declare
| // FILE and stderr.
| #define debug(...) dprintf (2, __VA_ARGS__)
| #define showlist(...) puts (#__VA_ARGS__)
| #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
| static void
| test_varargs_macros (void)
| {
| int x = 1234;
| int y = 5678;
| debug ("Flag");
| debug ("X = %d\n", x);
| showlist (The first, second, and third items.);
| report (x>y, "x is %d but y is %d", x, y);
| }
|
| // Check long long types.
| #define BIG64 18446744073709551615ull
| #define BIG32 4294967295ul
| #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
| #if !BIG_OK
| #error "your preprocessor is broken"
| #endif
| #if BIG_OK
| #else
| #error "your preprocessor is broken"
| #endif
| static long long int bignum = -9223372036854775807LL;
| static unsigned long long int ubignum = BIG64;
|
| struct incomplete_array
| {
| int datasize;
| double data[];
| };
|
| struct named_init {
| int number;
| const wchar_t *name;
| double average;
| };
|
| typedef const char *ccp;
|
| static inline int
| test_restrict (ccp restrict text)
| {
| // See if C++-style comments work.
| // Iterate through items via the restricted pointer.
| // Also check for declarations in for loops.
| for (unsigned int i = 0; *(text+i) != '\0'; ++i)
| continue;
| return 0;
| }
|
| // Check varargs and va_copy.
| static bool
| test_varargs (const char *format, ...)
| {
| va_list args;
| va_start (args, format);
| va_list args_copy;
| va_copy (args_copy, args);
|
| const char *str = "";
| int number = 0;
| float fnumber = 0;
|
| while (*format)
| {
| switch (*format++)
| {
| case 's': // string
| str = va_arg (args_copy, const char *);
| break;
| case 'd': // int
| number = va_arg (args_copy, int);
| break;
| case 'f': // float
| fnumber = va_arg (args_copy, double);
| break;
| default:
| break;
| }
| }
| va_end (args_copy);
| va_end (args);
|
| return *str && number && fnumber;
| }
|
|
| // Does the compiler advertise C11 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
| # error "Compiler does not advertise C11 conformance"
| #endif
|
| // Check _Alignas.
| char _Alignas (double) aligned_as_double;
| char _Alignas (0) no_special_alignment;
| extern char aligned_as_int;
| char _Alignas (0) _Alignas (int) aligned_as_int;
|
| // Check _Alignof.
| enum
| {
| int_alignment = _Alignof (int),
| int_array_alignment = _Alignof (int[100]),
| char_alignment = _Alignof (char)
| };
| _Static_assert (0 < -_Alignof (int), "_Alignof is signed");
|
| // Check _Noreturn.
| int _Noreturn does_not_return (void) { for (;;) continue; }
|
| // Check _Static_assert.
| struct test_static_assert
| {
| int x;
| _Static_assert (sizeof (int) <= sizeof (long int),
| "_Static_assert does not work in struct");
| long int y;
| };
|
| // Check UTF-8 literals.
| #define u8 syntax error!
| char const utf8_literal[] = u8"happens to be ASCII" "another string";
|
| // Check duplicate typedefs.
| typedef long *long_ptr;
| typedef long int *long_ptr;
| typedef long_ptr long_ptr;
|
| // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
| struct anonymous
| {
| union {
| struct { int i; int j; };
| struct { int k; long int l; } w;
| };
| int m;
| } v1;
|
|
| int
| main (int argc, char **argv)
| {
| int ok = 0;
|
| ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
|
|
| // Check bool.
| _Bool success = false;
| success |= (argc != 0);
|
| // Check restrict.
| if (test_restrict ("String literal") == 0)
| success = true;
| char *restrict newvar = "Another string";
|
| // Check varargs.
| success &= test_varargs ("s, d' f .", "string", 65, 34.234);
| test_varargs_macros ();
|
| // Check flexible array members.
| struct incomplete_array *ia =
| malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
| ia->datasize = 10;
| for (int i = 0; i < ia->datasize; ++i)
| ia->data[i] = i * 1.234;
|
| // Check named initializers.
| struct named_init ni = {
| .number = 34,
| .name = L"Test wide string",
| .average = 543.34343,
| };
|
| ni.number = 58;
|
| int dynamic_array[ni.number];
| dynamic_array[0] = argv[0][0];
| dynamic_array[ni.number - 1] = 543;
|
| // work around unused variable warnings
| ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
| || dynamic_array[ni.number - 1] != 543);
|
|
| _Static_assert ((offsetof (struct anonymous, i)
| == offsetof (struct anonymous, w.k)),
| "Anonymous union alignment botch");
| v1.i = 2;
| v1.w.k = 5;
| ok |= v1.i != 5;
|
| return ok;
| }
|
configure:5108: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:5108: $? = 0
configure:5129: result: -std=gnu11
configure:5242: checking whether icc -std=gnu11 understands -c and -o together
configure:5265: icc -std=gnu11 -c conftest.c -o conftest2.o
configure:5268: $? = 0
configure:5265: icc -std=gnu11 -c conftest.c -o conftest2.o
configure:5268: $? = 0
configure:5280: result: yes
configure:5299: checking dependency style of icc -std=gnu11
configure:5411: result: gcc3
configure:5482: checking for ar
configure:5503: found /usr/bin/ar
configure:5514: result: ar
configure:5540: checking the archiver (ar) interface
configure:5557: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:5557: $? = 0
configure:5560: ar cru libconftest.a conftest.o >&5
configure:5563: $? = 0
configure:5591: result: ar
configure:5612: setting up libtool
configure:5661: checking how to print strings
configure:5688: result: printf
configure:5709: checking for a sed that does not truncate output
configure:5779: result: /usr/bin/sed
configure:5797: checking for grep that handles long lines and -e
configure:5861: result: /usr/bin/grep
configure:5866: checking for egrep
configure:5934: result: /usr/bin/grep -E
configure:5939: checking for fgrep
configure:6007: result: /usr/bin/grep -F
configure:6043: checking for ld used by icc -std=gnu11
configure:6111: result: /usr/bin/ld
configure:6118: checking if the linker (/usr/bin/ld) is GNU ld
configure:6134: result: yes
configure:6146: checking for BSD- or MS-compatible name lister (nm)
configure:6201: result: /usr/bin/nm -B
configure:6341: checking the name lister (/usr/bin/nm -B) interface
configure:6349: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:6352: /usr/bin/nm -B "conftest.o"
configure:6355: output
0000000000000000 N .debug_info_seg
0000000000000000 B some_variable
configure:6362: result: BSD nm
configure:6365: checking whether ln -s works
configure:6369: result: yes
configure:6377: checking the maximum length of command line arguments
configure:6509: result: 3458764513820540925
configure:6557: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format
configure:6598: result: func_convert_file_noop
configure:6605: checking how to convert x86_64-pc-linux-gnu file names to toolchain format
configure:6626: result: func_convert_file_noop
configure:6633: checking for /usr/bin/ld option to reload object files
configure:6641: result: -r
configure:6720: checking for objdump
configure:6741: found /usr/bin/objdump
configure:6752: result: objdump
configure:6784: checking how to recognize dependent libraries
configure:6985: result: pass_all
configure:7075: checking for dlltool
configure:7110: result: no
configure:7140: checking how to associate runtime and link libraries
configure:7168: result: printf %s\n
configure:7302: checking for archiver @FILE support
configure:7320: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:7320: $? = 0
configure:7324: ar cru libconftest.a @conftest.lst >&5
configure:7327: $? = 0
configure:7332: ar cru libconftest.a @conftest.lst >&5
ar: conftest.o: No such file or directory
configure:7335: $? = 1
configure:7347: result: @
configure:7410: checking for strip
configure:7431: found /usr/bin/strip
configure:7442: result: strip
configure:7519: checking for ranlib
configure:7540: found /usr/bin/ranlib
configure:7551: result: ranlib
configure:7653: checking command to parse /usr/bin/nm -B output from icc -std=gnu11 object
configure:7807: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:7810: $? = 0
configure:7814: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm
configure:7817: $? = 0
configure:7883: icc -std=gnu11 -o conftest -g -O2 conftest.c conftstm.o >&5
configure:7886: $? = 0
configure:7924: result: ok
configure:7971: checking for sysroot
configure:8002: result: no
configure:8009: checking for a working dd
configure:8053: result: /usr/bin/dd
configure:8057: checking how to truncate binary pipes
configure:8073: result: /usr/bin/dd bs=4096 count=1
configure:8210: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:8213: $? = 0
configure:8410: checking for mt
configure:8445: result: no
configure:8465: checking if : is a manifest tool
configure:8472: : '-?'
configure:8480: result: no
configure:9205: checking for stdio.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for stdlib.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for string.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for inttypes.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for stdint.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for strings.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for sys/stat.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for sys/types.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for unistd.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9205: checking for sys/param.h
configure:9205: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9205: $? = 0
configure:9205: result: yes
configure:9230: checking for dlfcn.h
configure:9230: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:9230: $? = 0
configure:9230: result: yes
configure:9489: checking for objdir
configure:9505: result: .libs
configure:9769: checking if icc -std=gnu11 supports -fno-rtti -fno-exceptions
configure:9788: icc -std=gnu11 -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
configure:9792: $? = 0
configure:9805: result: yes
configure:10163: checking for icc -std=gnu11 option to produce PIC
configure:10171: result: -fPIC -DPIC
configure:10179: checking if icc -std=gnu11 PIC flag -fPIC -DPIC works
configure:10198: icc -std=gnu11 -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5
configure:10202: $? = 0
configure:10215: result: yes
configure:10244: checking if icc -std=gnu11 static flag -static works
configure:10273: result: no
configure:10288: checking if icc -std=gnu11 supports -c -o file.o
configure:10310: icc -std=gnu11 -c -g -O2 -o out/conftest2.o conftest.c >&5
configure:10314: $? = 0
configure:10336: result: yes
configure:10344: checking if icc -std=gnu11 supports -c -o file.o
configure:10392: result: yes
configure:10425: checking whether the icc -std=gnu11 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:11691: result: yes
configure:11728: checking whether -lc should be explicitly linked in
configure:11737: icc -std=gnu11 -c -g -O2 conftest.c >&5
configure:11740: $? = 0
configure:11755: icc -std=gnu11 -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1
configure:11758: $? = 0
configure:11772: result: no
configure:11932: checking dynamic linker characteristics
configure:12514: icc -std=gnu11 -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5
configure:12514: $? = 0
configure:12753: result: GNU/Linux ld.so
configure:12875: checking how to hardcode library paths into programs
configure:12900: result: immediate
configure:13452: checking whether stripping libraries is possible
configure:13457: result: yes
configure:13492: checking if libtool supports shared libraries
configure:13494: result: yes
configure:13497: checking whether to build shared libraries
configure:13522: result: yes
configure:13525: checking whether to build static libraries
configure:13529: result: yes
configure:13619: checking for bash
configure:13654: result: /bin/sh
configure:13726: checking for gcc
configure:13758: result: icc
configure:13828: checking for g++
configure:13860: result: icpc
configure:14012: checking for C++ compiler version
configure:14021: icpc --version >&5
icpc (ICC) 19.1.2.254 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:14032: $? = 0
configure:14021: icpc -v >&5
icpc version 19.1.2.254 (gcc version 4.8.5 compatibility)
configure:14032: $? = 0
configure:14021: icpc -V >&5
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.2.254 Build 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:14032: $? = 0
configure:14021: icpc -qversion >&5
icpc: command line warning #10006: ignoring unknown option '-qversion'
icpc: command line error: no files specified; for help type "icpc -help"
configure:14032: $? = 1
configure:14036: checking whether the compiler supports GNU C++
configure:14056: icpc -c conftest.cpp >&5
configure:14056: $? = 0
configure:14066: result: yes
configure:14077: checking whether icpc accepts -g
configure:14098: icpc -c -g conftest.cpp >&5
configure:14098: $? = 0
configure:14142: result: yes
configure:14162: checking for icpc option to enable C++11 features
configure:14177: icpc -c -g -O2 conftest.cpp >&5
conftest.cpp(71): error: #error directive: "Compiler does not advertise C++11 conformance"
# error "Compiler does not advertise C++11 conformance"
^

conftest.cpp(76): error #77: this declaration has no storage class or type specifier
constexpr int get_val() { return 20; }
^

conftest.cpp(76): error: expected a ";"
constexpr int get_val() { return 20; }
^

conftest.cpp(82): warning #12: parsing restarts here after previous syntax error
};
^

conftest.cpp(88): warning #3498: delegating constructors are a C++11 feature
delegate(): delegate(2354) {}
^

conftest.cpp(99): warning #3459: "override" and "final" are C++11 features
virtual int getval() override final { return this->n * 2; }
^

conftest.cpp(99): warning #3459: "override" and "final" are C++11 features
virtual int getval() override final { return this->n * 2; }
^

conftest.cpp(106): warning #3502: defaulted functions are a C++11 feature
nocopy() = default;
^

conftest.cpp(107): warning #3501: deleted functions are a C++11 feature
nocopy(const nocopy&) = delete;
^

conftest.cpp(120): error: invalid storage class for a template declaration
template <typename V> auto sum(V first) -> V
^

conftest.cpp(120): error #303: explicit type is missing ("int" assumed)
template <typename V> auto sum(V first) -> V
^

conftest.cpp(120): error: expected a ";"
template <typename V> auto sum(V first) -> V
^

conftest.cpp(128): warning #12: parsing restarts here after previous syntax error
}
^

conftest.cpp(148): error #303: explicit type is missing ("int" assumed)
auto a1 = 6538;
^

conftest.cpp(149): error #303: explicit type is missing ("int" assumed)
auto a2 = 48573953.4;
^

conftest.cpp(150): error #303: explicit type is missing ("int" assumed)
auto a3 = "String literal";
^

conftest.cpp(150): error: a value of type "const char *" cannot be used to initialize an entity of type "int"
auto a3 = "String literal";
^

conftest.cpp(153): error #303: explicit type is missing ("int" assumed)
for (auto i = a3; *i; ++i) { total += *i; }
^

conftest.cpp(153): error: operand of "*" must be a pointer
for (auto i = a3; *i; ++i) { total += *i; }
^

conftest.cpp(153): error: operand of "*" must be a pointer
for (auto i = a3; *i; ++i) { total += *i; }
^

conftest.cpp(155): error: identifier "decltype" is undefined
decltype(a2) a4 = 34895.034;
^

conftest.cpp(155): error: expected a ";"
decltype(a2) a4 = 34895.034;
^

conftest.cpp(159): error: namespace "cxx11test" has no member "get_val"
short sa[cxx11test::get_val()] = { 0 };
^

conftest.cpp(159): error: variable "sa" may not be initialized
short sa[cxx11test::get_val()] = { 0 };
^

conftest.cpp(163): error: namespace "cxx11test" has no member "testinit"
cxx11test::testinit il = { 4323, 435234.23544 };
^

conftest.cpp(169): error #303: explicit type is missing ("int" assumed)
for (auto &x : array) { x += 23; }
^

conftest.cpp(169): error: reference variable "x" requires an initializer
for (auto &x : array) { x += 23; }
^

conftest.cpp(169): error: expected a ";"
for (auto &x : array) { x += 23; }
^

conftest.cpp(169): error: expected an expression
for (auto &x : array) { x += 23; }
^

conftest.cpp(169): error: expected a ";"
for (auto &x : array) { x += 23; }
^

conftest.cpp(174): warning #3496: lambda expressions are a C++11 feature
assert (eval ([](int x) { return x*2; }, 21) == 42);
^

conftest.cpp(174): error: a template argument may not reference a local type
assert (eval ([](int x) { return x*2; }, 21) == 42);
^

conftest.cpp(176): error: a template argument may not reference a local type
assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
^

conftest.cpp(178): error: a template argument may not reference a local type
assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
^

conftest.cpp(184): error #303: explicit type is missing ("int" assumed)
auto a = sum(1);
^

conftest.cpp(185): error #303: explicit type is missing ("int" assumed)
auto b = sum(1, 2);
^

conftest.cpp(185): error: no instance of function template "cxx11test::sum" matches the argument list
argument types are: (int, int)
auto b = sum(1, 2);
^
conftest.cpp(183): note: this candidate was rejected because mismatch in count of arguments
using cxx11test::sum;
^

conftest.cpp(186): error #303: explicit type is missing ("int" assumed)
auto c = sum(1.0, 2.0, 3.0);
^

conftest.cpp(186): error: no instance of function template "cxx11test::sum" matches the argument list
argument types are: (double, double, double)
auto c = sum(1.0, 2.0, 3.0);
^
conftest.cpp(183): note: this candidate was rejected because mismatch in count of arguments
using cxx11test::sum;
^

conftest.cpp(200): error: identifier "nullptr" is undefined
char *c = nullptr;
^

conftest.cpp(204): warning #765: use of alternative token "<:" appears to be unintended
test_template<::test_template<int>> v(test_template<int>(12));
^

conftest.cpp(204): error: argument list for class template "<unnamed>::test_template" is missing
test_template<::test_template<int>> v(test_template<int>(12));
^

conftest.cpp(204): error: expected an identifier
test_template<::test_template<int>> v(test_template<int>(12));
^

conftest.cpp(204): error: expected an expression
test_template<::test_template<int>> v(test_template<int>(12));
^

conftest.cpp(208): warning #12: parsing restarts here after previous syntax error
char const *utf8 = u8"UTF-8 string \u2500";
^

conftest.cpp(208): error: identifier "u8" is undefined
char const *utf8 = u8"UTF-8 string \u2500";
^

conftest.cpp(208): error: expected a "]"
char const *utf8 = u8"UTF-8 string \u2500";
^

conftest.cpp(209): error: identifier "char16_t" is undefined
char16_t const *utf16 = u"UTF-8 string \u2500";
^

conftest.cpp(209): error: expected a ";"
char16_t const *utf16 = u"UTF-8 string \u2500";
^

conftest.cpp(210): error: identifier "char32_t" is undefined
char32_t const *utf32 = U"UTF-32 string \u2500";
^

conftest.cpp(210): error: expected a ";"
char32_t const *utf32 = U"UTF-32 string \u2500";
^

compilation aborted for conftest.cpp (code 2)
configure:14177: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
|
| // Does the compiler advertise C++98 conformance?
| #if !defined __cplusplus || __cplusplus < 199711L
| # error "Compiler does not advertise C++98 conformance"
| #endif
|
| // These inclusions are to reject old compilers that
| // lack the unsuffixed header files.
| #include <cstdlib>
| #include <exception>
|
| // <cassert> and <cstring> are *not* freestanding headers in C++98.
| extern void assert (int);
| namespace std {
| extern int strcmp (const char *, const char *);
| }
|
| // Namespaces, exceptions, and templates were all added after "C++ 2.0".
| using std::exception;
| using std::strcmp;
|
| namespace {
|
| void test_exception_syntax()
| {
| try {
| throw "test";
| } catch (const char *s) {
| // Extra parentheses suppress a warning when building autoconf itself,
| // due to lint rules shared with more typical C programs.
| assert (!(strcmp) (s, "test"));
| }
| }
|
| template <typename T> struct test_template
| {
| T const val;
| explicit test_template(T t) : val(t) {}
| template <typename U> T add(U u) { return static_cast<T>(u) + val; }
| };
|
| } // anonymous namespace
|
|
| // Does the compiler advertise C++ 2011 conformance?
| #if !defined __cplusplus || __cplusplus < 201103L
| # error "Compiler does not advertise C++11 conformance"
| #endif
|
| namespace cxx11test
| {
| constexpr int get_val() { return 20; }
|
| struct testinit
| {
| int i;
| double d;
| };
|
| class delegate
| {
| public:
| delegate(int n) : n(n) {}
| delegate(): delegate(2354) {}
|
| virtual int getval() { return this->n; };
| protected:
| int n;
| };
|
| class overridden : public delegate
| {
| public:
| overridden(int n): delegate(n) {}
| virtual int getval() override final { return this->n * 2; }
| };
|
| class nocopy
| {
| public:
| nocopy(int i): i(i) {}
| nocopy() = default;
| nocopy(const nocopy&) = delete;
| nocopy & operator=(const nocopy&) = delete;
| private:
| int i;
| };
|
| // for testing lambda expressions
| template <typename Ret, typename Fn> Ret eval(Fn f, Ret v)
| {
| return f(v);
| }
|
| // for testing variadic templates and trailing return types
| template <typename V> auto sum(V first) -> V
| {
| return first;
| }
| template <typename V, typename... Args> auto sum(V first, Args... rest) -> V
| {
| return first + sum(rest...);
| }
| }
|
|
| int
| main (int argc, char **argv)
| {
| int ok = 0;
|
| assert (argc);
| assert (! argv[0]);
| {
| test_exception_syntax ();
| test_template<double> tt (2.0);
| assert (tt.add (4) == 6.0);
| assert (true && !false);
| }
|
|
| {
| // Test auto and decltype
| auto a1 = 6538;
| auto a2 = 48573953.4;
| auto a3 = "String literal";
|
| int total = 0;
| for (auto i = a3; *i; ++i) { total += *i; }
|
| decltype(a2) a4 = 34895.034;
| }
| {
| // Test constexpr
| short sa[cxx11test::get_val()] = { 0 };
| }
| {
| // Test initializer lists
| cxx11test::testinit il = { 4323, 435234.23544 };
| }
| {
| // Test range-based for
| int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
| 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
| for (auto &x : array) { x += 23; }
| }
| {
| // Test lambda expressions
| using cxx11test::eval;
| assert (eval ([](int x) { return x*2; }, 21) == 42);
| double d = 2.0;
| assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
| assert (d == 5.0);
| assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
| assert (d == 5.0);
| }
| {
| // Test use of variadic templates
| using cxx11test::sum;
| auto a = sum(1);
| auto b = sum(1, 2);
| auto c = sum(1.0, 2.0, 3.0);
| }
| {
| // Test constructor delegation
| cxx11test::delegate d1;
| cxx11test::delegate d2();
| cxx11test::delegate d3(45);
| }
| {
| // Test override and final
| cxx11test::overridden o1(55464);
| }
| {
| // Test nullptr
| char *c = nullptr;
| }
| {
| // Test template brackets
| test_template<::test_template<int>> v(test_template<int>(12));
| }
| {
| // Unicode literals
| char const *utf8 = u8"UTF-8 string \u2500";
| char16_t const *utf16 = u"UTF-8 string \u2500";
| char32_t const *utf32 = U"UTF-32 string \u2500";
| }
|
| return ok;
| }
|
configure:14195: result: none needed
configure:14261: checking dependency style of icpc
configure:14373: result: gcc3
configure:14406: checking how to run the C++ preprocessor
configure:14428: icpc -E conftest.cpp
configure:14428: $? = 0
configure:14443: icpc -E conftest.cpp
conftest.cpp(25): error #2379: cannot open source file "ac_nonexistent.h"
#include <ac_nonexistent.h>
^

configure:14443: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:14470: result: icpc -E
configure:14484: icpc -E conftest.cpp
configure:14484: $? = 0
configure:14499: icpc -E conftest.cpp
conftest.cpp(25): error #2379: cannot open source file "ac_nonexistent.h"
#include <ac_nonexistent.h>
^

configure:14499: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:14664: checking for ld used by icpc
configure:14732: result: /usr/bin/ld -m elf_x86_64
configure:14739: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld
configure:14755: result: yes
configure:14810: checking whether the icpc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:15887: result: yes
configure:15923: icpc -c -g -O2 conftest.cpp >&5
configure:15926: $? = 0
configure:16407: checking for icpc option to produce PIC
configure:16415: result: -fPIC -DPIC
configure:16423: checking if icpc PIC flag -fPIC -DPIC works
configure:16442: icpc -c -g -O2 -fPIC -DPIC -DPIC conftest.cpp >&5
configure:16446: $? = 0
configure:16459: result: yes
configure:16482: checking if icpc static flag -static works
configure:16511: result: no
configure:16523: checking if icpc supports -c -o file.o
configure:16545: icpc -c -g -O2 -o out/conftest2.o conftest.cpp >&5
configure:16549: $? = 0
configure:16571: result: yes
configure:16576: checking if icpc supports -c -o file.o
configure:16624: result: yes
configure:16654: checking whether the icpc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:16694: result: yes
configure:16836: checking dynamic linker characteristics
configure:17584: result: GNU/Linux ld.so
configure:17649: checking how to hardcode library paths into programs
configure:17674: result: immediate
configure:17830: checking for Fortran 77 compiler version
configure:17839: ifort --version >&5
ifort (IFORT) 19.1.2.254 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:17850: $? = 0
configure:17839: ifort -v >&5
ifort version 19.1.2.254
configure:17850: $? = 0
configure:17839: ifort -V >&5
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.2.254 Build 20200623
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

configure:17850: $? = 0
configure:17839: ifort -qversion >&5
ifort: command line warning #10006: ignoring unknown option '-qversion'
ifort: command line error: no files specified; for help type "ifort -help"
configure:17850: $? = 1
configure:17859: checking whether the compiler supports GNU Fortran 77
configure:17873: ifort -c conftest.F >&5
conftest.F(3): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( : % [ . = =>
choke me
---------------^
conftest.F(3): error #6218: This statement is positioned incorrectly and/or has syntax errors.
choke me
-------^
compilation aborted for conftest.F (code 1)
configure:17873: $? = 1
configure: failed program was:
| program main
| #ifndef __GNUC__
| choke me
| #endif
|
| end
configure:17883: result: no
configure:17891: checking whether ifort accepts -g
configure:17903: ifort -c -g conftest.f >&5
configure:17903: $? = 0
configure:17912: result: yes
configure:18041: checking if libtool supports shared libraries
configure:18043: result: yes
configure:18046: checking whether to build shared libraries
configure:18070: result: yes
configure:18073: checking whether to build static libraries
configure:18077: result: yes
configure:18429: checking for ifort option to produce PIC
configure:18437: result: -fPIC
configure:18445: checking if ifort PIC flag -fPIC works
configure:18464: ifort -c -g -fPIC conftest.f >&5
configure:18468: $? = 0
configure:18481: result: yes
configure:18504: checking if ifort static flag -static works
configure:18533: result: no
configure:18545: checking if ifort supports -c -o file.o
configure:18567: ifort -c -g -o out/conftest2.o conftest.f >&5
configure:18571: $? = 0
configure:18593: result: yes
configure:18598: checking if ifort supports -c -o file.o
configure:18646: result: yes
configure:18676: checking whether the ifort linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:19891: result: yes
configure:20033: checking dynamic linker characteristics
configure:20775: result: GNU/Linux ld.so
configure:20840: checking how to hardcode library paths into programs
configure:20865: result: immediate
configure:20898: checking for C/C++ restrict keyword
configure:20928: icc -c -g -O2 conftest.c >&5
configure:20928: $? = 0
configure:20937: result: __restrict__
configure:20960: checking whether icpc supports C++14 features with -std=gnu++14
configure:21379: icpc -std=gnu++14 -c -g -O2 conftest.cpp >&5
conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21379: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21389: result: no
configure:20960: checking whether icpc supports C++14 features with -std=gnu++1y
configure:21379: icpc -std=gnu++1y -c -g -O2 conftest.cpp >&5
conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21379: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21389: result: no
configure:21406: checking whether icpc supports C++14 features with -std=c++14
configure:21825: icpc -std=c++14 -c -g -O2 conftest.cpp >&5
conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21406: checking whether icpc supports C++14 features with +std=c++14
configure:21825: icpc +std=c++14 -c -g -O2 conftest.cpp >&5
icpc: error #10236: File not found: '+std=c++14'
conftest.cpp(37): error: #error directive: "This is not a C++11 compiler"
#error "This is not a C++11 compiler"
^

conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21406: checking whether icpc supports C++14 features with -h std=c++14
configure:21825: icpc -h std=c++14 -c -g -O2 conftest.cpp >&5
conftest.cpp(37): error: #error directive: "This is not a C++11 compiler"
#error "This is not a C++11 compiler"
^

conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21406: checking whether icpc supports C++14 features with -std=c++1y
configure:21825: icpc -std=c++1y -c -g -O2 conftest.cpp >&5
conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21406: checking whether icpc supports C++14 features with +std=c++1y
configure:21825: icpc +std=c++1y -c -g -O2 conftest.cpp >&5
icpc: error #10236: File not found: '+std=c++1y'
conftest.cpp(37): error: #error directive: "This is not a C++11 compiler"
#error "This is not a C++11 compiler"
^

conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21406: checking whether icpc supports C++14 features with -h std=c++1y
configure:21825: icpc -h std=c++1y -c -g -O2 conftest.cpp >&5
conftest.cpp(37): error: #error directive: "This is not a C++11 compiler"
#error "This is not a C++11 compiler"
^

conftest.cpp(324): error: #error directive: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
^

compilation aborted for conftest.cpp (code 2)
configure:21825: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cdo"
| #define PACKAGE_TARNAME "cdo"
| #define PACKAGE_VERSION "2.0.5"
| #define PACKAGE_STRING "cdo 2.0.5"
| #define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
| #define PACKAGE_URL ""
| #define CDO "2.0.5"
| #define PACKAGE "cdo"
| #define VERSION "2.0.5"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define STDC_HEADERS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define restrict __restrict__
| /* end confdefs.h. */
|
|
| // If the compiler admits that it is not ready for C++11, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201103L
|
| #error "This is not a C++11 compiler"
|
| #else
|
| namespace cxx11
| {
|
| namespace test_static_assert
| {
|
| template <typename T>
| struct check
| {
| static_assert(sizeof(int) <= sizeof(T), "not big enough");
| };
|
| }
|
| namespace test_final_override
| {
|
| struct Base
| {
| virtual ~Base() {}
| virtual void f() {}
| };
|
| struct Derived : public Base
| {
| virtual ~Derived() override {}
| virtual void f() override {}
| };
|
| }
|
| namespace test_double_right_angle_brackets
| {
|
| template < typename T >
| struct check {};
|
| typedef check<void> single_type;
| typedef check<check<void>> double_type;
| typedef check<check<check<void>>> triple_type;
| typedef check<check<check<check<void>>>> quadruple_type;
|
| }
|
| namespace test_decltype
| {
|
| int
| f()
| {
| int a = 1;
| decltype(a) b = 2;
| return a + b;
| }
|
| }
|
| namespace test_type_deduction
| {
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static const bool value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static const bool value = true;
| };
|
| template < typename T1, typename T2 >
| auto
| add(T1 a1, T2 a2) -> decltype(a1 + a2)
| {
| return a1 + a2;
| }
|
| int
| test(const int c, volatile int v)
| {
| static_assert(is_same<int, decltype(0)>::value == true, "");
| static_assert(is_same<int, decltype(c)>::value == false, "");
| static_assert(is_same<int, decltype(v)>::value == false, "");
| auto ac = c;
| auto av = v;
| auto sumi = ac + av + 'x';
| auto sumf = ac + av + 1.0;
| static_assert(is_same<int, decltype(ac)>::value == true, "");
| static_assert(is_same<int, decltype(av)>::value == true, "");
| static_assert(is_same<int, decltype(sumi)>::value == true, "");
| static_assert(is_same<int, decltype(sumf)>::value == false, "");
| static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
| return (sumf > 0.0) ? sumi : add(c, v);
| }
|
| }
|
| namespace test_noexcept
| {
|
| int f() { return 0; }
| int g() noexcept { return 0; }
|
| static_assert(noexcept(f()) == false, "");
| static_assert(noexcept(g()) == true, "");
|
| }
|
| namespace test_constexpr
| {
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
| {
| return *s ? strlen_c_r(s + 1, acc + 1) : acc;
| }
|
| template < typename CharT >
| unsigned long constexpr
| strlen_c(const CharT *const s) noexcept
| {
| return strlen_c_r(s, 0UL);
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("1") == 1UL, "");
| static_assert(strlen_c("example") == 7UL, "");
| static_assert(strlen_c("another\0example") == 7UL, "");
|
| }
|
| namespace test_rvalue_references
| {
|
| template < int N >
| struct answer
| {
| static constexpr int value = N;
| };
|
| answer<1> f(int&) { return answer<1>(); }
| answer<2> f(const int&) { return answer<2>(); }
| answer<3> f(int&&) { return answer<3>(); }
|
| void
| test()
| {
| int i = 0;
| const int c = 0;
| static_assert(decltype(f(i))::value == 1, "");
| static_assert(decltype(f(c))::value == 2, "");
| static_assert(decltype(f(0))::value == 3, "");
| }
|
| }
|
| namespace test_uniform_initialization
| {
|
| struct test
| {
| static const int zero {};
| static const int one {1};
| };
|
| static_assert(test::zero == 0, "");
| static_assert(test::one == 1, "");
|
| }
|
| namespace test_lambdas
| {
|
| void
| test1()
| {
| auto lambda1 = [](){};
| auto lambda2 = lambda1;
| lambda1();
| lambda2();
| }
|
| int
| test2()
| {
| auto a = [](int i, int j){ return i + j; }(1, 2);
| auto b = []() -> int { return '0'; }();
| auto c = [=](){ return a + b; }();
| auto d = [&](){ return c; }();
| auto e = [a, &b](int x) mutable {
| const auto identity = [](int y){ return y; };
| for (auto i = 0; i < a; ++i)
| a += b--;
| return x + identity(a + b);
| }(0);
| return a + b + c + d + e;
| }
|
| int
| test3()
| {
| const auto nullary = [](){ return 0; };
| const auto unary = [](int x){ return x; };
| using nullary_t = decltype(nullary);
| using unary_t = decltype(unary);
| const auto higher1st = [](nullary_t f){ return f(); };
| const auto higher2nd = [unary](nullary_t f1){
| return [unary, f1](unary_t f2){ return f2(unary(f1())); };
| };
| return higher1st(nullary) + higher2nd(nullary)(unary);
| }
|
| }
|
| namespace test_variadic_templates
| {
|
| template <int...>
| struct sum;
|
| template <int N0, int... N1toN>
| struct sum<N0, N1toN...>
| {
| static constexpr auto value = N0 + sum<N1toN...>::value;
| };
|
| template <>
| struct sum<>
| {
| static constexpr auto value = 0;
| };
|
| static_assert(sum<>::value == 0, "");
| static_assert(sum<1>::value == 1, "");
| static_assert(sum<23>::value == 23, "");
| static_assert(sum<1, 2>::value == 3, "");
| static_assert(sum<5, 5, 11>::value == 21, "");
| static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
| }
|
| // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
| // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
| // because of this.
| namespace test_template_alias_sfinae
| {
|
| struct foo {};
|
| template<typename T>
| using member = typename T::member_type;
|
| template<typename T>
| void func(...) {}
|
| template<typename T>
| void func(member<T>*) {}
|
| void test();
|
| void test() { func<foo>(0); }
|
| }
|
| } // namespace cxx11
|
| #endif // __cplusplus >= 201103L
|
|
|
|
| // If the compiler admits that it is not ready for C++14, why torture it?
| // Hopefully, this will speed up the test.
|
| #ifndef __cplusplus
|
| #error "This is not a C++ compiler"
|
| #elif __cplusplus < 201402L
|
| #error "This is not a C++14 compiler"
|
| #else
|
| namespace cxx14
| {
|
| namespace test_polymorphic_lambdas
| {
|
| int
| test()
| {
| const auto lambda = [](auto&&... args){
| const auto istiny = [](auto x){
| return (sizeof(x) == 1UL) ? 1 : 0;
| };
| const int aretiny[] = { istiny(args)... };
| return aretiny[0];
| };
| return lambda(1, 1L, 1.0f, '1');
| }
|
| }
|
| namespace test_binary_literals
| {
|
| constexpr auto ivii = 0b0000000000101010;
| static_assert(ivii == 42, "wrong value");
|
| }
|
| namespace test_generalized_constexpr
| {
|
| template < typename CharT >
| constexpr unsigned long
| strlen_c(const CharT *const s) noexcept
| {
| auto length = 0UL;
| for (auto p = s; *p; ++p)
| ++length;
| return length;
| }
|
| static_assert(strlen_c("") == 0UL, "");
| static_assert(strlen_c("x") == 1UL, "");
| static_assert(strlen_c("test") == 4UL, "");
| static_assert(strlen_c("another\0test") == 7UL, "");
|
| }
|
| namespace test_lambda_init_capture
| {
|
| int
| test()
| {
| auto x = 0;
| const auto lambda1 = [a = x](int b){ return a + b; };
| const auto lambda2 = [a = lambda1(x)](){ return a; };
| return lambda2();
| }
|
| }
|
| namespace test_digit_separators
| {
|
| constexpr auto ten_million = 100'000'000;
| static_assert(ten_million == 100000000, "");
|
| }
|
| namespace test_return_type_deduction
| {
|
| auto f(int& x) { return x; }
| decltype(auto) g(int& x) { return x; }
|
| template < typename T1, typename T2 >
| struct is_same
| {
| static constexpr auto value = false;
| };
|
| template < typename T >
| struct is_same<T, T>
| {
| static constexpr auto value = true;
| };
|
| int
| test()
| {
| auto x = 0;
| static_assert(is_same<int, decltype(f(x))>::value, "");
| static_assert(is_same<int&, decltype(g(x))>::value, "");
| return x;
| }
|
| }
|
| } // namespace cxx14
|
| #endif // __cplusplus >= 201402L
|
|
|
configure:21835: result: no
configure:21859: error: *** A compiler with support for C++14 language features is required.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_c_restrict=__restrict__
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=icc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=icpc
ac_cv_env_DCE_UUID_C_INCLUDE_set=
ac_cv_env_DCE_UUID_C_INCLUDE_value=
ac_cv_env_DCE_UUID_C_LIB_set=
ac_cv_env_DCE_UUID_C_LIB_value=
ac_cv_env_F77_set=set
ac_cv_env_F77_value=ifort
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_OSSP_UUID_C_INCLUDE_set=
ac_cv_env_OSSP_UUID_C_INCLUDE_value=
ac_cv_env_OSSP_UUID_C_LIB_set=
ac_cv_env_OSSP_UUID_C_LIB_value=
ac_cv_env_UTIL_LINUX_UUID_C_INCLUDE_set=
ac_cv_env_UTIL_LINUX_UUID_C_INCLUDE_value=
ac_cv_env_UTIL_LINUX_UUID_C_LIB_set=
ac_cv_env_UTIL_LINUX_UUID_C_LIB_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_f77_compiler_gnu=no
ac_cv_header_dlfcn_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdio_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_param_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_FGREP='/usr/bin/grep -F'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_ac_pt_BASH=/bin/sh
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_lt_DD=/usr/bin/dd
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CXXCPP='icpc -E'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=icc
ac_cv_prog_ac_ct_CXX=icpc
ac_cv_prog_ac_ct_OBJDUMP=objdump
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_c11=-std=gnu11
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=-std=gnu11
ac_cv_prog_cxx_11=no
ac_cv_prog_cxx_g=yes
ac_cv_prog_cxx_stdcxx=
ac_cv_prog_f77_g=yes
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
am_cv_CXX_dependencies_compiler_type=gcc3
am_cv_ar_interface=ar
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes
ax_cv_cxx_compile_cxx14__h_std_cpp14=no
ax_cv_cxx_compile_cxx14__h_std_cpp1y=no
ax_cv_cxx_compile_cxx14__std_cpp14=no
ax_cv_cxx_compile_cxx14__std_cpp1y=no
ax_cv_cxx_compile_cxx14__std_gnupp14=no
ax_cv_cxx_compile_cxx14__std_gnupp1y=no
ax_cv_cxx_compile_cxx14_pstd_cpp14=no
ax_cv_cxx_compile_cxx14_pstd_cpp1y=no
lt_cv_ar_at_file=@
lt_cv_archive_cmds_need_lc=no
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_ld_reload_flag=-r
lt_cv_nm_interface='BSD nm'
lt_cv_objdir=.libs
lt_cv_path_LD=/usr/bin/ld
lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64'
lt_cv_path_NM='/usr/bin/nm -B'
lt_cv_path_mainfest_tool=no
lt_cv_prog_compiler_c_o=yes
lt_cv_prog_compiler_c_o_CXX=yes
lt_cv_prog_compiler_c_o_F77=yes
lt_cv_prog_compiler_pic='-fPIC -DPIC'
lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC'
lt_cv_prog_compiler_pic_F77=-fPIC
lt_cv_prog_compiler_pic_works=yes
lt_cv_prog_compiler_pic_works_CXX=yes
lt_cv_prog_compiler_pic_works_F77=yes
lt_cv_prog_compiler_rtti_exceptions=yes
lt_cv_prog_compiler_static_works=no
lt_cv_prog_compiler_static_works_CXX=no
lt_cv_prog_compiler_static_works_F77=no
lt_cv_prog_gnu_ld=yes
lt_cv_prog_gnu_ldcxx=yes
lt_cv_sharedlib_from_linklib_cmd='printf %s\n'
lt_cv_shlibpath_overrides_runpath=no
lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\'''
lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\'''
lt_cv_sys_global_symbol_to_import=
lt_cv_sys_max_cmd_len=3458764513820540925
lt_cv_to_host_file_cmd=func_convert_file_noop
lt_cv_to_tool_file_cmd=func_convert_file_noop
lt_cv_truncate_bin='/usr/bin/dd bs=4096 count=1'

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} '\''/gpfs/home/jin/testdir/cdo-2.0.5/config/missing'\'' aclocal-1.16'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_CPPFLAGS=''
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR='ar'
AS=''
AUTOCONF='${SHELL} '\''/gpfs/home/jin/testdir/cdo-2.0.5/config/missing'\'' autoconf'
AUTOHEADER='${SHELL} '\''/gpfs/home/jin/testdir/cdo-2.0.5/config/missing'\'' autoheader'
AUTOMAKE='${SHELL} '\''/gpfs/home/jin/testdir/cdo-2.0.5/config/missing'\'' automake-1.16'
AWK='gawk'
BASH='/bin/sh'
CC='icc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CLDFLAGS=''
CLIBS=''
CMOR_LIBS=''
CPP=''
CPPFLAGS=''
CSCOPE='cscope'
CTAGS='ctags'
CURL_INCLUDE=''
CURL_LDFLAGS=''
CXX='icpc'
CXXCPP='icpc -E'
CXXDEPMODE='depmode=gcc3'
CXXFLAGS='-g -O2'
CYGPATH_W='echo'
DCE_UUIDROOT=''
DCE_UUID_C_INCLUDE=''
DCE_UUID_C_LIB=''
DEFS=''
DEPDIR='.deps'
DLLTOOL='false'
DSYMUTIL=''
DUMPBIN=''
ECCODES_INCLUDE=''
ECCODES_LIBS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
ENABLE_ACROSS=''
ENABLE_ALL_STATIC_FALSE=''
ENABLE_ALL_STATIC_TRUE=''
ENABLE_CDI_APP_FALSE=''
ENABLE_CDI_APP_TRUE=''
ENABLE_CDI_LIB=''
ENABLE_CDI_LIB_FALSE=''
ENABLE_CDI_LIB_TRUE=''
ENABLE_CGRIBEX=''
ENABLE_EXTRA=''
ENABLE_FORTRAN=''
ENABLE_GRIB=''
ENABLE_GRIBAPI=''
ENABLE_HIRLAM_EXTENSIONS_FALSE=''
ENABLE_HIRLAM_EXTENSIONS_TRUE=''
ENABLE_IEG=''
ENABLE_MAGICS_FALSE=''
ENABLE_MAGICS_TRUE=''
ENABLE_NC2=''
ENABLE_NC4=''
ENABLE_NC4HDF5=''
ENABLE_NC4SZLIB=''
ENABLE_NETCDF=''
ENABLE_SERVICE=''
ENABLE_THREADS=''
ETAGS='etags'
EXEEXT=''
F77='ifort'
FDB5_INCLUDE=''
FDB5_LIBS=''
FFLAGS='-g'
FGREP='/usr/bin/grep -F'
FORTRAN_WORKS=''
GREP='/usr/bin/grep'
GRIB_API_INCLUDE=''
GRIB_API_LIBS=''
HAVE_CXX14=''
HAVE_LIBGRIB_API_FALSE=''
HAVE_LIBGRIB_API_TRUE=''
HDF5_INCLUDE=''
HDF5_LIBS=''
HDF5_ROOT='/gpfs/software/hdf5/intel/1.10.5'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD='/usr/bin/ld -m elf_x86_64'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LIPO=''
LN_S='ln -s'
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAGICS_INCLUDE=''
MAGICS_LIBS=''
MAGICS_ROOT=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} '\''/gpfs/home/jin/testdir/cdo-2.0.5/config/missing'\'' makeinfo'
MANIFEST_TOOL=':'
MKDIR_P='/usr/bin/mkdir -p'
NC_CONFIG=''
NETCDF_INCLUDE=''
NETCDF_LIBS=''
NETCDF_ROOT=''
NM='/usr/bin/nm -B'
NMEDIT=''
OBJDUMP='objdump'
OBJEXT='o'
OPENMP_CFLAGS=''
OSSP_UUIDROOT=''
OSSP_UUID_C_INCLUDE=''
OSSP_UUID_C_LIB=''
OTOOL64=''
OTOOL=''
PACKAGE='cdo'
PACKAGE_BUGREPORT='https://mpimet.mpg.de/cdo'
PACKAGE_NAME='cdo'
PACKAGE_STRING='cdo 2.0.5'
PACKAGE_TARNAME='cdo'
PACKAGE_URL=''
PACKAGE_VERSION='2.0.5'
PATH_SEPARATOR=':'
PROJ_INCLUDE=''
PROJ_LDFLAGS=''
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
RANLIB='ranlib'
SED='/usr/bin/sed'
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
SYSTEM_TYPE=''
SZLIB_INCLUDE=''
SZLIB_LIBS=''
THREADS_INCLUDE=''
THREADS_LIBS=''
UDUNITS_INCLUDE=''
UDUNITS_LDFLAGS=''
USE_F77_FALSE=''
USE_F77_TRUE=''
UTIL_LINUX_UUIDROOT=''
UTIL_LINUX_UUID_C_INCLUDE=''
UTIL_LINUX_UUID_C_LIB=''
UUID_C_INCLUDE=''
UUID_C_LIB=''
VERSION='2.0.5'
XML2_LIBS=''
ac_ct_AR='ar'
ac_ct_CC='icc'
ac_ct_CXX='icpc'
ac_ct_DUMPBIN=''
ac_ct_F77=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE='#'
am__fastdepCXX_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
ax_pthread_config=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-pc-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /gpfs/home/jin/testdir/cdo-2.0.5/config/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/gpfs/home/jin/tools/pkgs/cdo-2.0.5'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs_extra=''
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "cdo"
#define PACKAGE_TARNAME "cdo"
#define PACKAGE_VERSION "2.0.5"
#define PACKAGE_STRING "cdo 2.0.5"
#define PACKAGE_BUGREPORT "https://mpimet.mpg.de/cdo"
#define PACKAGE_URL ""
#define CDO "2.0.5"
#define PACKAGE "cdo"
#define VERSION "2.0.5"
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_STRINGS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_PARAM_H 1
#define STDC_HEADERS 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define restrict __restrict__

configure: exit 1
    (1-1/1)