We have a C++ library (libEDM.a) that integrates Eigen. The library is standalone as a core API to be wrapped with Rcpp and pybind11 for user interfaces.
Since Eigen is called internally from the library, we do not use RcppEigen in the Rcpp wrapper.
This works fine on linux and OSX R package builds, and the mingw-32 (arch - i386) build for R (using devtools::check_win_release).
However, for the (arch - x64) build with mingw-64, the linker fails to find Eigen references in the C++ libEDM.a, vis:
d:/Compiler/gcc-4.9.3/mingw_64/bin/g++ -m64 -shared -s -static-libgcc -o rEDMNew.dll tmp.def CCM.o ComputeError.o DataFrame.o Embed.o EmbedDim.o Multiview.o PredictInterval.o PredictNL.o RcppEDMCommon.o RcppExports.o SMap.o Simplex.o -L./cppEDM/src/ -lEDM -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LD:/RCompile/recent/R-3.6.1/bin/x64 -lR
./cppEDM/src//libEDM.a(SMap.o):SMap.cc:(.text+0x245d): undefined reference to `Eigen::internal::first_aligned_impl<16, Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs2_op<double>, Eigen::Block<Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>, -1, 1, false> const, -1, 1, false> const>, true>::run(Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs2_op<double>, Eigen::Block<Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>, -1, 1, false> const, -1, 1, false> const> const&)'
A wrinkle for the mingw-64 is the addition of -Wa,-mbig-obj
flag passed to the linker, as it seems Eigen templates with mingw-64 exceed the number of sections allowed.
Perhaps it is a mingw-64 linker/option issue, as the mingw-32 and other builds seem to work fine?
Aucun commentaire:
Enregistrer un commentaire