Browse code

return string for build report

Tom Sherman authored on 28/04/2018 19:49:00
Showing6 changed files

... ...
@@ -5,12 +5,12 @@ export(CoGapsFromCheckpoint)
5 5
 export(GWCoGAPS)
6 6
 export(GWCoGapsFromCheckpoint)
7 7
 export(binaryA)
8
+export(buildReport)
8 9
 export(calcCoGAPSStat)
9 10
 export(calcGeneGSStat)
10 11
 export(calcZ)
11 12
 export(computeGeneGSProb)
12 13
 export(createGWCoGAPSSets)
13
-export(displayBuildReport)
14 14
 export(gapsMapRun)
15 15
 export(gapsRun)
16 16
 export(plotAtoms)
... ...
@@ -124,9 +124,9 @@ CoGapsFromCheckpoint <- function(D, S, path, checkpointFile=NA)
124 124
 #' @examples
125 125
 #'  CoGAPS::displayBuildReport()
126 126
 #' @export
127
-displayBuildReport <- function()
127
+buildReport <- function()
128 128
 {
129
-    displayBuildReport_cpp()
129
+    getBuildReport_cpp()
130 130
 }
131 131
 
132 132
 #' Backwards Compatibility with v2
... ...
@@ -9,8 +9,8 @@ cogapsFromCheckpoint_cpp <- function(D, S, nFactor, nEquil, nSample, fileName, c
9 9
     .Call('_CoGAPS_cogapsFromCheckpoint_cpp', PACKAGE = 'CoGAPS', D, S, nFactor, nEquil, nSample, fileName, cptFile)
10 10
 }
11 11
 
12
-displayBuildReport_cpp <- function() {
13
-    invisible(.Call('_CoGAPS_displayBuildReport_cpp', PACKAGE = 'CoGAPS'))
12
+getBuildReport_cpp <- function() {
13
+    .Call('_CoGAPS_getBuildReport_cpp', PACKAGE = 'CoGAPS')
14 14
 }
15 15
 
16 16
 run_catch_unit_tests <- function() {
17 17
similarity index 85%
18 18
rename from man/displayBuildReport.Rd
19 19
rename to man/buildReport.Rd
... ...
@@ -1,10 +1,10 @@
1 1
 % Generated by roxygen2: do not edit by hand
2 2
 % Please edit documentation in R/CoGAPS.R
3
-\name{displayBuildReport}
4
-\alias{displayBuildReport}
3
+\name{buildReport}
4
+\alias{buildReport}
5 5
 \title{Display Information About Package Compilation}
6 6
 \usage{
7
-displayBuildReport()
7
+buildReport()
8 8
 }
9 9
 \value{
10 10
 display builds information
... ...
@@ -46,24 +46,25 @@ unsigned nSample, const std::string &fileName, const std::string &cptFile)
46 46
 }
47 47
 
48 48
 // [[Rcpp::export]]
49
-void displayBuildReport_cpp()
49
+std::string getBuildReport_cpp()
50 50
 {
51 51
 #if defined( __clang__ )
52
-    Rcpp::Rcout << "Compiled with Clang\n";
52
+    std::string compiler = "Compiled with Clang\n";
53 53
 #elif defined( __INTEL_COMPILER )
54
-    Rcpp::Rcout << "Compiled with Intel ICC/ICPC\n";
54
+    std::string compiler = "Compiled with Intel ICC/ICPC\n";
55 55
 #elif defined( __GNUC__ )
56
-    Rcpp::Rcout << "Compiled with GCC v" << STR( __GNUC__ ) << "."
57
-        << STR( __GNUC_MINOR__ ) << '\n';
56
+    std::string compiler = "Compiled with GCC v" + std::string(STR( __GNUC__ ))
57
+    + "." + std::string(STR( __GNUC_MINOR__ )) + '\n';
58 58
 #elif defined( _MSC_VER )
59
-    Rcpp::Rcout << "Compiled with Microsoft Visual Studio\n";
59
+    std::string compiler = "Compiled with Microsoft Visual Studio\n";
60 60
 #endif
61 61
 
62 62
 #if defined( __GAPS_AVX__ )
63
-    Rcpp::Rcout << "AVX enabled\n";
63
+    std::string simd = "AVX enabled\n";
64 64
 #elif defined( __GAPS_SSE__ )
65
-    Rcpp::Rcout << "SSE enabled\n";
65
+    std::string simd = "SSE enabled\n";
66 66
 #else
67
-    Rcpp::Rcout << "SIMD not enabled\n";
67
+    std::string simd = "SIMD not enabled\n";
68 68
 #endif
69
+    return compiler + simd;
69 70
 }
... ...
@@ -53,13 +53,14 @@ BEGIN_RCPP
53 53
     return rcpp_result_gen;
54 54
 END_RCPP
55 55
 }
56
-// displayBuildReport_cpp
57
-void displayBuildReport_cpp();
58
-RcppExport SEXP _CoGAPS_displayBuildReport_cpp() {
56
+// getBuildReport_cpp
57
+std::string getBuildReport_cpp();
58
+RcppExport SEXP _CoGAPS_getBuildReport_cpp() {
59 59
 BEGIN_RCPP
60
+    Rcpp::RObject rcpp_result_gen;
60 61
     Rcpp::RNGScope rcpp_rngScope_gen;
61
-    displayBuildReport_cpp();
62
-    return R_NilValue;
62
+    rcpp_result_gen = Rcpp::wrap(getBuildReport_cpp());
63
+    return rcpp_result_gen;
63 64
 END_RCPP
64 65
 }
65 66
 // run_catch_unit_tests
... ...
@@ -76,7 +77,7 @@ END_RCPP
76 77
 static const R_CallMethodDef CallEntries[] = {
77 78
     {"_CoGAPS_cogaps_cpp", (DL_FUNC) &_CoGAPS_cogaps_cpp, 21},
78 79
     {"_CoGAPS_cogapsFromCheckpoint_cpp", (DL_FUNC) &_CoGAPS_cogapsFromCheckpoint_cpp, 7},
79
-    {"_CoGAPS_displayBuildReport_cpp", (DL_FUNC) &_CoGAPS_displayBuildReport_cpp, 0},
80
+    {"_CoGAPS_getBuildReport_cpp", (DL_FUNC) &_CoGAPS_getBuildReport_cpp, 0},
80 81
     {"_CoGAPS_run_catch_unit_tests", (DL_FUNC) &_CoGAPS_run_catch_unit_tests, 0},
81 82
     {NULL, NULL, 0}
82 83
 };