Comments (10)
Normally, /usr/local/include
should show up after RcppArmadillo's headers, so I suspect this is a local configuration issue on your side. When I compile RcppArmadillo
, I see:
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I"/Users/kevin/Library/R/3.4/library/Rcpp/include" -I/usr/local/include -I../inst/include -fPIC -Wall -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
Note that -I/usr/local/include
comes after Rcpp in this case. See also:
kevin@cdrv:~/r
$ R CMD config --all
CC = clang
CFLAGS = -g -O3 -Wall -pedantic -mtune=native -I/usr/local/opt/openssl/include
CPICFLAGS = -fPIC
CPP = clang -E
CPPFLAGS = -I/usr/local/include
CXX = clang++
CXXCPP = clang++ -E
CXXFLAGS = -g -O3 -Wall -pedantic -mtune=native -Wno-unused-local-typedef -I/usr/local/opt/openssl/include
CXXPICFLAGS = -fPIC
CXX11 = clang++
CXX11STD = -std=gnu++11
CXX11FLAGS = -Wall -g -O2
CXX11PICFLAGS = -fPIC
CXX14 = clang++
CXX14STD = -std=gnu++14
CXX14FLAGS = -Wall -g -O2
CXX14PICFLAGS = -fPIC
CXX98 = clang++
CXX98STD =
CXX98FLAGS = -Wall -g -O2
CXX98PICFLAGS = -fPIC
CXX17 = clang++
CXX17STD = -std=gnu++1z
CXX17FLAGS = -Wall -g -O2
CXX17PICFLAGS = -fPIC
CXX1X = clang++ -std=c++11
CXX1XSTD = -std=c++11
CXX1XFLAGS = -g -O3 -Wall -pedantic -mtune=native -Wno-unused-local-typedef -I/usr/local/opt/openssl/include
CXX1XPICFLAGS = -fPIC
DYLIB_EXT = .dylib
DYLIB_LD = clang
DYLIB_LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -fopenmp
F77 = gfortran
FFLAGS = -g -O3 -mtune=native
FPICFLAGS = -fPIC
FLIBS = -L/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6
SAFE_FFLAGS = -g -O2 -ffloat-store
FC = gfortran
FCFLAGS = -g -O3 -mtune=native
FCPICFLAGS = -fPIC
OBJC = clang
OBJCFLAGS = -Wall -g -O2 -fobjc-exceptions
JAVA = /usr/bin/java
JAVAC = /usr/bin/javac
JAVAH = /usr/bin/javah
JAR = /usr/bin/jar
JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
JAVA_LIBS = -L/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/server -ljvm
JAVA_CPPFLAGS = -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/../include/darwin
LDFLAGS = -L/usr/local/opt/openssl/lib
SHLIB_CFLAGS =
SHLIB_CXXLD = clang++
SHLIB_CXXLDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_CXX98LD = clang++
SHLIB_CXX98LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_CXX11LD = clang++ -std=gnu++11
SHLIB_CXX11LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_CXX14LD = clang++ -std=gnu++14
SHLIB_CXX14LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_CXX17LD = clang++ -std=gnu++1z
SHLIB_CXX17LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_EXT = .so
SHLIB_FFLAGS =
SHLIB_LD = clang
SHLIB_LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_FCLD = gfortran
SHLIB_FCLDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_CXX1XLD = clang++ -std=gnu++11
SHLIB_CXX1XLDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
TCLTK_CPPFLAGS = -I/usr/local/include -I/usr/local/include -I/opt/X11/include
TCLTK_LIBS = -L/usr/local/lib -ltcl8.6 -L/usr/local/lib -ltk8.6 -L/opt/X11/lib -lX11 -Wl,-weak-lXss -lXext
BLAS_LIBS = -L/Library/Frameworks/R.framework/Resources/lib -lRblas
LAPACK_LIBS = -L/Library/Frameworks/R.framework/Resources/lib -lRlapack
MAKE = make
LIBnn = lib
LOCAL_SOFT =
COMPILED_BY =
I suspect you have some local configuration that's placing /usr/local/include
earlier during compilation.
from rcpparmadillo.
FYI: You can directly download and use the official gfortran binaries now if you are on R 3.4.
FAQ guidance is being updated.
from rcpparmadillo.
Well, I have been building RcppArmadillo for all those years, and most of the time I have Armadillo also as a system library from the OS (mostly Ubuntu) and never had issues. Neither had the folks building eg MLPACK and RcppMLPACK. So I think this ought to be configurable at your end.
But I defer to the macOS users for details: @coatless @thirdwing @kevinushey -- can you help?
from rcpparmadillo.
I haven't seen this issue before on macOS with RcppArmadillo. I saw one mailing list post on this here:
http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2014-November/008184.html
but it looks like the user was only seeing this issue when using a version of R built from sources themselves -- but then I haven't seen that with my own builds either.
Are you using CRAN R, or something else?
from rcpparmadillo.
I download R to get core R binaries and use R Studio to install R packages. Not an expert on R.
Nonetheless, the compiler options by Rcpp listed in the log shows:
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RcppArmadillo/include" -fPIC -Wall -mtune=core2 -g -O2 -c
which does put /usr/local/include
before RcppArmadillo’s own headers. A conflict is thus an expected behavior.
Added: And I did put the headers for system-wide Armadillo in /usr/local/include.
from rcpparmadillo.
My point is that since RcppArmadillo comes with its own Armadillo
binaries and headers, during compilation that version should be used over a system-wide one. The problem can certainly be overcome by my end, by disabling ARMA_USE_WRAPPER
on the system version and explicitly link my program with BLAS (on macOS, it is Accelerate framework). It just appears to be a hacky solution to a dependency issue.
from rcpparmadillo.
But the included version is being used. Do R CMD INSTALL RcppArmdillo_*.tar.gz
and look closely at the include flags. Also, RcppArmadillo does not link against any Armadillo library.
from rcpparmadillo.
FWIW the other report I saw re: this sort of error occurred when R was built to use Accelerate (I normally use OpenBLAS when building from source) so it's entirely possible what you're seeing is somehow related to that (although it would be surprising)
from rcpparmadillo.
Thanks for all the help! It seems that my R configuration is totally corrupted to the point that I cannot even “R CMD config --all”. I just re-installed my R. I do not even know why (completely new at R, helping others writing C++ code) (maybe R Studio?).
Thanks anyway! Sorry for disturbing.
from rcpparmadillo.
The Rcpp FAQ has sections with pointers to detailed help for OS X / macOS installations.
from rcpparmadillo.
Related Issues (20)
- warning: chol(): given matrix is not symmetric HOT 7
- Possible bug in configure.ac HOT 18
- Problems in installing RcppArmadillo on macOS Monterey HOT 3
- Missing distr_param argument in randu HOT 8
- no matching function for call to ‘arma::Cube<double>::insert_slices(arma::uword&, arma::mat&) HOT 2
- Deprecating old initialization code in packages using RcppArmadillo HOT 17
- Is `ARMA_64BIT_WORD` supported in RcppArmadillo? HOT 4
- NaN output from arma::uvec compared to arma::vec HOT 4
- Planning to potentially (re)move some legacy internal header files
- Deprecating old stderr stream setting code in packages using RcppArmadillo HOT 12
- Fails to compile vs HOT 3
- Question about SIMD Optimization HOT 3
- package compilation failure HOT 20
- Two failures in test_cube.R on PowerPC HOT 33
- Armadillo 12.0.0 regressions HOT 2
- `RCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR` in an R package? HOT 2
- using namespace arma; HOT 1
- Issue on call by reference with a NA matrix HOT 1
- Update indMatrix->arma::SpMat and pMatrix->arma::SpMat for Matrix 1.5-5 HOT 2
- install issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcpparmadillo.