math/py-numpy vs. math/atlas-devel

b. f. bf1783 at
Mon Nov 9 06:56:15 UTC 2009

Scott Bennett wrote:
>I would like to install science/gnudatalanguage but have been running
>into various obstacles.  Lars Engels very kindly just fixed one of them
>(devel/lasi) (Thanks, Lars!), so now I'm on to the next one, which may not
>be a showstopper, but it's at least a nuisance.  One of the gnudatalanguage
>dependencies is math/py-numpy, which, in turn, depends upon math/atlas.
>However, I have math/atlas-devel installed and do not wish to revert to an
>older, slower version of the ATLAS library.  Adding a "-x atlas-\*" onto
>the portmaster command to build math/py-numpy fails to prevent portmaster
>from trying to build math/atlas.  Creating a
>/var/db/pkg/atlas-3.8.3_1,1/+IGNOREME file in addition doesn't help.  How
>can I force math/py-numpy to accept the already installed math/atlas-devel
>Thanks in advance for any help!

Congratulations, you've managed to defeat three sets of safeguards in

Problem #1

math/atlas and math/atlas-devel don't have proper CONFLICTS entries in
their Makefiles (this should be fixed), so the following code in
portmaster, from dependency_check ():

   1612                 conflicts=''
   1613                 if pm_cd $d_port; then
   1614                         grep -ql ^CONFLICTS Makefile &&
   1615                                 conflicts=`pm_make_b -V CONFLICTS`
   1616                 else
   1617                         fail "Cannot cd to $d_port"
   1618                 fi
   1619                 for glob in $conflicts; do
   1620                         confl_p=`pkg_info -I $glob 2>/dev/null`
   1621                         if [ -n "$confl_p" ]; then
   1622                                 confl_p=${confl_p%% *}
   1623                                 echo ''
   1624                                 echo "===>>> The dependency
for ${origin}"
   1625                                 echo "       seems to be
handled by $confl_p"
   1626                                 echo ''
   1627                                 d_port="$pd/`origin_from_pdb $confl_p`"
   1628                         fi
   1629                 done

doesn't substitute your alternative dependency, math/atlas-devel, for

 Problem #2:

You're using the -x flag incorrectly.  Or portmaster isn't
implementing it properly when the port to be excluded is not actually
installed, take your pick.  It's not completely fool-proof.  Since you
don't have math/atlas installed, the code in portmaster's
dependency_check ():

   1632                 origin="${d_port#$pd/}" ;
iport=`iport_from_origin ${origin}`
   1634                 if [ -n "$iport" ]; then
   1635                         check_exclude $iport || continue
   1636                 else
   1637                         check_exclude $origin || continue
   1638                 fi

   gives origin="math/atlas", and then uses:

    385 iport_from_origin () {
    386         local dir
    387         dir=`grep -l "@comment ORIGIN:${1}$" $pdb/*/+CONTENTS`
    389         # It should not happen that more than one port meets this
    390         # requirement, but it can if the pkg data is corrupted.
    391         dir="${dir%%/+CONTENTS*}"
    392         echo ${dir#$pdb/}
    393 }

to find that iport="" , so "check_exclude math/atlas" is called. Then,
in accordance with:

   1483 check_exclude () {
   1484         [ -n "$PM_EXCL" ] || return 0
   1486         local pat
   1488         for pat in $PM_EXCL; do
   1489                 case "$1" in
   1490                 *${pat}*)
   1491                 if [ -n "$PM_VERBOSE" ]; then
   1492                         echo "===>>> Skipping $1"
   1493                         echo "       because it matches the
pattern: *${pat}*"
   1494                         echo ''
   1495                 fi
   1496                 return 1 ;;
   1497                 esac
   1498         done
   1500         return 0
   1501 }

check_exclude tries to match your patterns in PM_EXCL against
"math/atlas".  But you've got "atlas-" in PM_EXCL (after portmaster's
globstrip removed the trailing asterisk, negating your attempt protect
it with quotes), which won't match because of the hyphen.  It would
have matched if math/atlas were actually installed, in which case
iport="atlas-3.8.3_1,1" and portmaster would have compared iport with
*atlas-*.  You must use a port origin glob with the -x flag when the
port that you wish to exclude isn't installed.

Problem #3:

The +IGNOREME checks in portmaster aren't properly implemented for
this case, so they fail to prevent math/atlas from being built.  To
see this, Continue along in dependency_check (). Here, since iport="",
dependency_check () next calls "check_interactive math/atlas":

   1459 check_interactive () {
   1460         [ -n "$INTERACTIVE_UPDATE" ] || return 0
   1462         local update_to
   1464         [ -n "$2" ] && update_to=" to $2"
   1466         case "$INTERACTIVE_YES" in *:${1}:*) return 0 ;; esac
   1467         case "$INTERACTIVE_NO" in *:${1}:*) return 1 ;; esac
   1469         if [ -e "$pdb/$1/+IGNOREME" ]; then
   1470                 echo ''
   1471                 echo "===>>> +IGNOREME file is present for $1"
   1472         fi
   1474         echo '' ; echo -n "===>>> Update ${1}${update_to}? [y] "
   1475         local answer ; read answer
   1476         case "$answer" in
   1477         [nN]*)  INTERACTIVE_NO="${INTERACTIVE_NO}${1}:" ; return 1 ;;
   1478         *)      INTERACTIVE_YES="${INTERACTIVE_YES}${1}:" ;;
   1479         esac
   1480         return 0
   1481 }

This subroutine can only fail if you've specified an interactive
update and you  decline to update math/atlas.  If that case,
portmaster will start to build math/py-numpy, and if math/atlas-devel
is installed with the needed static libraries, then math/py-numpy
should build normally.  Apparently this didn't happen during your

The +IGNOREME check is useless here because the subroutine checks only
for /var/db/pkg/math/atlas/+IGNOREME, not the usual

Returning to dependency_check (), "update_port math/atlas" is called
next, which then recursively calls "portmaster math/atlas" with many
of your original flags.  This jumps to

1943 # Figure out what we are going to be working on

Shortly afterwards, portdir is found to be ="math/atlas", and

2020 [ -z "$upg_port" -a -z "$REPLACE_ORIGIN" ] &&
2021         upg_port=`iport_from_origin ${portdir}`

gives upg_port="", as before when computing iport in dependency_check ().  Hence

2023 if [ -e "$pdb/$upg_port/+IGNOREME" ]; then

is false, and another +IGNOREME check is bypassed.  math/atlas is then built.

So what can you do while these problems are being fixed?  You could either:

1) Install math/atlas-devel, and use -x math/atlas on the portmaster
command line; or
2) Install math/atlas-devel, and use only interactive portmaster
builds in which you decline to build math/atlas; or
3) Install math/atlas-devel, and patch the math/atlas Makefile:

--- ports/math/atlas/Makefile.orig      2009-11-09 01:19:21.000000000 -0500
+++ ports/math/atlas/Makefile   2009-11-09 01:15:55.000000000 -0500
@@ -22,6 +22,7 @@
 USE_GMAKE=     yes
 WRKSRC=                ${WRKDIR}/ATLAS
+CONFLICTS=     atlas-devel-[0-9]*

 .include <>

 ; or

 4) Patch the math/py-numpy Makefile:

 --- ports/math/py-numpy/Makefile.orig   2009-11-08 20:49:13.000000000 -0500
+++ ports/math/py-numpy/Makefile        2009-11-08 20:49:30.000000000 -0500
@@ -35,7 +35,7 @@
 .include <>

 .if defined(WITH_ATLAS)
-LIB_DEPENDS+=  atlas.2:${PORTSDIR}/math/atlas
+LIB_DEPENDS+=  atlas.2:${PORTSDIR}/math/atlas-devel
 .if !exists(${LOCALBASE}/lib/libalapack.a)
 IGNORE=        atlas needs to be built with WITH_STATICLIB for numpy
to function properly

; or

5) Use portupgrade for science/gnudatalanguage and math/py-numpy,
instead of portmaster, with  ALT_PKGDEP set to substitute
math/atlas-devel for math/atlas in pkgtools.conf; or
6) Put an +IGNOREME in directories for science/gnudatalanguage and
math/py-numpy as well as math/atlas, and update these ports by hand,
with make -C ... deinstall clean install ... ; or
7) (Ugly hack) Install math/atlas-devel, and then math/py-numpy, by
hand.  Thereafter, before each invocation of portmaster involving
math/py-numpy, edit that port's registration information, switching
it's math/atlas-related entries in +CONTENTS to math/atlas-devel.


More information about the freebsd-questions mailing list