Ok, if I just move it outside pre-configure it seems to work. Thanks, David
On Sat, Jul 13, 2013 at 5:52 PM, David Strubbe <[email protected]> wrote: > I see. So, is there a place I can move this piece of code, or should I > just write an error message by hand instead of using > require_active_variants? > > > On Sat, Jul 13, 2013 at 5:07 PM, Joshua Root <[email protected]> wrote: > >> On 2013-7-14 06:44 , David Strubbe wrote: >> > 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? >> > >> > Thanks, >> > David >> > >> > 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} >> > } >> >> require_active_variants only appends to a variable indicating which >> variants you want to require. The actual check is done in pre-configure >> (and pre-archivefetch) code, which has already run by the time your >> pre-configure runs. >> >> - Josh >> > >
_______________________________________________ macports-dev mailing list [email protected] https://lists.macosforge.org/mailman/listinfo/macports-dev
