Re: Inline::F2003 - New ILSM proposed

[email protected] (Ron Grunwald via inline) Sat, 10 Jun 2017 18:53:54 +0800
Newsgroups perl.inline
Message-ID <[email protected]>
--Apple-Mail=_726D9B34-06BB-4C3C-BE50-06B4E8FFDFEA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello all,

The example code below illustrates how Inline::F2003 could be configured =
to build a shared library from the Fortran source files listed in =
"SRCLIST". Also, I propose to add a new parameter called "MAKEFILE", and =
this leads me into an area that I'm unsure about.

use Inline F2003 =3D> Config =3D> (
                       SRCLIST   =3D> "ModMatrixOps.f03",
                       LIBNAME   =3D> "libMatrixOps.so",
                       LIBTYPE   =3D> ".so",
                       MAKEFILE  =3D> "AUTOMAKE",
                       BUILDDIR  =3D> "BLD_Linux.AMD64_gfortran",
                       FOR       =3D> "gfortran",
                       FORFLG    =3D> "-v -g -c -std=3Df2003 -fpic -cpp"
                    );

This new parameter "MAKEFILE" is intended to allow programmers to =
specify their own makefile. However, the special value "AUTOMAKE" can =
also be specified (as shown above), which means that Inline::F2003 would =
generate a suitable makefile, and this is where I need some advice.

Inline::C uses ExtUtils::MakeMaker to generate the makefile. I would =
like to use ExtUtils::MakeMaker, but I don't think it would be possible =
since it generates makefiles for C compilation, not Fortran compilation. =
Unless there is some clever way to configure ExtUtils::MakeMaker to =
output Fortran makefiles?

Another option is to use the GNU autotools. In this scenario, =
Inline::F2003 would read an existing "Makefile.in", then use the =
parameters specified in the above example, and write out the final =
Makefile. Sounds simple, but I've never done this before.

If anyone is able to provide advice, suggestions or opinions, I would be =
really grateful. Many thanks for reading.

Cheers,
Ron.
________________________________________
Ron Grunwald
[email protected]
http://www.dvlcorner.org


> On 22 May 2017, at 9:55 pm, Ron Grunwald via inline <[email protected]> =
wrote:
>=20
> Hello all,
>=20
> I've been thinking about this for quite some time now, and have =
finally decided to pursue the idea of a modern FORTRAN Inline module. =
Given that soon I'll be having some time available through to the end of =
this year, I'm confident that I can make this work.
>=20
> The name of the proposed module is Inline::F2003
>=20


--Apple-Mail=_726D9B34-06BB-4C3C-BE50-06B4E8FFDFEA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><div class=3D"">Hello all,</div><div class=3D""><br =
class=3D""></div><div class=3D"">The example code below illustrates how =
Inline::F2003 could be configured to build a shared library from the =
Fortran source files listed in "SRCLIST". Also, I propose to add a new =
parameter called "MAKEFILE", and this leads me into an area that I'm =
unsure about.</div><div class=3D""><br class=3D""></div><div =
class=3D""><font face=3D"Courier" class=3D"">use Inline F2003 =3D&gt; =
Config =3D&gt; (</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;SRCLIST &nbsp; =3D&gt; =
"ModMatrixOps.f03",</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;LIBNAME &nbsp; =3D&gt; =
"libMatrixOps.so",</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;LIBTYPE &nbsp; =3D&gt; =
".so",</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;MAKEFILE &nbsp;=3D&gt; =
"AUTOMAKE",</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;BUILDDIR &nbsp;=3D&gt; =
"BLD_Linux.AMD64_gfortran",</font></div><div class=3D""><font =
face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FOR &nbsp; &nbsp; &nbsp; =3D&gt; =
"gfortran",</font></div><div class=3D""><font face=3D"Courier" =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;FORFLG &nbsp; &nbsp;=3D&gt; "-v -g -c =
-std=3Df2003 -fpic -cpp"</font></div><div class=3D""><font =
face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; );</font></div><div class=3D""><br =
class=3D""></div><div class=3D"">This new parameter "MAKEFILE" is =
intended to allow programmers to specify their own makefile. However, =
the special value "AUTOMAKE" can also be specified (as shown above), =
which means that Inline::F2003 would generate a suitable makefile, and =
this is where I need some advice.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Inline::C uses ExtUtils::MakeMaker to =
generate the makefile. I would like to use ExtUtils::MakeMaker, but I =
don't think it would be possible since it generates makefiles for C =
compilation, not Fortran compilation. Unless there is some clever way to =
configure ExtUtils::MakeMaker to output Fortran makefiles?</div><div =
class=3D""><br class=3D""></div><div class=3D"">Another option is to use =
the GNU autotools. In this scenario, Inline::F2003 would read an =
existing "Makefile.in", then use the parameters specified in the above =
example, and write out the final Makefile. Sounds simple, but I've never =
done this before.</div><div class=3D""><br class=3D""></div><div =
class=3D"">If anyone is able to provide advice, suggestions or opinions, =
I would be really grateful. Many thanks for reading.</div><div =
class=3D""><br class=3D""></div><div class=3D"">Cheers,</div><div =
class=3D"">Ron.</div><div apple-content-edited=3D"true" class=3D"">
<div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: =
auto; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><div =
class=3D"">________________________________________</div><div =
class=3D""><div style=3D"margin: 0px;" class=3D"">Ron Grunwald</div><div =
style=3D"margin: 0px;" class=3D""><a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a></div><div style=3D"margin: 0px;" =
class=3D""><a href=3D"http://www.dvlcorner.org" =
class=3D"">http://www.dvlcorner.org</a></div></div><div class=3D""><br =
class=3D""></div></div></div><br class=3D""><div><blockquote type=3D"cite"=
 class=3D""><div class=3D"">On 22 May 2017, at 9:55 pm, Ron Grunwald via =
inline &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html charset=3Dus-ascii" =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; -webkit-line-break: after-white-space;" class=3D""><div =
class=3D""><font face=3D"Avenir Next" class=3D""><div class=3D"">Hello =
all,</div><div class=3D""><br class=3D""></div><div class=3D"">I've been =
thinking about this for quite some time now, and have finally decided to =
pursue the idea of a modern FORTRAN Inline module. Given that soon I'll =
be having some time available through to the end of this year, I'm =
confident that I can make this work.</div><div class=3D""><br =
class=3D""></div><div class=3D"">The name of the proposed module is =
Inline::F2003</div><div class=3D""><br =
class=3D""></div></font></div></div></div></blockquote></div><br =
class=3D""></body></html>=

--Apple-Mail=_726D9B34-06BB-4C3C-BE50-06B4E8FFDFEA--