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

Problem Installing Mac M3 Sonoma #207

Open
joshuagmedina opened this issue Jan 13, 2024 · 4 comments
Open

Problem Installing Mac M3 Sonoma #207

joshuagmedina opened this issue Jan 13, 2024 · 4 comments

Comments

@joshuagmedina
Copy link

joshuagmedina commented Jan 13, 2024

UPDATE:
Resolved the issue.
The Makevars file appeared to be the issue. Using additional variables seemed to be conflicting.
The file had to contain only this:

CXX_STD = CXX11
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS)
PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS)
PKG_LIBS=-lboost_filesystem -lboost_system   -lstdc++ $(LAPACK_LIBS) $(BLAS_LIBS)  $(SHLIB_OPENMP_CFLAGS) $(FLIBS) -L /opt/homebrew/Cellar/boost/1.83.0/lib/

And gfortran had to be located at /opt/gfortran


Hi,
I've been trying to install velocyto.R in a M3 Mac running Sonoma OS but have not been successful.

Here is what I've tried so far:

  1. Installing everything using brew (llvm, gcc, boost, gfortran, etc.)
  2. Followed this #167 and this Installing Conos guide

My ~/.R/Makevars has:

CXX_STD = CXX11
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS)
PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS)
PKG_LIBS=-lboost_filesystem -lboost_system   -lstdc++ $(LAPACK_LIBS) $(BLAS_LIBS)  $(SHLIB_OPENMP_CFLAGS) $(FLIBS) -L /opt/homebrew/Cellar/boost/1.83.0/lib/

CC=/opt/homebrew/opt/llvm/bin/clang -fopenmp
CXX=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp
CXX11=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp
CXX14=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp
CXX17=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp
CXX1X=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp
CXX98=/opt/homebrew/opt/llvm/bin/clang++ -fopenmp

FC = /opt/R/arm64/gfortran/bin -fopenmp
F77 = /opt/R/arm64/gfortran/bin -fopenmp
FLIBS = -L/opt/homebrew/opt/gcc/lib/gcc/13/ -lm

Also, included the following in my .zshrc

export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"

I also included these to the Makevars file but did not make any difference.

Still I continue to have the following error:

* installing *source* package ‘velocyto.R’ ...
** using staged installation
** libs
using C++ compiler: ‘Homebrew clang version 17.0.6’
using C++11
using SDK: ‘MacOSX14.2.sdk’
/opt/homebrew/opt/llvm/bin/clang++ -fopenmp -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' "-I/opt/homebrew/opt/llvm/include"    -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
/opt/homebrew/opt/llvm/bin/clang++ -fopenmp -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' "-I/opt/homebrew/opt/llvm/include"    -fPIC  -falign-functions=64 -Wall -g -O2  -c points_within.cpp -o points_within.o
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:962:34: error: too many arguments provided to function-like macro invocation
  962 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |                                  ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:968:9: note: macro 'length' defined here
  968 | #define length(x)               Rf_length(x)
      |         ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:961:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
  961 |     _LIBCPP_INLINE_VISIBILITY
      |     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
  841 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
      |                                     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
  820 |           __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
      |                          ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:962:15: error: expected ';' at end of declaration list
  962 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |               ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1048:34: error: too many arguments provided to function-like macro invocation
 1048 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |                                  ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:968:9: note: macro 'length' defined here
  968 | #define length(x)               Rf_length(x)
      |         ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1047:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
 1047 |     _LIBCPP_INLINE_VISIBILITY
      |     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
  841 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
      |                                     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
  820 |           __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
      |                          ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1048:15: error: expected ';' at end of declaration list
 1048 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |               ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1133:34: error: too many arguments provided to function-like macro invocation
 1133 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |                                  ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:968:9: note: macro 'length' defined here
  968 | #define length(x)               Rf_length(x)
      |         ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1132:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
 1132 |     _LIBCPP_INLINE_VISIBILITY
      |     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
  841 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
      |                                     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
  820 |           __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
      |                          ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1133:15: error: expected ';' at end of declaration list
 1133 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |               ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1309:34: error: too many arguments provided to function-like macro invocation
 1309 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |                                  ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:968:9: note: macro 'length' defined here
  968 | #define length(x)               Rf_length(x)
      |         ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1308:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
 1308 |     _LIBCPP_INLINE_VISIBILITY
      |     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
  841 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
      |                                     ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
  820 |           __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
      |                          ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1309:15: error: expected ';' at end of declaration list
 1309 |     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
      |               ^
12 errors generated.
make: *** [points_within.o] Error 1
ERROR: compilation failed for package ‘velocyto.R’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/velocyto.R’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/mk/2zf6m29j5kn9km15d_5cc4cw0000gn/T//RtmpgrfvIC/file81dc2f079bc7/velocyto.R_0.6.tar.gz’ had non-zero exit status

Any suggestions?
PS. I also tried downgrading the llvm brew install to version 11.1.0, but got a different error.

Thanks!

@BenjaminDEMAILLE
Copy link

Same problem for. Do the devs can quickly resolve it ? this problem is here this many month

@adri-biochem
Copy link

adri-biochem commented Apr 22, 2024

Thank you for posting your solution. I am on Apple M1 Sonoma 14.4.1 and cannot install the package.

My Makevars file has this:
CXX_STD = CXX11 PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS) PKG_LIBS=-lboost_filesystem -lboost_system -lstdc++ $(LAPACK_LIBS) $(BLAS_LIBS) $(SHLIB_OPENMP_CFLAGS) $(FLIBS) -L/opt/homebrew/Cellar/boost/1.84.0_1/lib

And I do have gfortran at opt/gfortran

I then ran:
git clone https://github.com/velocyto-team/velocyto.R
R CMD build velocyto.R
R CMD INSTALL velocyto.R_0.6.tar.gz

However, I am getting the same error as your did above:

Any insight on how to fix this would be great! Using brew, I have gcc, gfortran, llvm, and boost. Wondering what else I should try. Thanks!

`* installing source package ‘velocyto.R’ ...
** using staged installation
** libs
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c points_within.cpp -o points_within.o
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:962:34: error: too many arguments provided to function-like macro invocation
962 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
969 | #define length(x) Rf_length(x)
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:961:5: error: 'abi_tag' attribute only applies to structs, variables, functions, and
namespaces
961 | _LIBCPP_INLINE_VISIBILITY
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
841 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
820 | attribute((abi_tag(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:962:15: error: expected ';' at end of declaration list
962 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1048:34: error: too many arguments provided to function-like macro invocation
1048 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
969 | #define length(x) Rf_length(x)
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1047:5: error: 'abi_tag' attribute only applies to structs, variables, functions, and
namespaces
1047 | _LIBCPP_INLINE_VISIBILITY
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
841 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
820 | attribute((abi_tag(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1048:15: error: expected ';' at end of declaration list
1048 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1133:34: error: too many arguments provided to function-like macro invocation
1133 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
969 | #define length(x) Rf_length(x)
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1132:5: error: 'abi_tag' attribute only applies to structs, variables, functions, and
namespaces
1132 | _LIBCPP_INLINE_VISIBILITY
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
841 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
820 | attribute((abi_tag(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1133:15: error: expected ';' at end of declaration list
1133 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1309:34: error: too many arguments provided to function-like macro invocation
1309 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
969 | #define length(x) Rf_length(x)
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1308:5: error: 'abi_tag' attribute only applies to structs, variables, functions, and
namespaces
1308 | _LIBCPP_INLINE_VISIBILITY
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:841:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
841 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__config:820:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
820 | attribute((abi_tag(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
| ^
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1761:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:321:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:32:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:1309:15: error: expected ';' at end of declaration list
1309 | int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
| ^
12 errors generated.
make: *** [points_within.o] Error 1
ERROR: compilation failed for package ‘velocyto.R’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/velocyto.R’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/z4/d9dxjxp54g760dgphtt7mk4c0000gn/T//RtmpLDWvHJ/file1472d31eec929/velocyto.R_0.6.tar.gz’ had non-zero exit status`

@gvogler
Copy link

gvogler commented May 7, 2024

I am also facing this problem (on Apple M1):

Installing package into ‘/Users/Geo/Library/R/arm64/4.3/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘velocyto.R’ ...
** using staged installation
** libs
using C++ compiler: ‘Homebrew clang version 18.1.5’
using C++11
using SDK: ‘’
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c points_within.cpp -o points_within.o
In file included from points_within.cpp:3:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/set:1499:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/functional:526:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/vector:325:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_bool.h:20:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/__format/formatter_integral.h:35:
In file included from /opt/homebrew/opt/llvm/bin/../include/c++/v1/locale:202:
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__locale:804:28: error: too many arguments provided to function-like macro invocation
  804 |   length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const {
      |                            ^

Compiler and libs seem to be there and in place:

> pkgbuild::check_build_tools(debug = TRUE)
Trying to compile a simple C file
Running /Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB foo.c
using C compiler: ‘Homebrew clang version 18.1.5’
using SDK: ‘’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c foo.c -o foo.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o foo.so foo.o -lboost_filesystem -lboost_system -lstdc++ -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0 -L/opt/gfortran/lib -lgfortran -lemutls_w -lquadmath -L /opt/homebrew/Cellar/boost/1.85.0/lib/ -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
 
Your system is ready to build packages!

@garci1294
Copy link

I believe I've identified the issue, which occurred during the C++ compilation. I added the following to the top of the points_within.cpp file located in the /src directory, and the installation was successful.

I have an M3 device.

#include <R.h>
#include <Rinternals.h>

// Undefine the 'length' macro to prevent conflicts
#undef length

#include <set>
#include <vector>
#include <functional>

using namespace std;

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

5 participants