[Scons-users] No executable for fortran program with module
Christopher Dimech
dimech.christopher at gmail.com
Sun Oct 5 08:55:44 EDT 2014
I am trying to use scons to build a program in fortran 2008.
I am using a makefile to build the program as follows
all:
/home/cdim/Local/gcc-4.9.0/bin/gfortran -ffree-form -c endian.f
/home/cdim/Local/gcc-4.9.0/bin/gfortran -ffree-form -c testconvert.f
/home/cdim/Local/gcc-4.9.0/bin/gfortran testconvert.o endian.o -o endian
Then I created SConstuct as follows
path = ['/bin', '/usr/bin', '/home/cdim/Local/gcc-4.9.0/bin']
env = Environment(ENV = {'PATH' : path})
env.Append(tools=['default','gfortran'],LINK='gfortran',LINKFLAGS='-g')
env.Append(FORTRANFLAGS='-ffree-form -g')
sources = ['endian.f','testconvert.f']
allobjs = env.Object(sources)
# Print the kind of object in the list that comes back from env.Object
#print "Object list item type: " + type(objs[0])
# Get rid of the .mod names
#objs = [objs for objs in allobjs if obj.get_suffix() == ".o"]
objs = filter(lambda o: str(o)[-4:] != '.mod', allobjs)
env.Program("testconvert.x", ['testconvert.f'] + objs)
As mentioned, the executable testconvert.x is not being created.
endian.f consists of a module called Endian
testconvert.f contains the main program which uses the
module Endian.
Regards
--
Christopher Dimech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141005/d7f7a9b5/attachment.html>
More information about the Scons-users
mailing list