2016-10-25 41 views
0

我用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> 

但我不知道如何解決此問題。我會非常感謝任何建議。

+1

很難/不可能回答,因爲這裏沒有_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),看看其他軟件包正在做什麼。 –

+0

現在這在主分支中得到了照顧。我們錯過了幾天的發佈,所以CRAN更新將不得不等待幾周。 –

+0

@DirkEddelbuettel非常感謝您的意見,我很抱歉沒有包含任何代碼,但我不認爲這個問題在其中,因此它不相關。 – hrcho

回答

1

好,聲調總是很有趣,當你自己的GitHub的問題之一,在SO出現......

首先,這不是每說,只是一種警告的錯誤,它需要照顧很快,它需要在上游完成。

基本上,RcppArmadilloExtensions/sample.h API必須被更新,因爲犰狳的sort(X , sort_direction)sort_index(X , sort_direction)功能已經從指定由整數sort_direction參數移開(例如0 =上升,1 =下降)有利於一個串接口(例如"ascend""descend") 。

# Old 
arma::sort_index(prob, 1); 
# New 
arma::sort_index(prob, "descend"); 

有了這個雖這麼說, 我會做出必要的改變 德克將make an issue,然後submit a PR that fixes it公關請求。抓住最新的開發版本,如果你想要最新的測試。很可能,這將在大約一個月內推向CRAN。

+0

非常感謝您的回覆。我從你原來的帖子中猜出了很多,但不知道如何/何時進行這些更新。 – hrcho

+1

@hrcho,歡迎光臨。請投票並接受答案。 – coatless