[Scons-users] No executable for fortran program with module
Gary Oberbrunner
garyo at oberbrunner.com
Sun Oct 5 11:19:08 EDT 2014
Great news. Now I'm not a Fortran guy, but SCons is supposed to be
able to scan Fortran sources to find module names and do the right
thing with them. So you might be able to just omit endian.f from your
source list and not worry about removing it from the obj list,
reducing your code to just env.Program('testconvert.x',
'testconvert.f') or something like that.
On Sun, Oct 5, 2014 at 10:51 AM, Christopher Dimech
<dimech.christopher at gmail.com> wrote:
> Changed it like you said with some modification to env.Program and
> the program builds and runs correctly.
>
> path = ['/bin', '/usr/bin', '/home/cdim/Local/gcc-4.9.0/bin']
>
> env = Environment(
> ENV = {'PATH' : path},
> tools=['default','gfortran'],
> LINK='gfortran',
> LINKFLAGS='-g',
> FORTRANFLAGS='-ffree-form -g'
> )
>
> sources = ['testconvert.f', 'endian.f']
> allobjs = env.Object(sources)
>
> # Get rid of the .mod names
> objs = filter(lambda o: str(o)[-4:] != '.mod', allobjs)
>
> env.Program('testconvert.x', objs)
>
>
>
>
>
> On 5 October 2014 15:21, Gary Oberbrunner <garyo at oberbrunner.com> wrote:
>>
>> On Sun, Oct 5, 2014 at 9:27 AM, Christopher Dimech
>> <dimech.christopher at gmail.com> wrote:
>> > Good afternoon Gary,
>> >
>> > It would help if you can write down the code you would write,
>> > as I only started using it yesterday and can be confusing.
>>
>> Try something like this (untested):
>>
>> env = Environment(tools=['default','gfortran'], LINKFLAGS='-g', ENV =
>> {'PATH' : path}, FORTRANFLAGS=['-ffree-form', '-g'])
>>
>> --
>> Gary
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
>
>
> --
> Christopher Dimech
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
--
Gary
More information about the Scons-users
mailing list