質問編集履歴

1

g++とC++の動作確認のコードを実行し、その結果を記述

2019/06/22 23:43

投稿

sequoia
sequoia

スコア6

test CHANGED
File without changes
test CHANGED
@@ -52,8 +52,6 @@
52
52
 
53
53
  ### 試したこと
54
54
 
55
-
56
-
57
55
  関係あるかはわかりませんが、
58
56
 
59
57
  rstanのインストール前に、以下のコードを実行して、「TRUE」になりました。
@@ -68,6 +66,72 @@
68
66
 
69
67
 
70
68
 
69
+ 追記(2019/06/23 8:40)
70
+
71
+ g++とC++の動作確認のコードを実行しました。どちらも成功しました。
72
+
73
+
74
+
75
+ g++のチェック(最後にgccのバージョンが表示されたら成功)
76
+
77
+ ```R
78
+
79
+ > system('g++ -v')
80
+
81
+ ```
82
+
83
+ 結果
84
+
85
+ ```R
86
+
87
+ Using built-in specs.
88
+
89
+ COLLECT_GCC=C:\TDM-GC~1\bin\G__~1.EXE
90
+
91
+ COLLECT_LTO_WRAPPER=C:/TDM-GC~1/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.0/lto-wrapper.exe
92
+
93
+ Target: x86_64-w64-mingw32
94
+
95
+ Configured with: ../../../src/gcc-5.1.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs
96
+
97
+ Thread model: posix
98
+
99
+ gcc version 5.1.0 (tdm64-1)
100
+
101
+ [1] 0
102
+
103
+ ```
104
+
105
+ c++の動作確認
106
+
107
+ ```R
108
+
109
+ > fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , 'return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ; ')
110
+
111
+ > fx( 2L, 5 )
112
+
113
+ ```
114
+
115
+ 結果
116
+
117
+ ```R
118
+
119
+ bash.exe: warning: could not find /tmp, please create!
120
+
121
+ bash.exe: warning: could not find /tmp, please create!
122
+
123
+ /Rtools/bin/sed: -e expression #1, char 1: unknown command: `C'
124
+
125
+ /Rtools/bin/sed: couldn't flush stdout: Invalid or incomplete multibyte or wide character
126
+
127
+ ```
128
+
129
+ ```R
130
+
131
+ [1] 10
132
+
133
+ ```
134
+
71
135
  ### 補足情報(FW/ツールのバージョンなど)
72
136
 
73
137
  実行環境