我用RcppArmadillo編寫了一個R包。在我的源文件中,我有RcppArmadillo包中的sample.h錯誤
#include <RcppArmadilloExtensions/sample.h>
在第一行中,以便使用函數示例。 該軟件包在我的Windows機器上進行編譯和檢查,並提交給CRAN。但它沒有檢查這些風格:r-patched-solaris-sparc,r-patched-solaris-x86,帶有安裝錯誤。
日誌文件顯示
在文件從sim12.cpp包括:1:0: /home/R/Lib32/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:在函數「void RCPP: :RcppArmadillo :: ProbSampleReplace(arma :: uvec &,int,int,arma :: vec &)': /home/R/Lib32/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:149:55:warning:'const arma :: mtOp arma :: sort_index(const arma :: Base &,arma :: uword)[with T1 = arma :: Mat; typename T1 :: elem_type = double; arma :: uword = unsigned int]'已棄用[-Wdeprecated-declarations] arma :: uvec perm = arma :: sort_index(prob,1); //降序索引 ^ 從/ home/R/Lib32/RcppArmadillo/include/armadillo中包含的文件:449:0, from /home/R/Lib32/RcppArmadillo/include/RcppArmadilloForward.h:46, 從/home/R/Lib32/RcppArmadillo/include/RcppArmadillo.h:31, 從/home/R/Lib32/RcppArmadillo/include/RcppArmadilloExtensions/fixprob.h:25, 從/家/ R/LIB32/RcppArmadillo /包括/ RcppArmadilloExtensions/sample.h:30, 從sim12.cpp:1: /home/R/Lib32/RcppArmadillo/include/armadillo_bits/fn_sort_index.hpp:37:1:注:這裏聲明 sort_index ^
和類似的警告。
要找出如何解決這個問題,我用Google搜索中的錯誤消息的某些部分,發現這個網頁(C風格和ARMA API改變編譯警告#203):
https://github.com/SMAC-Group/gmwm/issues/203
我相信,安裝錯誤不是由於我的代碼中的任何特定行在第一行之後
#include <RcppArmadilloExtensions/sample.h>
但我不知道如何解決此問題。我會非常感謝任何建議。
很難/不可能回答,因爲這裏沒有_nothing reproducible_和_no code to look at。試試這個[GitHub query for'RcppArmadilloExtensions/sample.h'](https://github.com/search?q=RcppArmadilloExtensions%2Fsample.h&type=Code&utf8=%E2%9C%93),看看其他軟件包正在做什麼。 –
現在這在主分支中得到了照顧。我們錯過了幾天的發佈,所以CRAN更新將不得不等待幾周。 –
@DirkEddelbuettel非常感謝您的意見,我很抱歉沒有包含任何代碼,但我不認爲這個問題在其中,因此它不相關。 – hrcho