【问题标题】:MacOS Big Sur M1 silicon, cmath error during R devtool monocle3 installMacOS Big Sur M1 硅,R devtool monocle3 安装期间出现 cmath 错误
【发布时间】:2021-09-11 01:11:32
【问题描述】:

我正在尝试在 M1 硅 MacOS Big Sur 11.4 上的 Rstudio(R 版本 4.1.0)中安装 Monocle3 (here),使用:

devtools::install_github('cole-trapnell-lab/leidenbase')

我收到此错误消息,这使得 cmath 标头看起来不起作用。

clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include  -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG -I. -Icigraph/src -Icigraph/include -Icigraph/src/prpack -Ileidenalg/include -DUSING_R -DPRPACK_IGRAPH_SUPPORT -fPIC  -Wall -g -O2  -c cigraph/src/DensityGrid.cpp -o cigraph/src/DensityGrid.o
In file included from cigraph/src/DensityGrid.cpp:41:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/usr/local/include/math.h:752:12: note: 'finite' declared here
extern int finite(double)
           ^
In file included from cigraph/src/DensityGrid.cpp:41:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
      ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:738:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from cigraph/src/DensityGrid.cpp:41:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from cigraph/src/DensityGrid.cpp:41:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
13 errors generated.
make: *** [cigraph/src/DensityGrid.o] Error 1
ERROR: compilation failed for package ‘leidenbase’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/leidenbase’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/37/6b_9y9v11nzftf912bbhbhr00000gn/T//Rtmph3567G/file159343f7bb5fc/leidenbase_0.1.3.tar.gz’ had non-zero exit status
> 

我使用技巧here 编辑了~/.R/Makevars 文件以将SDK“重新链接”到C++ 编译器。还是不行。
我也试过更新Xcode,删除并重新下载Xcode,删除并重新下载CommandLineTools。

没有任何效果。

这是我当前的 ~/.R/Makevars 文件:

CC=clang
CXX=clang++
CXXFLAGS= -O3 -pedantic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

提前感谢您的建议或解决方法。

【问题讨论】:

    标签: c++ r xcode devtools apple-m1


    【解决方案1】:

    通过将 cmath 文件中的 #include 更改为调用 #include 解决了该问题,其中 math.h 与 cmath 位于同一目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-21
      • 1970-01-01
      • 2021-05-23
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多