Reputation: 9
I was trying to download MetaboAnalystR in my Mac mini M4. It's required to install gfortran to compile the cpp. I went through the process in this page. However when I ran the test cpp file, it showed this error:
using C++ compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.4)’ using SDK: ‘MacOSX15.1.sdk’ clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I"/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include" -I"/Users/caoxiaomai/Desktop/Metabonomic/Metabonomic" -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c helloworld.cpp -o helloworld.o clang++ -arch arm64 -std=gnu++17 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o sourceCpp_2.so helloworld.o -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 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0' not found ld: warning: search path '/opt/gfortran/lib' not found ld: library 'gfortran' not found clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [sourceCpp_2.so] Error 1 Error in Rcpp::sourceCpp("./helloworld.cpp") : Error 1 occurred building shared library.
There were once said that it was some storage location mistakes, so I checked the location by which gfortran
, it came up with a /usr/local/bin/gfortran
, which location could work in my old Mac.
I am look for a new way make the gfortran work for my cpp files and further metaboAnalyst R installation.
Upvotes: 0
Views: 51