r-dbi / RSQLite

R interface for SQLite
https://rsqlite.r-dbi.org
GNU Lesser General Public License v2.1
327 stars 79 forks source link

Unable to install from source with Mac OS 13.4.1 (clang-1403.0.22.14.1) #467

Closed RoganGrant closed 1 year ago

RoganGrant commented 1 year ago

Currently install fails for Mac OS 13.4.1 with clang-1403.0.22.14.1, XCode 14.3.1 (14E300c). The resultant error is as follows. Seems like there is incompatibility with the use of nullptr_t?

Thank you in advance for your help!

sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.1 tools_4.3.1    renv_1.0.0    

Thank you in advance for your help!

Error: Error installing package 'RSQLite':
===================================

* installing *source* package ‘RSQLite’ ...
** package ‘RSQLite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘’
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/include" -DNDEBUG -I. -Ivendor -Ivendor/extensions -Ivendor/sqlite3 -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DSQLITE_USE_URI=1 -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I'/Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/plogr/include' -I'/Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include' "-I/opt/homebrew/opt/libomp/include"    -fPIC  -falign-functions=64 -Wall -g -O2  -c DbColumn.cpp -o DbColumn.o
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:3:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/R.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/include/Rinternals.h:36:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:50:9: error: no member named 'nullptr_t' in the global namespace
using ::nullptr_t;
      ~~^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:310:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:452:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_compound.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_fundamental.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
                                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: template argument for template type parameter must be a type
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
                                                ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:23:17: note: template parameter is declared here
template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
                ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:544:5: error: use of undeclared identifier '__promote'
    __promote<_A1, _A2, _A3>
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:548:22: error: no template named '__promote'
    typedef typename __promote<_A1, _A2, _A3>::type __result_type;
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:552:12: error: call to 'hypot' is ambiguous
    return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
           ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:533:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY float       hypot(       float __x,       float __y,       float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:534:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY double      hypot(      double __x,      double __y,      double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:535:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:841:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/unwrap_range.h:16:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/next.h:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/advance.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/unreachable.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:123:9: error: target of using declaration conflicts with declaration already in scope
using ::abs _LIBCPP_USING_IF_EXISTS;
        ^
/usr/local/include/stdlib.h:132:6: note: target of using declaration
int      abs(int) __pure2;
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:339:1: note: conflicting declaration
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:45: error: field has incomplete type 'std::exception_ptr'
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:144:24: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_TYPE_VIS exception_ptr
                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:689:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
#  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:673:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
          __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
                         ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:55: error: expected ';' at end of declaration list
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                                      ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:646:34: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
                                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:646:34: error: template argument for template type parameter must be a type
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
                                 ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:638:17: note: template parameter is declared here
template <class _Tp>
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:647:29: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
  : public __unary_function<nullptr_t, size_t>
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:647:29: error: template argument for template type parameter must be a type
  : public __unary_function<nullptr_t, size_t>
                            ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:41:17: note: template parameter is declared here
template <class _Arg, class _Result>
                ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:3: error: non-static data member cannot be constexpr; did you intend to make it const?
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
#    define _LIBCPP_CONSTEXPR constexpr
                              ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Documents/GitHub/misc_metabo/renv/library/R-4.3/aarch64-apple-darwin20/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:32: error: member 'nullptr_t' declared as a template
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
                               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:42: error: expected ';' at end of declaration list
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:262:25: error: unknown type name 'nullptr_t'
  unique_ptr& operator=(nullptr_t) _NOEXCEPT {
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:3: error: non-static data member cannot be constexpr; did you intend to make it const?
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
#    define _LIBCPP_CONSTEXPR constexpr
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [DbColumn.o] Error 1
ERROR: compilation failed for package ‘RSQLite’
* removing ‘/Users/rogangrant/Documents/GitHub/misc_metabo/renv/staging/1/RSQLite’
install of package 'RSQLite' failed [error code 1]
krlmlr commented 1 year ago

Thanks. I can build without problems:

✗ clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
✗ xcode-select --version
xcode-select version 2397.

Do you have access to another machine to double-check?

RoganGrant commented 1 year ago

Hmm everything looks the same to me. This is on an M1 pro, R4.3 arm64. Do you have any custom makevars I should be aware of? I'll check on another device now.

krlmlr commented 1 year ago

Good catch. I'm using:

CC      =  ccache clang -Wno-everything -w
CXX     =  ccache clang++ -std=gnu++17 -Wno-everything
CXX11   =  ccache clang++ -std=gnu++11
CXX14   =  ccache clang++ -std=gnu++14
CXX17   =  ccache clang++ -std=gnu++17 -Wno-everything
MAKEFLAGS = -j8
CFLAGS = -O0 -g -Wmacro-redefined
CXXFLAGS = -O0 -g -Wmacro-redefined
CXX11FLAGS = -O0 -g -Wmacro-redefined
CXX14FLAGS = -O0 -g -Wmacro-redefined
CXX17FLAGS = -O0 -g -Wmacro-redefined
CPPFLAGS = -I/opt/homebrew/include
LDFLAGS = -L/opt/homebrew/lib

FC      = /opt/homebrew/bin/gfortran
F77     = /opt/homebrew/bin/gfortran
FLIBS   = -L/opt/homebrew/lib/gcc
RoganGrant commented 1 year ago

I see the issue I think. I'm using renv, which forces a source install. On other Apple silicon-based macs the issue is only solved by either a) installing from binary or b) using other clang versions (standard clang 11.1.0 works for sure)

krlmlr commented 1 year ago

But I can build and install from source too.

What version of RSQLite are you trying to install?

RoganGrant commented 1 year ago

I am trying to install v2.3.1. This must be something specific to my system in that case. Outside of the environment, install.packages("RSQLite") works without issue. install.packages("RSQLite", type = "source") leads to the same errors, however.

krlmlr commented 1 year ago

Can you git clone and then R CMD INSTALL . ? I suspect the same error, but this might be easier to debug.

RoganGrant commented 1 year ago

I really appreciate your help with this. It is indeed the same issue, but looks very similar.

* installing to library ‘/Users/rogangrant/Library/R/arm64/4.3/library’
* installing *source* package ‘RSQLite’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘’
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/include" -DNDEBUG -I. -Ivendor -Ivendor/extensions -Ivendor/sqlite3 -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DSQLITE_USE_URI=1 -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I'/Users/rogangrant/Library/R/arm64/4.3/library/plogr/include' -I'/Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include' -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c DbColumn.cpp -o DbColumn.o
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:3:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/R.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/include/Rinternals.h:36:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:50:9: error: no member named 'nullptr_t' in the global namespace
using ::nullptr_t;
      ~~^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:3:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/R.hpp:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:452:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_compound.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_fundamental.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
                                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: template argument for template type parameter must be a type
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
                                                ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:23:17: note: template parameter is declared here
template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
                ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:544:5: error: use of undeclared identifier '__promote'
    __promote<_A1, _A2, _A3>
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:548:22: error: no template named '__promote'
    typedef typename __promote<_A1, _A2, _A3>::type __result_type;
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:552:12: error: call to 'hypot' is ambiguous
    return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
           ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:533:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY float       hypot(       float __x,       float __y,       float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:534:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY double      hypot(      double __x,      double __y,      double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:535:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
                                             ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:841:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/unwrap_range.h:16:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/next.h:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/advance.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/unreachable.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:123:9: error: target of using declaration conflicts with declaration already in scope
using ::abs _LIBCPP_USING_IF_EXISTS;
        ^
/usr/local/include/stdlib.h:132:6: note: target of using declaration
int      abs(int) __pure2;
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:339:1: note: conflicting declaration
using ::abs _LIBCPP_USING_IF_EXISTS;
^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:45: error: field has incomplete type 'std::exception_ptr'
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:144:24: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_TYPE_VIS exception_ptr
                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:689:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
#  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:673:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
          __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
                         ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:55: error: expected ';' at end of declaration list
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                                      ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:646:34: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
                                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:646:34: error: template argument for template type parameter must be a type
struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
                                 ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:638:17: note: template parameter is declared here
template <class _Tp>
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:647:29: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
  : public __unary_function<nullptr_t, size_t>
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/hash.h:647:29: error: template argument for template type parameter must be a type
  : public __unary_function<nullptr_t, size_t>
                            ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:41:17: note: template parameter is declared here
template <class _Arg, class _Result>
                ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:3: error: non-static data member cannot be constexpr; did you intend to make it const?
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
#    define _LIBCPP_CONSTEXPR constexpr
                              ^
In file included from DbColumn.cpp:1:
In file included from ./pch.h:1:
In file included from ./RSQLite.h:4:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11.hpp:5:
In file included from /Users/rogangrant/Library/R/arm64/4.3/library/cpp11/include/cpp11/as.hpp:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:32: error: member 'nullptr_t' declared as a template
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
                               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:42: error: expected ';' at end of declaration list
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:262:25: error: unknown type name 'nullptr_t'
  unique_ptr& operator=(nullptr_t) _NOEXCEPT {
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:3: error: non-static data member cannot be constexpr; did you intend to make it const?
  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
#    define _LIBCPP_CONSTEXPR constexpr
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [DbColumn.o] Error 1
ERROR: compilation failed for package ‘RSQLite’
* removing ‘/Users/rogangrant/Library/R/arm64/4.3/library/RSQLite’
* restoring previous ‘/Users/rogangrant/Library/R/arm64/4.3/library/RSQLite’
krlmlr commented 1 year ago

I'm at a loss here.

In your renv project, you could install the binary package. Chances are renv::restore() will be satisfied with that.

RoganGrant commented 1 year ago

Agreed. Out of curiosity, what XCode version do you have?

krlmlr commented 1 year ago

How do I find out?

RoganGrant commented 1 year ago

Easiest way is just to open the app --> About XCode

krlmlr commented 1 year ago

I don't have the app.

~ /usr/bin/xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
RoganGrant commented 1 year ago

Okay I was able to solve this by completely switching to my homebrew install using the following makevars. Notably I am using rig to manage R versions. I feel like this might be part of this issue. Unclear exactly how.

F77 = /opt/homebrew/bin/gfortran
FC = /opt/homebrew/bin/gfortran
FLIBS   = -L/opt/homebrew/Cellar/gcc/13.1.0/lib

CC = /opt/homebrew/Cellar/gcc/13.1.0/bin/gcc-13
CXX = /opt/homebrew/Cellar/gcc/13.1.0/bin/g++-13

CFLAGS  += -I/opt/homebrew/include
CPPFLAGS += -I/opt/homebrew/include
CXXFLAGS += -I/opt/homebrew/include

LDFLAGS += -L/opt/homebrew/opt/libomp/lib -lomp
CPPFLAGS += -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp
github-actions[bot] commented 1 month ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.