marbl / metAMOS

A metagenomic and isolate assembly and analysis pipeline built with AMOS
http://marbl.github.io/metAMOS
Other
93 stars 45 forks source link

INSTALL.py cannot determine gcc version #216

Closed izaakm closed 9 years ago

izaakm commented 9 years ago

During installation, I get this message: "Warning: cannot determine gcc version"

When I search "INSTALL.py", this error message is on line 119.

113try:
114   GCC_VERSION=float(utils.getCommandOutput("gcc --version|grep gcc|awk '{print $NF}' |awk -F \".\" '{print $1\".\"$2}'", False))
115except:
116   try:
117      GCC_VERSION=float(utils.getCommandOutput("gcc --version|grep gcc|awk '{print $3}' |awk -F \".\" '{print $1\".\"$2}'", False))
118   except:
119      print "Warning: cannot determine GCC version"

Running just gcc --version:

gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012]
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Running gcc --version|grep gcc|awk '{print $3}' returns:

Linux)

I'm not sure how to robustly pull the version number out of this line across various installations.

skoren commented 9 years ago

I don't think there is a universal way to pull out the version. The code has the fallthrough for two cases ($NF, $3) so you can just add one for your version.

GCC_VERSION=0.0
try:
   GCC_VERSION=float(utils.getCommandOutput("gcc --version|grep gcc|awk '{print $NF}' |awk -F \".\" '{print $1\".\"$2}'", False))
except:
   try:
      GCC_VERSION=float(utils.getCommandOutput("gcc --version|grep gcc|awk '{print $3}' |awk -F \".\" '{print $1\".\"$2}'", False))
   except:
      try:
         GCC_VERSION=float(utils.getCommandOutput("gcc --version|grep gcc|awk '{print $4}' |awk -F \".\" '{print $1\".\"$2}'", False))
      except:
         print "Warning: cannot determine GCC version"

That should work on your system. I'll update the code as well.

izaakm commented 9 years ago

Solved.