def ifort_conf(ctx):
  import waflib
  import os
  ctx.env.FC=[]
  ctx.load('ifort')
  if sys.platform.lower()=="darwin":
    ctx.env.LINKFLAGS_fcshlib = ['-dynamiclib']
  ctx.env.append_value('FCFLAGS',ctx.env.mopt.split())
  ctx.env["FCFLAGS_fc_omp"]=[]
  ctx.env.append_value("FCFLAGS_fc_omp","-openmp")
  ctx.env.FCSHLIB_MARKER = [""]
  ctx.env.FCSTLIB_MARKER = [""]
  ctx.check_cc(
    errmsg="failed",msg='Compile a test code with ifort',
    mandatory=1,fragment = "program test\n  WRITE(*,*) 'hello world'\n end program test\n",compile_filename='test.f90',features='fc fcprogram')
  if not ctx.options.fortran_flagline:
    ctx.start_msg("retrieve ifort link line")
    try:
      #print "%s %s -dryrun -dynamiclib -shared-intel -no-cxxlib dummy.f90"%(ctx.env.FC," ".join(ctx.env.FCFLAGS))
      llgo,llge = ctx.cmd_and_log("%s %s -dryrun -dynamiclib -shared-intel -no-cxxlib dummy.f90"%(ctx.env.FC," ".join(ctx.env.FCFLAGS+ctx.env.FCFLAGS_fc_omp)), output=waflib.Context.BOTH)
      #print "RET",llgo,llge
      L = set([ll.strip() for ll in re.findall("-L(.+)\s*\\\\", llge.split("ld ")[1]) if (ll.lower() in "ifort") or ("intel" in ll.lower())])
      l = set([ll.strip() for ll in re.findall("-l(.+)\s*\\\\", llge.split("ld ")[1])])
      rL = set()
      rl = set()
      for Li in L:
        oli = os.listdir(Li)
        for li in l:
          if ctx.env.cshlib_PATTERN%li in oli:
            rl.add(li)
            rL.add(Li)
    except:
      ctx.end_msg(False)
      raise
    for pth in list(rL) + ["/lib","/lib64"]:
      if osp.exists(pth):
        ctx.env.append_value("LIBPATH_fc_runtime",pth)
        ctx.env.append_value("RPATH_fc_runtime",pth)
    
    ctx.env.append_value("LIB_fc_runtime",list(rl)+["pthread"])
    ctx.end_msg(True)
  show_linkline(ctx)
  ctx.env.has_ifort = True
dataset/ETHPy150Open baudren/montepython_public/wrapper_wmap/waf_tools/try_ifort.py/ifort_conf/swapped operands of `in`