Scons to build F90, with mixed C. C++



Hi, FORTRAN cookies,

I plan to migrate a mixed language build (C, C++, FORTRAN) from imake
and Make into scons.


In Scons documentation, it says it supports ifort. How to invoke it?
Is it enough just have this line?
env = Environment(FORTRAN ='ifort', ENV = os.environ, CC='ifort')

Experts please advice.

Some ons in this group asked a simple example, here it is.

Here is a simple example that works with Intel FORTRAN compiler:

hello.f90 file:
------------------
program test
write (*,*) "hello, FORTRAN"
end program

SConstruct file:
---------------
import os
env = Environment(FORTRAN ='ifort', ENV = os.environ, CC='ifort')
env.Program(target = 'hello' , source = 'hello.f90')

command and output:
-------------------------
l4855nfx: /users/chena/prj/scons/fortran/c1-ifort >scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
ifort -c -o hello.o hello.f90
ifort -o hello hello.o
scons: done building targets.
l4855nfx: /users/chena/prj/scons/fortran/c1-ifort >ll
total 400
-rwxr-xr-x 1 chena console 396635 2005-12-22 16:32 hello*
-rw-r--r-- 1 chena console 60 2005-12-22 16:10 hello.f90
-rw-r--r-- 1 chena console 1245 2005-12-22 16:32 hello.o
-rw-r--r-- 1 chena console 131 2005-12-22 16:25 SConstruct
l4855nfx: /users/chena/prj/scons/fortran/c1-ifort >

~Andrew Chen

.



Relevant Pages

  • Problems with installing qpxtool on FC6
    ... scons: Reading SConscript files ... ... scons: done reading SConscript files. ... around assignment used as truth value ...
    (Fedora)
  • Re: non_lazy_ptr problem
    ... I got this non_lazy_ptr stuffs in Mac OS X and I realized this is an Apple ... scons: Reading SConscript files ... ... scons: done reading SConscript files. ... scons: Building targets ... ...
    (comp.sys.mac.programmer.help)
  • non_lazy_ptr problem
    ... I got this non_lazy_ptr stuffs in Mac OS X and I realized this is an Apple ... scons: Reading SConscript files ... ... scons: done reading SConscript files. ... scons: Building targets ... ...
    (comp.sys.mac.programmer.help)
  • Re: Scons help!
    ... SCons users mailing list, users@scons.tigris.org. ... > scons: done reading SConscript files. ... specifications for Microsoft Visual C++ and GCC. ...
    (comp.lang.python)
  • Re: Depedency Generation for g77
    ... I am looking into using Scons as a replacement for make. ... handle C and Fortran dependencies gracefully and the build files end ... up being far simpler.http://www.scons.org/- Tekst uit oorspronkelijk bericht niet weergeven - ...
    (comp.lang.fortran)