runtime variable substitution

David Strubbe dstrubbe at
Sat Jul 13 13:44:47 PDT 2013

Hi all,

I am trying to add MPI support to my octopus port, and trying to find the
proper way of enforcing consistent Fortran versions. I put the following
code into pre-configure, which almost seems to do the job. The error is not
triggered, and the message gives the correct Fortran compiler in the cases
I tried. However, the "require_active_variants libxc" line does not seem to
be executed: there is no corresponding output in the main.log, and it does
not cause an error even when the variant in question is not set. Am I
supposed to wrap something around this call to make it substitute the
variable properly?


pre-configure {
    set fortran unknown
    set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 g95 }
    foreach fc_name ${fortrans} {
        if { [variant_isset ${fc_name}] } {
            set fortran ${fc_name}
        } elseif { [variant_isset openmpi] } {
            if { [active_variants openmpi ${fc_name}] } { set fortran
${fc_name} }
        } elseif { [variant_isset mpich] } {
            if { _portnameactive mpich} {
                if { [active_variants mpich ${fc_name}] } { set fortran
${fc_name} }
            } elseif { _portnameactive mpich-devel } {
                if { [active_variants mpich-devel ${fc_name}] } { set
fortran ${fc_name} }
    if { ${fortran} == "unknown" } {
        ui_error "Internal error: cannot determine Fortran compiler."
    ui_msg "Fortran compiler is ${fortran}."

    require_active_variants libxc ${fortran}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-dev mailing list