[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    [Rd] Function name exported incorrectly in DLL, strange entries in tmp.def
From:       "Stravs, Michael" <Michael.Stravs () eawag ! ch>
Date:       2016-02-29 18:00:45
Message-ID: 9DD73F68AC266D4AA329E07B678177B18917FAB0 () EE-MBX1 ! ee ! emp-eaw ! ch
[Download RAW message or body]

Hi,

I originally posted this on the Rcpp github tracker, but it was suggested I=
 post it here.

I tried to compile the package https://github.com/khabbazian/sparseAHC/ und=
er Windows. The package requires C++11 so I had to install the R devel buil=
d with gcc 4.9.3, and the latest Rtools.

I got compilation and installation to work using Rcpp (0.12.3, from CRAN so=
urce). Package loads fine. However, when I tried to use the functions:
* the Rcpp exported function ```sparseAHC_dgCIsSymmetric``` works correctly
* the Rcpp exported function ```sparseAHC_run_sparseAHC``` doesn't work.

I could not see anything wrong with the source files and therefore looked a=
t the DLL with DependencyWalker. Interestingly:
* ```sparseAHC_dgCIsSymmetric``` is named correctly
* ```sparseAHC_run_sparseAHC``` is named
```sparseAHC_run_sparseAHC.weak._ZNSt4listIiSaIiEE7emplaceIJiEEESt14_List_i=
teratorIiESt20_List_const_iteratorIiEDpOT_._ZNK4Rcpp14not_compatible4whatEv=
.weak._ZNSt6vectorIdSaIdEE19_M_emplace_back_auxIJdEEEvDpOT_._ZNK4Rcpp14not_=
compatible4whatEv.weak._ZNSt6vectorIiSaIiEE19_M_emplace_back_auxIJRKiEEEvDp=
OT_._ZNK4Rcpp14not_compatible4whatEv.weak._ZNSt6vectorISt4pairIS0_IiiEdESaI=
S2_EE12emplace_backIJS2_EEEvDpOT_._ZNK4Rcpp14not_compatible4whatEv.weak._ZN=
St6vectorISt4pairIS0_IiiEdESaIS2_EE19_M_emplace_back_auxIJS2_EEEvDpOT_._ZNK=
4Rcpp14not_compatible4whatEv.weak._ZNSt8_Rb_treeIiSt4pairIKiSt14_List_itera=
torI7EdgeObjEESt10_Select1stIS5_ESt4lessIiESaIS5_EE22_M_emplace_hint_unique=
IJRKSt21piecewise_construct_tSt5tupleIJRS1_EESG_IJEEEEESt17_Rb_tree_iterato=
rIS5_ESt23_Rb_tree_const_iteratorIS5_EDpOT_._ZNK4Rcpp14not_compatible4whatE=
v.weak._ZNSt8_Rb_treeIiSt4pairIKiSt14_List_iteratorIiEESt10_Select1stIS4_ES=
t4lessIiESaIS4_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tu=
pleIJOiEESF_IJEEEEESt17_Rb_tree_iteratorIS4_ESt23_Rb_tree_const_iteratorIS4=
_EDpOT_._ZNK4Rcpp14not_compatible4whatEv```` instead!

To find out what is going on, I compiled again and captured the ```tmp.def`=
`` which is generated during compilation. As one can see, directly behind t=
he problematic function name there are a lot of entries starting with ```.w=
eak``` that are apparently incorrectly picked up upon by the linker:
```
[...]
ZZN4Rcpp8internal12exitRNGScopeEvE3fun
_ZZN4Rcpp8internal13enterRNGScopeEvE3fun
sparseAHC_dgCIsSymmetric
sparseAHC_run_sparseAHC
.weak._ZNSt4listIiSaIiEE7emplaceIJiEEESt14_List_iteratorIiESt20_List_const_=
iteratorIiEDpOT_._ZNK4Rcpp14not_compatible4whatEv
.weak._ZNSt6vectorIdSaIdEE19_M_emplace_back_auxIJdEEEvDpOT_._ZNK4Rcpp14not_=
compatible4whatEv
.weak._ZNSt6vectorIiSaIiEE19_M_emplace_back_auxIJRKiEEEvDpOT_._ZNK4Rcpp14no=
t_compatible4whatEv
.weak._ZNSt6vectorISt4pairIS0_IiiEdESaIS2_EE12emplace_backIJS2_EEEvDpOT_._Z=
NK4Rcpp14not_compatible4whatEv
.weak._ZNSt6vectorISt4pairIS0_IiiEdESaIS2_EE19_M_emplace_back_auxIJS2_EEEvD=
pOT_._ZNK4Rcpp14not_compatible4whatEv
.weak._ZNSt8_Rb_treeIiSt4pairIKiSt14_List_iteratorI7EdgeObjEESt10_Select1st=
IS5_ESt4lessIiESaIS5_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_=
tSt5tupleIJRS1_EESG_IJEEEEESt17_Rb_tree_iteratorIS5_ESt23_Rb_tree_const_ite=
ratorIS5_EDpOT_._ZNK4Rcpp14not_compatible4whatEv
.weak._ZNSt8_Rb_treeIiSt4pairIKiSt14_List_iteratorIiEESt10_Select1stIS4_ESt=
4lessIiESaIS4_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tup=
leIJOiEESF_IJEEEEESt17_Rb_tree_iteratorIS4_ESt23_Rb_tree_const_iteratorIS4_=
EDpOT_._ZNK4Rcpp14not_compatible4whatEv
_Z12order_leavesRN5Eigen6MatrixIdLin1ELin1ELi0ELin1ELin1EEEi
_Z13run_sparseAHCN5Eigen12SparseMatrixIdLi0EiEEN4Rcpp6VectorILi16ENS2_15Pre=
serveStorageEEE
_Z14dgCIsSymmetricN5Eigen12SparseMatrixIdLi0EiEEd
[...]
```

I cannot find this problem documented anywhere. But it seems that somehow a=
dditional exports are generated that start with ```.weak```, and the linker=
 mangles all of them into one function name.

Help?

Michael Stravs
Eawag
Umweltchemie
BU E 23
=DCberlandstrasse 133
8600 D=FCbendorf
+41 58 765 6742


	[[alternative HTML version deleted]]



______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic