[MacPorts] #19397: scipy not completely universal

MacPorts noreply at macports.org
Mon May 4 08:42:15 PDT 2009


#19397: scipy not completely universal
-------------------------------------------+--------------------------------
 Reporter:  daweonline@…                   |       Owner:  jmr@…           
     Type:  defect                         |      Status:  new             
 Priority:  Normal                         |   Milestone:                  
Component:  ports                          |     Version:  1.7.1           
 Keywords:  scipy python universal binary  |        Port:  py26-scipy      
-------------------------------------------+--------------------------------

Comment(by vince@…):

 This version of gfortran is also available here :
 http://r.research.att.com/tools/

 But the way it handles the command line is buggy. For example :

 -> /usr/local/bin/gfortran -arch i386
 i686-apple-darwin8-gfortran-4.2: no input files
 -> /usr/local/bin/gfortran -arch i386 -arch x86_64
 ->

 Strange, no? If two archs flags are present, there is no stderr output.

 Here is a way to build a universal scipy with this compiler located in
 /usr/local/bin:

 1. Add this file in the ${portpath} file directory, it wraps
 /usr/local/bin/gfortran-4.2, fixes the bug above and another one in the
 building process (automatic addition of -arch i686 and -arch ppc; why
 ???):

 -> more files/gf.in
 #!/bin/sh

 NOF=yes
 IGNORE=no
 ARGS=

 for i in $@ ; do
 if [ $IGNORE == 'yes' ]; then
   IGNORE=no
 else
   if [ $i == '-arch' ]; then
     IGNORE=yes
   else
     ARGS=`echo $ARGS " " $i`
     if [ $i == '-o' ]; then
       NOF=no
     fi
   fi
 fi
 done

 if [ $NOF == 'yes' ]; then
 /usr/local/bin/gfortran-4.2 $@
 else
 /usr/local/bin/gfortran-4.2 XXX $ARGS
 fi

 2. Add this variant to Portfile

 variant gf42univ conflicts gcc42 gcc43 gcc44 description "Use gfortan-4.2
 from http://r.research.att.com/tools to build universal binaries" {

 if {! [file exists /usr/local/bin/gfortran-4.2]} then {
    puts "> Please install gfortran universal from
 http:////r.research.att.com//tools//"
    exit 1
 }

 set fc_options "build_clib --fcompiler=gnu95 build_ext --fcompiler=gnu95
 config_fc --fcompiler=gnu95 \
                   --f77exec ${portpath}/files/gf --f90exec
 ${portpath}/files/gf"

 set uarch ""
 foreach arch ${universal_archs} {
         append uarch "-arch " ${arch} " "
 }

 delete ${portpath}/files/gf
 copy ${portpath}/files/gf.in ${portpath}/files/gf
 reinplace "s|XXX|${uarch}|" ${portpath}/files/gf

 build.cmd-append      ${fc_options}
 destroot.cmd-append   ${fc_options}
 }

 Maybe one should also add a system "chmod +x ${portpath}/files/gf" ?
 Vincent

-- 
Ticket URL: <http://trac.macports.org/ticket/19397#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list