[Scons-users] How to use scons build parallel program(MPI)?

Paweł Tomulik ptomulik at meil.pw.edu.pl
Fri Apr 10 10:52:37 EDT 2015


W dniu 10.04.2015 o 16:36, 罗飞 pisze:
> According to the Internet,I write another SConstruct to compile MPI:
> -------------------------------------------------------------------------------------------------------
>    import os
>    env=Environment(ENV={'PATH':os.environ['PATH']},F90='mpif90')
>    env.Program('helloscons.f90')
> ======================================================
> It is still wrong! As shown below:
> ==================================
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> mpif90 -o helloscons.o -c helloscons.f90
> gfortran -o helloscons helloscons.o
> helloscons.o: In function `MAIN__':
> helloscons.f90:(.text+0x1f): undefined reference to
> `__intel_new_feature_proc_init'
> helloscons.f90:(.text+0x38): undefined reference to `for_set_reentrancy'
> helloscons.f90:(.text+0x44): undefined reference to `mpi_init_'
> helloscons.f90:(.text+0x5a): undefined reference to `mpi_comm_rank_'
> helloscons.f90:(.text+0x70): undefined reference to `mpi_comm_size_'
> helloscons.f90:(.text+0xb5): undefined reference to `for_write_seq_lis'
> helloscons.f90:(.text+0xc1): undefined reference to `mpi_finalize_'
> collect2: ld returned 1 exit status
> scons: *** [helloscons] Error 1
> scons: building terminated because of errors.
> 


Try setting 'FORTRAN' env variable instead of 'F90'. If this doesn't
help, make an experiment with 'LINK'.


-- 
Pawel Tomulik


More information about the Scons-users mailing list