[Scons-users] Intel MPI on Windows; best practices ?

Michel Lestrade michel.lestrade at crosslight.com
Wed Nov 28 12:44:32 EST 2012


Hi,

Just starting up with scons; like most people, I ran into trouble
exporting the path initially but I have a working solution now. Thing
is, I will eventually need 32/64bit variant builds for a mixed C/Fortran
project so I am wondering if my solution is optimal:


> import os

> if os.environ['TARGET_ARCH'] == 'ia32':

> arch='x86'

> elif os.environ['TARGET_ARCH'] == 'intel64':

> arch='emt64'

> else:

> print "Unable to detect 32/64 bit platform setting: compilation

> aborted"

> Exit(1)

>

> env = Environment(tools=['default','intelc','ifort'],TARGET_ARCH=arch)

> env.Append(ENV = {'PATH' : os.environ['PATH']})

> env.Append(ENV = {'INCLUDE' : os.environ['INCLUDE']})

> env.Append(ENV = {'LIB' : os.environ['LIB']})

> env.Append(ENV = {'I_MPI_ROOT' : os.environ['I_MPI_ROOT']})

>

> # Override default tools with MPI-enabled wrappers

> env.Replace(CC='mpiicc')

> env.Replace(CXX='mpiicc')

> env.Replace(F77='mpiifort')

> env.Replace(F90='mpiifort')


It seems that unless I specify TARGET_ARCH when the environment is
created, I cannot be sure of whether I am running inside a 32bit or
64bit shell (Intel compiler window, derived from VisualStudio 2008
shell). Is there a better solution than grabbing the os environment value ?

Also, Appendix A of the manual says that $FORTRAN should be the default
compiler for all Fortran versions. However, overriding that value does
not seem to work; I have to override $F90 instead to get scons to use
the mpiifort wrapper. Is that a bug or is it something that needs to be
set during the environment creation ?


More information about the Scons-users mailing list