[Scons-users] How do I compile F90?

Ian Ross ian at skybluetrades.net
Fri Apr 10 04:55:51 EDT 2015


Assuming that ifort is in your path, you can say

env=Environment(TOOLS=['ifort'])

to create your environment.  This will make sure that ifort is used for
compiling and linking and will also set the relevant compiler flags
correctly.

I'm not completely sure, but I think you can specify and explict path to
look for ifort and its supporting tools by doing something like this:

env=Environment(TOOLS=['ifort'], ENV={'PATH': os.environ['PATH'] +
os.pathsep + '/home/apps/intel/composer_xe_2013_sp1.0.080/bin/intel64'})

(That might not be the best way to do things.  Perhaps someone else can
comment?)


On 10 April 2015 at 10:36, 罗飞 <geoluo1217 at gmail.com> wrote:

> Dear developer,
>>
>>       I am learning scons. But,I happened a problem.Please see the
>> screenshot:
>
>          This is my SConstruct:
> ====================================================================
>   1 import os
>   2
> env=Environment(F90='/home/apps/intel/composer_xe_2013_sp1.0.080/bin/intel64/ifort')
>   3 Export('env')
>   4 SConscript('dir/SConscript')
>   5 env.Object('helloscons.f90')
>   6 env.Program('234',['dir/say.o','helloscons.o'])
> ====================================================================
>         scons
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> /home/apps/intel/composer_xe_2013_sp1.0.080/bin/intel64/ifort -o dir/say.o
> -c dir/say.f90
> /home/apps/intel/composer_xe_2013_sp1.0.080/bin/intel64/ifort -o
> helloscons.o -c helloscons.f90
> gfortran -o 234 dir/say.o helloscons.o
> dir/say.o: In function `hello_mp_say_':
> dir/say.f90:(.text+0x4e): undefined reference to `for_write_seq_lis'
> 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'
> collect2: ld returned 1 exit status
> scons: *** [234] Error 1
> scons: building terminated because of errors.
> =====================================================================
>       You can see it used ifort to compile *.f90,but it used gfortran to
> link *.o.
>       Why?
>       Can you tell me how I make scons link *.o by ifort?
>
>
> Thanks!
> Fei Luo
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>


-- 
Ian Ross   Tel: +43(0)6804451378   ian at skybluetrades.net
www.skybluetrades.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150410/3584b908/attachment.html>


More information about the Scons-users mailing list