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

Russel Winder russel at winder.org.uk
Wed Nov 28 14:52:16 EST 2012


On Wed, 2012-11-28 at 09:44 -0800, Michel Lestrade wrote:

> 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)


I suspect that you have come up against what I think is a big hole in
the SCons infrastructure. I tend to use os.uname() or platform.uname()
and pure Python to condition my build and then a call to SConsFile to
ensure each platform works to a separate signature file.

Autotools handles all this very well. CMake has some support for this,
as does Waf. SCons seems to leave it all to individual programmer
hacking with Python :-(


> > 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')


Sadly, I have found that something equivalent to the above is needed; I
precondition the environment rather than explicitly amend it, but the
effect is the same.

Caveat: I don't use the Intel compiler, usually GCC or Clang and I am
always on Linux, or sometimes OS X.


> 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 ?


I have no experience of using Visual Studio, but I have found that as
long as you specify a SConsFile it partitions things so as to allow
multiple architecture build in the same filestore.


> 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 ?


I am not sure we have a real Fortran expert still active within SCons. I
fiddle with Fortran 2009 from time to time but I am no expert.

(I think MPI is an aberration that should be excised to be replaced by a
sane transport for actors, dataflow and CSP. On the other hand it is the
industry standard ;-)

--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20121128/7b237575/attachment.pgp>


More information about the Scons-users mailing list