<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 12, 2015 at 7:23 PM, 石头 <span dir="ltr"><<a href="mailto:dasssj@126.com" target="_blank">dasssj@126.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>Hi,everybody,<br>I'm new to f2py, and I got some trouble when  wrapped  some fortran files to Python.<br>I have download  a Fortran library (<a href="https://github.com/brianlockwood/ForK)," target="_blank">https://github.com/brianlockwood/ForK),</a> I want to compile these files into a library and call the library by other Fortran file wrote by myself.<br>Here are my questions:<br>1. How should I compile the library(in this case,Fork), and what command should I use;<br></div></div></blockquote><div><br></div><div>In ForK, try</div><div><br></div><div>  make all</div><div><br></div><div>that should result kriginglib.a. You might need to add -fPIC option to FFLAGS in Makefile before executing make.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>2. How can I use the library and my own Fortran source fileI( All.f90 )  with the f2py command to generate the module I can use py Python<br></div></div></blockquote><div><br></div><div>Try</div><div><br></div><div>f2py -c -m mylib All.f90 /path/to/kriginglib.a</div><div>python</div><div>>>> import mylib</div><div>>>> print mylib.__doc__</div><div><br></div><div>HTH,</div><div>Pearu</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>Thanks!<br></div>Shishijie<br></div><br><br><span title="neteasefooter"><span></span></span><br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div></div>