質問編集履歴

4

追記:

2017/07/12 04:57

投稿

kohekoh
kohekoh

スコア140

test CHANGED
File without changes
test CHANGED
@@ -185,3 +185,23 @@
185
185
  このサイトにライブラリのリンクのつなぎ方が書いてあるのですが
186
186
 
187
187
  どうしていいのかがわかりません
188
+
189
+
190
+
191
+ -------------追記----------------
192
+
193
+ minwgのインストール方法
194
+
195
+
196
+
197
+ http://web.plus-idea.net/2014/06/mingw-install-2014/
198
+
199
+
200
+
201
+ このサイトの通りに実行しました
202
+
203
+ 最後のgcc --versionで確認することができたので
204
+
205
+ インストールはうまくいっていると思います
206
+
207
+ しかし、32bitか64かはわかっていません

3

情報の修正

2017/07/12 04:57

投稿

kohekoh
kohekoh

スコア140

test CHANGED
File without changes
test CHANGED
@@ -28,6 +28,40 @@
28
28
 
29
29
 
30
30
 
31
+ running build_ext
32
+
33
+ skipping 'cythonfn.c' Cython extension (up-to-date)
34
+
35
+ building 'calculate' extension
36
+
37
+ C:\MinGW\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 "-IC:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include" "-IC:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include" -c cythonfn.c -o build\temp.win-amd64-3.6\Release\cythonfn.o
38
+
39
+ In file included from C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include/Python.h:65:0,
40
+
41
+ from cythonfn.c:4:
42
+
43
+ C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include/pytime.h:112:5: warning: 'struct timeval' declared inside parameter list
44
+
45
+ _PyTime_round_t round);
46
+
47
+ ^
48
+
49
+ C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include/pytime.h:112:5: warning: its scope is only this definition or declaration, which is probably not what you want
50
+
51
+ C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\include/pytime.h:117:5: warning: 'struct timeval' declared inside parameter list
52
+
53
+ _PyTime_round_t round);
54
+
55
+ ^
56
+
57
+ writing build\temp.win-amd64-3.6\Release\calculate.cp36-win_amd64.def
58
+
59
+ C:\MinGW\bin\gcc.exe -shared -s build\temp.win-amd64-3.6\Release\cythonfn.o build\temp.win-amd64-3.6\Release\calculate.cp36-win_amd64.def "-LC:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\libs" "-LC:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\PCbuild\amd64" -lpython36 -lmsvcr140 -o "C:\Users\ユーザ名\Dropbox\prg\make_tips\calculate.cp36-win_amd64.pyd"
60
+
61
+ c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\libs/python36.lib(python36.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
62
+
63
+ C:\Users\ユーザ名\AppData\Local\conda\conda\envs\anaconda\libs/python36.lib: error adding symbols: File format not recognized
64
+
31
65
  collect2.exe: error: ld returned 1 exit status
32
66
 
33
67
  error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
@@ -35,6 +69,102 @@
35
69
 
36
70
 
37
71
  ```
72
+
73
+ また、動かしたいプログラムを以下に示します
74
+
75
+ ```python
76
+
77
+ setup.py
78
+
79
+
80
+
81
+ # -*- coding: utf-8 -*-
82
+
83
+
84
+
85
+ from distutils.core import setup
86
+
87
+ from distutils.extension import Extension
88
+
89
+ from Cython.Distutils import build_ext
90
+
91
+
92
+
93
+ # for notes on compiler flags e.g. using
94
+
95
+ # export CFLAGS=-O2
96
+
97
+ # so gcc has -O2 passed (even though it doesn't make the code faster!)
98
+
99
+ # http://docs.python.org/install/index.html
100
+
101
+
102
+
103
+ ext_modules = [
104
+
105
+ Extension( "calculate", ["cythonfn.pyx"] ),
106
+
107
+ ]
108
+
109
+
110
+
111
+ setup(
112
+
113
+ name = "sample calculate app" ,
114
+
115
+ cmdclass={'build_ext': build_ext },
116
+
117
+ ext_modules = ext_modules,
118
+
119
+ )
120
+
121
+
122
+
123
+ -------------------------------------------------------------------------
124
+
125
+ cythonfn.pyx
126
+
127
+
128
+
129
+ # -*- coding: utf-8 -*-
130
+
131
+
132
+
133
+ def calculate_z(maxiter, zs, cs):
134
+
135
+ """Calculate output list using Julia update rule"""
136
+
137
+ output = [0] * len(zs)
138
+
139
+ for i in range(len(zs)):
140
+
141
+ n = 0
142
+
143
+ z = zs[i]
144
+
145
+ c = cs[i]
146
+
147
+ while n < maxiter and abs(z) < 2:
148
+
149
+ z = z * z + c
150
+
151
+ n += 1
152
+
153
+ output[i] = n
154
+
155
+ return output
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ ```
164
+
165
+
166
+
167
+
38
168
 
39
169
 
40
170
 

2

追記:

2017/07/12 04:29

投稿

kohekoh
kohekoh

スコア140

test CHANGED
File without changes
test CHANGED
@@ -43,3 +43,15 @@
43
43
  どう改善していいかわかりません
44
44
 
45
45
  よろしくお願いします
46
+
47
+
48
+
49
+ ちなみに
50
+
51
+ http://www.geocities.jp/penguinitis2002/computer/programming/Python/cython/cython.html
52
+
53
+
54
+
55
+ このサイトにライブラリのリンクのつなぎ方が書いてあるのですが
56
+
57
+ どうしていいのかがわかりません

1

追記:

2017/07/12 04:13

投稿

kohekoh
kohekoh

スコア140

test CHANGED
File without changes
test CHANGED
@@ -3,6 +3,12 @@
3
3
  mingwをインストールしたのですが
4
4
 
5
5
  そこでつまってしまいました
6
+
7
+
8
+
9
+ 開発環境はanacondaで 、windows10です
10
+
11
+ python3系で動かせればうれしいです
6
12
 
7
13
 
8
14