Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure does not pick compiler from R settings #8

Open
barracuda156 opened this issue Apr 12, 2023 · 3 comments
Open

configure does not pick compiler from R settings #8

barracuda156 opened this issue Apr 12, 2023 · 3 comments

Comments

@barracuda156
Copy link

barracuda156 commented Apr 12, 2023

UPD. The only issue is compiler choice. Configure seems to ignore both R settings and env, but when I explicitly force CC= and CXX= via adding these to configure, everything is fine and tests pass.

  1. It seems that configure does not use compiler from R settings but picks OS default. This results in wrong settings (this is Rosetta, physical cpu is Intel, but build and host are ppc):
** using staged installation
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for g++ option to enable C++11 features... (cached) none needed
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking for gcc... gcc
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... unsupported
checking for gcc option to enable C99 features... -std=gnu99
checking for x86 cpuid  output... unknown
checking for x86-AVX xgetbv  output... unknown
checking for x86 cpuid 0x00000000 output... d:756e6547:6c65746e:49656e69
checking for x86 cpuid 0x00000001 output... 106a5:1060800:ffba220b:1f8bfbff
checking whether SSE2 is supported by the processor... yes
checking whether SSE2 is supported by the processor and OS... yes
checking whether C++ compiler accepts -msse2... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for malloc.h... no
checking size of size_t... 8
checking alignment of void*... 8
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for working posix_memalign... yes
checking for ffs... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
  1. The package pulls in Intel intrinsics headers on PowerPC:
/opt/local/bin/g++-mp-12 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"include" -I"include/sundials" -I"../inst/include" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/dbarts/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include  -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include' -D_REENTRANT -DSTAN_THREADS   -fPIC  -pipe -Os -arch ppc  -c bart_util.cpp -o bart_util.o
/opt/local/bin/g++-mp-12 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"include" -I"include/sundials" -I"../inst/include" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/dbarts/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include  -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include' -D_REENTRANT -DSTAN_THREADS   -fPIC  -pipe -Os -arch ppc  -c init.cpp -o init.o
/opt/local/bin/gcc-mp-12 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"include" -I"include/sundials" -I"../inst/include" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/BH/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/dbarts/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fPIC  -pipe -Os -arch ppc  -c misc_adaptiveRadixTree.c -o misc_adaptiveRadixTree.o
In file included from include/misc/intrinsic.h:11,
                 from misc_adaptiveRadixTree.c:51:
/opt/local/lib/gcc12/gcc/powerpc-apple-darwin10/12.2.0/include/emmintrin.h:56:2: error: #error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
   56 | #error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
      |  ^~~~~
  1. Source code seems to unconditionally use 64-bit settings:
In file included from /opt/local/Library/Frameworks/R.framework/Resources/include/R.h:70,
                 from include/ext/R.h:24,
                 from include/ext/io.h:4,
                 from misc_adaptiveRadixTree.c:53:
/opt/local/Library/Frameworks/R.framework/Resources/include/Rconfig.h: At top level:
/opt/local/Library/Frameworks/R.framework/Resources/include/Rconfig.h:26: warning: "SIZEOF_SIZE_T" redefined
   26 | #define SIZEOF_SIZE_T 4
      | 
In file included from misc_adaptiveRadixTree.c:38:
config.h:74: note: this is the location of the previous definition
   74 | #define SIZEOF_SIZE_T 8
      |
@barracuda156
Copy link
Author

Yeah, sure enough, configure script ignores R compiler settings altogether:

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

It was created by stan4bart configure 0.0.4, which was
generated by GNU Autoconf 2.71.  Invocation command line was

  $ ./configure

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

hostname = macmini.private
uname -m = x86_64
uname -r = 10.8.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64

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

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64
Kernel configured for up to 6 processors.
6 processors are physically available.
6 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5
Primary memory available: 7.88 gigabytes
Default processor set: 149 tasks, 383 threads, 6 processors
Load average: 1.08, Mach factor: 4.90
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /opt/local/bin/
PATH: /opt/local/sbin/
PATH: /bin/
PATH: /sbin/
PATH: /usr/bin/
PATH: /usr/sbin/


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

configure:2874: looking for aux files: config.guess config.sub
configure:2887:  trying ./tools/build-aux/
configure:2916:   ./tools/build-aux/config.guess found
configure:2916:   ./tools/build-aux/config.sub found
configure:3375: checking for g++
configure:3396: found /usr/bin/g++
configure:3407: result: g++
configure:3434: checking for C++ compiler version
configure:3443: g++ --version >&5
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3454: $? = 0
configure:3443: g++ -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
configure:3454: $? = 0
configure:3443: g++ -V >&5
g++-4.2: argument to `-V' is missing
configure:3454: $? = 1
configure:3443: g++ -qversion >&5
i686-apple-darwin10-g++-4.2.1: no input files
configure:3454: $? = 1
configure:3474: checking whether the C++ compiler works
configure:3496: g++    conftest.cpp  >&5
configure:3500: $? = 0
configure:3550: result: yes
configure:3553: checking for C++ compiler default output file name
configure:3555: result: a.out
configure:3561: checking for suffix of executables
configure:3568: g++ -o conftest    conftest.cpp  >&5
configure:3572: $? = 0
configure:3595: result: 
configure:3617: checking whether we are cross compiling
configure:3625: g++ -o conftest    conftest.cpp  >&5
configure:3629: $? = 0
configure:3636: ./conftest
configure:3640: $? = 0
configure:3655: result: no
configure:3660: checking for suffix of object files
configure:3683: g++ -c   conftest.cpp >&5
configure:3687: $? = 0
configure:3709: result: o
configure:3713: checking whether the compiler supports GNU C++
configure:3733: g++ -c   conftest.cpp >&5
configure:3733: $? = 0
configure:3743: result: yes
configure:3754: checking whether g++ accepts -g
configure:3775: g++ -c -g  conftest.cpp >&5
configure:3775: $? = 0
configure:3819: result: yes
configure:3839: checking for g++ option to enable C++11 features
configure:3854: g++  -c -g -O2  conftest.cpp >&5
conftest.cpp:12:3: error: #error "Compiler does not advertise C++98 conformance"
conftest.cpp:55:3: error: #error "Compiler does not advertise C++11 conformance"
conftest.cpp:60: error: expected constructor, destructor, or type conversion before 'int'
conftest.cpp: In constructor 'cxx11test::delegate::delegate()':
conftest.cpp:72: error: type 'cxx11test::delegate' is not a direct base of 'cxx11test::delegate'
conftest.cpp: At global scope:
conftest.cpp:83: error: expected ';' before 'override'
conftest.cpp:84: error: expected `;' before '}' token
conftest.cpp:90: error: invalid pure specifier (only `= 0' is allowed) before ';' token
conftest.cpp:91: error: invalid pure specifier (only `= 0' is allowed) before ';' token
conftest.cpp:92: error: invalid pure specifier (only `= 0' is allowed) before ';' token
conftest.cpp:90: error: initializer specified for non-virtual method 'cxx11test::nocopy::nocopy()'
conftest.cpp:91: error: initializer specified for non-virtual method 'cxx11test::nocopy::nocopy(const cxx11test::nocopy&)'
conftest.cpp:92: error: initializer specified for non-virtual method 'cxx11test::nocopy& cxx11test::nocopy::operator=(const cxx11test::nocopy&)'
conftest.cpp:104: error: expected initializer before '->' token
conftest.cpp:108: error: expected nested-name-specifier before '...' token
conftest.cpp:108: error: expected '>' before '...' token
conftest.cpp:108: error: 'Args' has not been declared
conftest.cpp:108: error: expected `)' before 'rest'
conftest.cpp:108: error: expected initializer before 'rest'
conftest.cpp: In function 'int main(int, char**)':
conftest.cpp:132: error: ISO C++ forbids declaration of 'a1' with no type
conftest.cpp:133: error: ISO C++ forbids declaration of 'a2' with no type
conftest.cpp:134: error: ISO C++ forbids declaration of 'a3' with no type
conftest.cpp:134: error: invalid conversion from 'const char*' to 'int'
conftest.cpp:137: error: ISO C++ forbids declaration of 'i' with no type
conftest.cpp:137: error: invalid type argument of 'unary *'
conftest.cpp:137: error: invalid type argument of 'unary *'
conftest.cpp:139: error: 'decltype' was not declared in this scope
conftest.cpp:139: error: expected `;' before 'a4'
conftest.cpp:143: error: 'get_val' is not a member of 'cxx11test'
conftest.cpp:153: error: a function-definition is not allowed here before ':' token
conftest.cpp:154: error: expected primary-expression before '}' token
conftest.cpp:154: error: expected `;' before '}' token
conftest.cpp:154: error: expected primary-expression before '}' token
conftest.cpp:154: error: expected `)' before '}' token
conftest.cpp:154: error: expected primary-expression before '}' token
conftest.cpp:154: error: expected `;' before '}' token
conftest.cpp:158: error: expected primary-expression before '[' token
conftest.cpp:158: error: expected primary-expression before ']' token
conftest.cpp:158: error: expected primary-expression before 'int'
conftest.cpp:160: error: expected primary-expression before '[' token
conftest.cpp:160: error: expected primary-expression before ']' token
conftest.cpp:160: error: expected primary-expression before 'double'
conftest.cpp:162: error: expected primary-expression before '[' token
conftest.cpp:162: error: expected primary-expression before '=' token
conftest.cpp:162: error: expected primary-expression before ']' token
conftest.cpp:162: error: expected primary-expression before 'double'
conftest.cpp:167: error: 'cxx11test::sum' has not been declared
conftest.cpp:168: error: ISO C++ forbids declaration of 'a' with no type
conftest.cpp:168: error: 'sum' was not declared in this scope
conftest.cpp:169: error: ISO C++ forbids declaration of 'b' with no type
conftest.cpp:170: error: ISO C++ forbids declaration of 'c' with no type
conftest.cpp:184: error: 'nullptr' was not declared in this scope
conftest.cpp:188: error: '>>' should be '> >' within a nested template argument list
conftest.cpp:188: error: '<::' cannot begin a template-argument list
conftest.cpp:188: note: '<:' is an alternate spelling for '['. Insert whitespace between '<' and '::'
conftest.cpp:188: note: (if you use -fpermissive G++ will accept your code)
conftest.cpp:192: error: 'u8' was not declared in this scope
conftest.cpp:192: error: expected ',' or ';' before string constant
conftest.cpp:193: error: 'char16_t' was not declared in this scope
conftest.cpp:193: error: expected `;' before 'const'
conftest.cpp:194: error: 'char32_t' was not declared in this scope
conftest.cpp:194: error: expected `;' before 'const'
configure:3854: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* 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:3872: result: none needed
configure:3942: checking how to run the C++ preprocessor
configure:3964: g++ -E  conftest.cpp
configure:3964: $? = 0
configure:3979: g++ -E  conftest.cpp
conftest.cpp:9:28: error: ac_nonexistent.h: No such file or directory
configure:3979: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4006: result: g++ -E
configure:4020: g++ -E  conftest.cpp
configure:4020: $? = 0
configure:4035: g++ -E  conftest.cpp
conftest.cpp:9:28: error: ac_nonexistent.h: No such file or directory
configure:4035: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4189: checking for C++ compiler version
configure:4198: g++ --version >&5
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4209: $? = 0
configure:4198: g++ -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
configure:4209: $? = 0
configure:4198: g++ -V >&5
g++-4.2: argument to `-V' is missing
configure:4209: $? = 1
configure:4198: g++ -qversion >&5
i686-apple-darwin10-g++-4.2.1: no input files
configure:4209: $? = 1
configure:4213: checking whether the compiler supports GNU C++
configure:4243: result: yes
configure:4254: checking whether g++ accepts -g
configure:4319: result: yes
configure:4339: checking for g++ option to enable C++11 features
configure:4372: result: none needed
configure:4444: checking build system type
configure:4459: result: x86_64-apple-darwin10.8.0
configure:4479: checking host system type
configure:4493: result: x86_64-apple-darwin10.8.0
configure:4575: checking for gcc
configure:4596: found /usr/bin/gcc
configure:4607: result: gcc
configure:4960: checking for C compiler version
configure:4969: gcc --version >&5
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4980: $? = 0
configure:4969: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
configure:4980: $? = 0
configure:4969: gcc -V >&5
gcc-4.2: argument to `-V' is missing
configure:4980: $? = 1
configure:4969: gcc -qversion >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:4980: $? = 1
configure:4969: gcc -version >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:4980: $? = 1
configure:4984: checking whether the compiler supports GNU C
configure:5004: gcc -c   conftest.c >&5
configure:5004: $? = 0
configure:5014: result: yes
configure:5025: checking whether gcc accepts -g
configure:5046: gcc -c -g  conftest.c >&5
configure:5046: $? = 0
configure:5090: result: yes
configure:5110: checking for gcc option to enable C11 features
configure:5125: gcc  -c -g -O2  conftest.c >&5
conftest.c:61:3: error: #error "Compiler does not advertise C99 conformance"
conftest.c:116: error: expected ';', ',' or ')' before 'text'
conftest.c:165:3: error: #error "Compiler does not advertise C11 conformance"
conftest.c: In function '_Alignas':
conftest.c:169: error: expected declaration specifiers before 'aligned_as_double'
conftest.c:170: error: expected declaration specifiers or '...' before numeric constant
conftest.c:170: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'no_special_alignment'
conftest.c:171: error: storage class specified for parameter 'aligned_as_int'
conftest.c:172: error: expected declaration specifiers or '...' before numeric constant
conftest.c:172: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_Alignas'
conftest.c:177: error: expected expression before 'int'
conftest.c:177: error: enumerator value for 'int_alignment' is not an integer constant
conftest.c:178: error: expected expression before 'int'
conftest.c:178: error: enumerator value for 'int_array_alignment' is not an integer constant
conftest.c:179: error: expected expression before 'char'
conftest.c:180: error: enumerator value for 'char_alignment' is not an integer constant
conftest.c:180: warning: empty declaration
conftest.c:181: error: expected declaration specifiers before '_Static_assert'
conftest.c:184: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'does_not_return'
conftest.c:190: error: expected specifier-qualifier-list before '_Static_assert'
conftest.c:193: warning: empty declaration
conftest.c:197: error: parameter 'utf8_literal' is initialized
conftest.c:197: error: 'syntax' undeclared (first use in this function)
conftest.c:197: error: (Each undeclared identifier is reported only once
conftest.c:197: error: for each function it appears in.)
conftest.c:197: error: expected ',' or ';' before 'error'
conftest.c:200: error: storage class specified for parameter 'long_ptr'
conftest.c:201: error: storage class specified for parameter 'long_ptr'
conftest.c:201: error: redefinition of parameter 'long_ptr'
conftest.c:200: error: previous definition of 'long_ptr' was here
conftest.c:202: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'long_ptr'
conftest.c:217: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
conftest.c:269: error: old-style parameter declarations in prototyped function definition
conftest.c:169: error: parameter name omitted
conftest.c:269: error: expected '{' at end of input
configure:5125: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* 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:5125: gcc -std=gnu11 -c -g -O2  conftest.c >&5
cc1: error: unrecognized command line option "-std=gnu11"
configure:5125: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* 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:5138: result: unsupported
configure:5156: checking for gcc option to enable C99 features
configure:5171: gcc  -c -g -O2  conftest.c >&5
conftest.c:61:3: error: #error "Compiler does not advertise C99 conformance"
conftest.c:116: error: expected ';', ',' or ')' before 'text'
conftest.c: In function 'main':
conftest.c:178: error: nested functions are disabled, use -fnested-functions to re-enable
conftest.c:178: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'newvar'
conftest.c:178: error: 'newvar' undeclared (first use in this function)
conftest.c:178: error: (Each undeclared identifier is reported only once
conftest.c:178: error: for each function it appears in.)
conftest.c:188: error: 'for' loop initial declaration used outside C99 mode
configure:5171: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* 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;
| }
| 
| 
| 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);
| 
|   return ok;
| }
| 
configure:5171: gcc -std=gnu99 -c -g -O2  conftest.c >&5
configure:5171: $? = 0
configure:5192: result: -std=gnu99
configure:5261: checking for x86 cpuid  output
configure:5295: gcc -std=gnu99 -o conftest -g -O2   conftest.c  >&5
conftest.c: In function 'main':
conftest.c:14: error: expected expression before ',' token
configure:5295: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main (void)
| {
| 
|      int op = , level = 0, eax, ebx, ecx, edx;
|      FILE *f;
|       __asm__ __volatile__ ("xchg %%ebx, %1\n"
|         "cpuid\n"
|         "xchg %%ebx, %1\n"
|         : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
|         : "a" (op), "2" (level));
| 
|      f = fopen("conftest_cpuid", "w"); if (!f) return 1;
|      fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
|      fclose(f);
|      return 0;
| 
|   ;
|   return 0;
| }
configure:5306: result: unknown
configure:5323: checking for x86-AVX xgetbv  output
configure:5355: gcc -std=gnu99 -o conftest -g -O2   conftest.c  >&5
conftest.c: In function 'main':
conftest.c:14: error: expected expression before ',' token
configure:5355: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main (void)
| {
| 
|      int op = , eax, edx;
|      FILE *f;
|       /* Opcodes for xgetbv */
|       __asm__ __volatile__ (".byte 0x0f, 0x01, 0xd0"
|         : "=a" (eax), "=d" (edx)
|         : "c" (op));
|      f = fopen("conftest_xgetbv", "w"); if (!f) return 1;
|      fprintf(f, "%x:%x\n", eax, edx);
|      fclose(f);
|      return 0;
| 
|   ;
|   return 0;
| }
configure:5366: result: unknown
configure:5397: checking for x86 cpuid 0x00000000 output
configure:5431: gcc -std=gnu99 -o conftest -g -O2   conftest.c  >&5
configure:5431: $? = 0
configure:5431: ./conftest
configure:5431: $? = 0
configure:5442: result: d:756e6547:6c65746e:49656e69
configure:5467: checking for x86 cpuid 0x00000001 output
configure:5501: gcc -std=gnu99 -o conftest -g -O2   conftest.c  >&5
configure:5501: $? = 0
configure:5501: ./conftest
configure:5501: $? = 0
configure:5512: result: 106a5:1060800:ffba220b:1f8bfbff
configure:5574: gcc -std=gnu99 -o conftest -g -O2   conftest.c  >&5
configure:5574: $? = 0
configure:5574: ./conftest
configure:5574: $? = 0
configure:5606: checking whether SSE2 is supported by the processor
configure:5620: result: yes
configure:5624: checking whether SSE2 is supported by the processor and OS
configure:5638: result: yes
configure:5643: checking whether C++ compiler accepts -msse2
configure:5663: g++ -c -g -O2  -msse2  conftest.cpp >&5
configure:5663: $? = 0
configure:5673: result: yes
configure:5730: checking for stdio.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for stdlib.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for string.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for inttypes.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for stdint.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for strings.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for sys/stat.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for sys/types.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5730: checking for unistd.h
configure:5730: g++ -c -g -O2  conftest.cpp >&5
configure:5730: $? = 0
configure:5730: result: yes
configure:5755: checking for malloc.h
configure:5755: g++ -c -g -O2  conftest.cpp >&5
conftest.cpp:48:20: error: malloc.h: No such file or directory
configure:5755: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| #define HAVE_SSE2 1
| #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 STDC_HEADERS 1
| /* end confdefs.h.  */
| #include <stddef.h>
| #ifdef HAVE_STDIO_H
| # include <stdio.h>
| #endif
| #ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| #endif
| #ifdef HAVE_STRING_H
| # include <string.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <malloc.h>
configure:5755: result: no
configure:5767: checking size of size_t
configure:5773: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:5773: $? = 0
configure:5773: ./conftest
configure:5773: $? = 0
configure:5788: result: 8
configure:5798: checking alignment of void*
configure:5804: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:5804: $? = 0
configure:5804: ./conftest
configure:5804: $? = 0
configure:5820: result: 8
configure:5829: checking for size_t
configure:5829: g++ -c -g -O2  conftest.cpp >&5
configure:5829: $? = 0
configure:5829: g++ -c -g -O2  conftest.cpp >&5
conftest.cpp: In function 'int main()':
conftest.cpp:53: error: expected primary-expression before ')' token
configure:5829: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "stan4bart"
| #define PACKAGE_TARNAME "stan4bart"
| #define PACKAGE_VERSION "0.0.4"
| #define PACKAGE_STRING "stan4bart 0.0.4"
| #define PACKAGE_BUGREPORT "vdorie@gmail.com"
| #define PACKAGE_URL ""
| #define HAVE_SSE2 1
| #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 STDC_HEADERS 1
| #define SIZEOF_SIZE_T 8
| #define ALIGNOF_VOIDP 8
| /* end confdefs.h.  */
| #include <stddef.h>
| #ifdef HAVE_STDIO_H
| # include <stdio.h>
| #endif
| #ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| #endif
| #ifdef HAVE_STRING_H
| # include <string.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main (void)
| {
| if (sizeof ((size_t)))
| 	    return 0;
|   ;
|   return 0;
| }
configure:5829: result: yes
configure:5841: checking for working alloca.h
configure:5859: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:5859: $? = 0
configure:5868: result: yes
configure:5876: checking for alloca
configure:5921: result: yes
configure:5988: checking for working posix_memalign
configure:6014: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:6014: $? = 0
configure:6014: ./conftest
configure:6014: $? = 0
configure:6025: result: yes
configure:6033: checking for ffs
configure:6033: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:6033: $? = 0
configure:6033: result: yes
configure:6157: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by stan4bart config.status 0.0.4, which was
generated by GNU Autoconf 2.71.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on macmini.private

config.status:812: creating src/Makevars
config.status:812: creating src/config.h

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

ac_cv_alignof_voidp=8
ac_cv_build=x86_64-apple-darwin10.8.0
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_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=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_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_func_alloca_works=yes
ac_cv_func_ffs=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_malloc_h=no
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_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-apple-darwin10.8.0
ac_cv_objext=o
ac_cv_prog_CXXCPP='g++ -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cc_c11=no
ac_cv_prog_cc_c99=-std=gnu99
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=-std=gnu99
ac_cv_prog_cxx_11=no
ac_cv_prog_cxx_g=yes
ac_cv_prog_cxx_stdcxx=
ac_cv_sizeof_size_t=8
ac_cv_type_size_t=yes
ac_cv_working_alloca_h=yes
ax_cv_check_cxxflags___msse2=yes
ax_cv_func_posix_memalign_works=yes
ax_cv_gcc_x86_avx_xgetbv_=unknown
ax_cv_gcc_x86_cpuid_0x00000000=d:756e6547:6c65746e:49656e69
ax_cv_gcc_x86_cpuid_0x00000001=106a5:1060800:ffba220b:1f8bfbff
ax_cv_gcc_x86_cpuid_=unknown
ax_cv_have_mmx_os_support_ext=yes
ax_cv_have_none_os_support_ext=yes
ax_cv_have_sse2_cpu_ext=yes
ax_cv_have_sse2_ext=yes
ax_cv_have_sse_os_support_ext=yes
ax_cv_support_sse2_ext=yes

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

ALLOCA=''
CC='gcc -std=gnu99'
CFLAGS='-g -O2'
CPPFLAGS=''
CXX='g++'
CXXCPP='g++ -E'
CXXFLAGS='-g -O2'
DEFS='-DHAVE_CONFIG_H'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT='vdorie@gmail.com'
PACKAGE_NAME='stan4bart'
PACKAGE_STRING='stan4bart 0.0.4'
PACKAGE_TARNAME='stan4bart'
PACKAGE_URL=''
PACKAGE_VERSION='0.0.4'
PATH_SEPARATOR=':'
PKG_CXXFLAGS='-I'\''/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/include'\'' -D_REENTRANT -DSTAN_THREADS  '
PKG_LIBS=' -L/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/lib/ -Wl,-rpath,'\''/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/lib/'\'' -ltbb -ltbbmalloc'
SHELL='/bin/sh'
TBB_LIB='/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppParallel/lib/'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin10.8.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin10.8.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host='x86_64-apple-darwin10.8.0'
host_alias=''
host_cpu='x86_64'
host_os='darwin10.8.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

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

/* confdefs.h */
#define PACKAGE_NAME "stan4bart"
#define PACKAGE_TARNAME "stan4bart"
#define PACKAGE_VERSION "0.0.4"
#define PACKAGE_STRING "stan4bart 0.0.4"
#define PACKAGE_BUGREPORT "vdorie@gmail.com"
#define PACKAGE_URL ""
#define HAVE_SSE2 1
#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 STDC_HEADERS 1
#define SIZEOF_SIZE_T 8
#define ALIGNOF_VOIDP 8
#define HAVE_ALLOCA_H 1
#define HAVE_ALLOCA 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_FFS 1

configure: exit 0

@barracuda156
Copy link
Author

UPD. Okay, it seems all troubles stem from picking a wrong compiler, which sets wrong triple, SSE2 gets misdetected as being supported, that sets wrong pointer size and pulls in wrong intrinsics headers, and since R uses gcc-12, it triggers unsupported ppc64le insns that require VSX, which is unavailable, so we get a lot of errors.

@barracuda156 barracuda156 changed the title PowerPC compilation issues configure does not pick compiler from R settings Apr 13, 2023
@barracuda156
Copy link
Author

Explicitly forcing the right compiler fixes everything:

checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether /opt/local/bin/g++-mp-12 accepts -g... yes
checking for /opt/local/bin/g++-mp-12 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... /opt/local/bin/g++-mp-12 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether /opt/local/bin/g++-mp-12 accepts -g... (cached) yes
checking for /opt/local/bin/g++-mp-12 option to enable C++11 features... (cached) none needed
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking for gcc... /opt/local/bin/gcc-mp-12
checking whether the compiler supports GNU C... yes
checking whether /opt/local/bin/gcc-mp-12 accepts -g... yes
checking for /opt/local/bin/gcc-mp-12 option to enable C11 features... none needed
checking for x86 cpuid  output... unknown
checking for x86-AVX xgetbv  output... unknown
checking for x86 cpuid 0x00000000 output... unknown
checking whether SSE2 is supported by the processor... no

Perhaps x86 cpuid should be used conditionally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant