[f2py] shareable shared object

"Carolyn Ownby" <cownby-3cX0WNFPGhnd8qItzerBq9sjr/[email protected]> Mon, 30 Jul 2012 10:42:20 -0600
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
--===============7984539417513703571==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0012_01CD6E3F.FF7512B0"
Content-Language: en-us

------=_NextPart_000_0012_01CD6E3F.FF7512B0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Disposition: inline

Hello,

 

I am relatively new to f2py and just found this list.  What a relief to find
other folks using this tool!  I've been struggling with f2py for a few
weeks, and have finally located & loaded all the compilers required and am
successfully executing Fortran methods from my python scripts.

 

Now for the question: Is there a way to create the shared object such that
all required libraries/methods are contained within?  This may not be an
f2py specific question, but I don't see a flag that forces the compiler to
do this.

 

I am developing a set of python scripts which will be distributed for
outside use.  Much of what we need to do is already written in Fortran;
hence the desire to use f2py.  However, my collaborators cannot use the
shared objects I create, apparently because of missing DLLs.  (My
development and target platform is windows.)  I took my .pyd file to a test
machine and copied in missing DLLs until it ran, but each environment is
different, and my collaborators still cannot execute with my shared object
file.  They can recompile with my signature file and run successfully.

 

These are the commands I'm using:

f2py -m mask_water -h mask_water.pyf mask_water.f90

f2py --compiler=mingw32 -c mask_water.pyf mask_water.f90

 

On my machine, I must explicitly specify the C compiler.  I'm sure there's a
way to define this somewhere, but it works.

 

In case it helps, here is what I've installed:

                python-2.6.msi

                numpy-1.6.1-win32-superpack-python2.6.exe

                mingw-get-inst-20120426.exe

                   (only installed compiler suite: fortran, c, c++,
objective)

 

My platform is 64 bit Windows 7.  I am tied to python 2.6 because this is an
ArcGIS application, and ArcGIS isn't up to 2.7 yet.  I installed the 32 bit
versions because ArcGIS is only 32 bit, and this set happened to be an
iteration that worked.

 

Thank you; I appreciate any insight you can offer!

 

______________________________________________________________________

Carolyn Ownby 

Research Associate  | Colorado State University | 970-491-3606 |
<http://uvb.nrel.colostate.edu/> http://uvb.nrel.colostate.edu

 


------=_NextPart_000_0012_01CD6E3F.FF7512B0
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-mi=
crosoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:wo=
rd" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D=
"http://www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type c=
ontent=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D=
"Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
=2EMsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue v=
link=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>Hello,<o:p><=
/o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>I=
 am relatively new to f2py and just found this list.&nbsp; What a relief t=
o find other folks using this tool!&nbsp; I&#8217;ve been struggling with=
 f2py for a few weeks, and have finally located &amp; loaded all the comp=
ilers required and am successfully executing Fortran methods from my pyth=
on scripts.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p cl=
ass=3DMsoNormal>Now for the question: <b>Is there a way to create the sha=
red object such that all required libraries/methods are contained within?=
</b>&nbsp; This may not be an f2py specific question, but I don&#8217;t s=
ee a flag that forces the compiler to do this.<o:p></o:p></p><p class=3DM=
soNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>I am developing a set o=
f python scripts which will be distributed for outside use.&nbsp; Much of=
 what we need to do is already written in Fortran; hence the desire to us=
e f2py.&nbsp; However, my collaborators cannot use the shared objects I c=
reate, apparently because of missing DLLs.&nbsp; (My development and targ=
et platform is windows.)&nbsp; I took my .pyd file to a test machine and c=
opied in missing DLLs until it ran, but each environment is different, an=
d my collaborators still cannot execute with my shared object file.&nbsp;=
 They can recompile with my signature file and run successfully.<o:p></o:=
p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>Thes=
e are the commands I&#8217;m using:<o:p></o:p></p><p class=3DMsoNormal st=
yle=3D'text-indent:.5in'>f2py -m mask_water -h mask_water.pyf mask_water.=
f90<o:p></o:p></p><p class=3DMsoNormal style=3D'text-indent:.5in'>f2py --=
compiler=3Dmingw32 -c mask_water.pyf mask_water.f90<o:p></o:p></p><p clas=
s=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>On my machine, I m=
ust explicitly specify the C compiler.&nbsp; I&#8217;m sure there&#8217;s=
 a way to define this somewhere, but it works.<o:p></o:p></p><p class=3DM=
soNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal>In case it helps, here=
 is what I&#8217;ve installed:<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; python-2.6.msi<o:p></o:p></p><p class=3DMsoNormal>&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; numpy-1.6.1-win32-superpack-python2.6.exe<o:p></o:p></p><p class=3D=
MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; mingw-get-inst-20120426.exe<o:p></o:p></p><p c=
lass=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (only installed compiler s=
uite: fortran, c, c++, objective)<o:p></o:p></p><p class=3DMsoNormal><o:p=
>&nbsp;</o:p></p><p class=3DMsoNormal>My platform is 64 bit Windows 7.&nb=
sp; I am tied to python 2.6 because this is an ArcGIS application, and Ar=
cGIS isn&#8217;t up to 2.7 yet.&nbsp; I installed the 32 bit versions bec=
ause ArcGIS is only 32 bit, and this set happened to be an iteration that=
 worked.<o:p></o:p></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=
=3DMsoNormal>Thank you; I appreciate any insight you can offer!<o:p></o:p=
></p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span=
 style=3D'font-size:10.0pt;color:#7030A0'>_______________________________=
_______________________________________</span><span style=3D'color:black'=
><o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:10.0=
pt;color:#7030A0'>Carolyn Ownby <o:p></o:p></span></p><p class=3DMsoNorma=
l><span style=3D'font-size:9.0pt;color:#7030A0'>Research Associate&nbsp; |=
 Colorado State University | 970-491-3606 </span><span style=3D'font-size=
:9.0pt;color:#7030A0'>|</span><span style=3D'font-size:9.0pt;color:#7030A=
0'>&nbsp;</span><span style=3D'font-size:9.0pt'><a href=3D"http://uvb.nre=
l.colostate.edu/"><span style=3D'color:blue'>http://uvb.nrel.colostate.ed=
u</span></a><span style=3D'color:#7030A0'><o:p></o:p></span></span></p><p=
 class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></body></html>
------=_NextPart_000_0012_01CD6E3F.FF7512B0--


--===============7984539417513703571==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users

--===============7984539417513703571==--