Ticket #10508: compilers.patch

File compilers.patch, 1.5 KB (added by jpflori, 8 years ago)

Use FC instead of sage_fortran and preserve compiler options.

  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    287287    os.mkdir(BUILD_DIR)
    288288    os.chdir(BUILD_DIR)
    289289
     290    # We need to provide full pathes to FC and CC to ATLAS configure script,
     291    # so that it does not use 'find' and travel around the filesystem to find
     292    # them.
     293    # We first split the compiler executable names from potential options, e.g.
     294    # as in 'gcc -m64', then use 'which' to locate them, and finally add the
     295    # options back.
     296    FC = os.environ['FC']
     297    FCsplit = FC.find(' ')
     298    if  FCsplit != -1:
     299        FCbin, FCopt = FC[:FCsplit], FC[FCsplit:]
     300    else:
     301        FCbin, FCopt = FC, ''
     302
     303    CC = os.environ['CC']
     304    CCsplit = CC.find(' ')
     305    if  CCsplit != -1:
     306        CCbin, CCopt = CC[:CCsplit], CC[CCsplit:]
     307    else:
     308        CCbin, CCopt = CC, ''
     309
    290310    cmd = '../src/configure'
    291311    cmd += ' --prefix=' + conf['SAGE_LOCAL']
    292312    cmd += ' --with-netlib-lapack-tarfile=' + LAPACK_TARFILE
    293     cmd += ' --cc="' + os.environ['CC'] + '"'
     313    cmd += ' --cc="' + CC + '"'
    294314
    295315    ## -Si latune 1: enable lapack tuning
    296316    ## typically adds 3-4 hours of install time
     
    303323    #cmd += ' -t 0'
    304324
    305325    # set fortran compiler
    306     cmd += ' -C if "' + which('sage_fortran') + '"'
     326    cmd += ' -C if "' + which(FCbin) + FCopt + '"'
    307327
    308328    # set C compiler
    309     cmd += ' -C acg "' + which(os.environ['CC']) + '"'
     329    cmd += ' -C acg "' + which(CCbin) + CCopt + '"'
    310330
    311331    # set bit width
    312332    cmd += ' -b ' + conf['bits'][0:2]