thisisnic commented on issue #35640: URL: https://github.com/apache/arrow/issues/35640#issuecomment-6883897156
Did AI analysis and relabelling as docs enhancement: 🤖: What this issue describes is accurate, and it comes from how the R package builds libarrow from source. libarrow is built with cmake, not through R's package build machinery, so it only sees the settings that are passed on explicitly: `CC`, `CXX` and `LDFLAGS` from `R CMD config` (https://github.com/apache/arrow/blob/48e4abf56db619893a372cee998f8e5f3a5a3871/r/tools/nixlibs.R#L576-L582). `CFLAGS` and `CXXFLAGS` are deliberately not passed on. In the example above, `LDFLAGS` is passed on, including `-lomp`, but when R links a package it also adds `-L"$(R_HOME)/lib"` to the link line, and that is not part of `LDFLAGS`. So `-lomp` is found for `install.packages()` but not by cmake, which is why adding the `-L` to `LDFLAGS` fixes it. Making the cmake build match R's link line exactly isn't practical, but the installation vignette could document which settings are carried over to the libarrow build. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
