Ticket 713: Upgrade some package dependencies for CF-compatibility
authorAnders Henja <anders@henjab.se>
Wed, 20 Dec 2017 21:28:45 +0000 (22:28 +0100)
committerAnders Henja <anders@henjab.se>
Wed, 20 Dec 2017 21:28:45 +0000 (22:28 +0100)
bin/install.py
setup
src/node_versions.py
src/raveinstaller.py

index b1d38f0..3c0c5d8 100644 (file)
@@ -71,12 +71,12 @@ from experimental import experimental
 # so that HDF5 is rebuilt each time ZLIB is rebuilt.
 ##
 MODULES=[prepareinstaller(package("PREPARE", "1.0", nodir(), remembered=False)),
-         shinstaller(package("ZLIB", "1.2.4", nodir()),":"),
+         shinstaller(package("ZLIB", "1.2.11", nodir()),":"),
 
-         cmmi(package("HDF5", "1.8.5-patch1",
-                      untar(urlfetcher("hdf5-1.8.5-patch1.tar.gz"), "hdf5-1.8.5-patch1", True),
+         cmmi(package("HDF5", "1.10.1",
+                      untar(urlfetcher("hdf5-1.10.1.tar.gz"), "hdf5-1.10.1", True),
                       depends=["ZLIB"]),
-              "--prefix=\"$TPREFIX\" --with-pthread=yes --enable-threadsafe", False, True,
+              "--prefix=\"$TPREFIX\" --with-pthread=yes --enable-threadsafe --enable-unsupported", False, True,  # unsupported for MT + HL library
               foptionalarg=hdf5_optional_zlib_arg),
               
          cmmi(package("EXPAT", "2.0.1",
@@ -124,6 +124,7 @@ MODULES=[prepareinstaller(package("PREPARE", "1.0", nodir(), remembered=False)),
                              depends=["PYTHON","CURL"]),
                      "\"$TPREFIX/bin/python\" setup.py install",
                      osenv({"LD_LIBRARY_PATH":"$TPREFIX/lib", "PATH":"$TPREFIX/bin:$$PATH"})),
+         
 ]
 
 _PIP_MODULES=[
@@ -732,7 +733,26 @@ def parse_buildpsql_argument(arg):
     raise InstallerException, "Provided path (%s) does not seem to be be used as an lib path."%psqllib
   
   return psqlinc, psqllib
+
+def parse_netcdf_argument(arg):
+  tokens = arg.split(",")
+  if len(tokens) == 2:
+    netcdflinc = tokens[0]
+    netcdflib = tokens[1]
+  elif len(tokens) == 1:
+    netcdfinc = "%s/include"%tokens[0]
+    netcdflib = "%s/lib"%tokens[0]
+  else:
+    raise InstallerException, "--with-netcdf= should either be <inc>,<lib> or <root>"
   
+  if not os.path.isdir(netcdfinc):
+    raise InstallerException, "Provided path (%s) does not seem to be be used as an include path."%netcdfinc
+  if not os.path.isdir(netcdflib):
+    raise InstallerException, "Provided path (%s) does not seem to be be used as an lib path."%netcdflib
+  
+  return netcdfinc, netcdflib
+  
+
 if __name__=="__main__":
   import getpass
   optlist = []
@@ -748,7 +768,7 @@ if __name__=="__main__":
                                    'rave-pgf-port=', 'rave-log-port=', "rave-center-id=", "rave-dex-spoe=",
                                    'dbuser=', 'dbpwd=','dbname=','dbhost=','keystore=','nodename=',
                                    'reinstalldb','excludedb', 'runas=','datadir=','warfile=',
-                                   'urlrepo=','gitrepo=','offline',
+                                   'urlrepo=','gitrepo=','offline','with-netcdf=',
                                    'print-modules', 'print-config', 'exclude-tomcat', 'recall-last-args',
                                    'experimental','no-autostart','subsystems=',
                                    'force','tomcatport=','tomcaturl=','tomcatpwd=',
@@ -821,6 +841,8 @@ if __name__=="__main__":
         sys.exit(127)
       else:
         env.addArg("HDFJAVAHOME", a)
+    elif o == "--with-netcdf":
+      env.addArg("NETCDFARG", a)        
     elif o == "--with-freetype":
       env.addArg("FREETYPE", a)
     elif o == "--exclude-tomcat":
@@ -981,7 +1003,7 @@ if __name__=="__main__":
   env.addUniqueArg("RAVE_LOG_PORT", "8089")
   env.addUniqueArg("RAVE_CENTER_ID", "82")
   env.addUniqueArg("RAVE_DEX_SPOE", env.expandArgs("localhost:${TOMCATPORT}"))
-
+  
   modules = MODULES
   
   #
@@ -1077,6 +1099,11 @@ if __name__=="__main__":
     env.addArgInternal("PSQLINC", psqlinc)
     env.addArgInternal("PSQLLIB", psqllib)
 
+  if env.hasArg("NETCDFARG"):
+    netcdfinc, netcdflib = parse_netcdf_argument(env.getArg("NETCDFARG"))
+    env.addArgInternal("NETCDFINC", netcdfinc)
+    env.addArgInternal("NETCDFLIB", netcdflib)
+
   validators = []
   if "BDB" in subsystems or "DEX" in subsystems:
     validators.append(psqlvalidator())
diff --git a/setup b/setup
index 5d0872e..7750422 100755 (executable)
--- a/setup
+++ b/setup
@@ -27,20 +27,20 @@ SCRIPTPATH=$(dirname $(readlink -f $0))
 PACKAGEPATH=$SCRIPTPATH/packages
 
 PREFIX=/opt/baltrad
-EXPERIMENTAL=
+EXPERIMENTAL=yes
 ZLIBARG=
 URLREPO=http://git.baltrad.eu/blt_dependencies
 
-ZLIB_VERSION=1.2.4
-PYTHON_VERSION=2.6.4
-# PIP version used for python 2.6
-PIP_VERSION=1.0.2 
+ZLIB_VERSION=1.2.11
+PYTHON_VERSION=2.7.2
+PIP_VERSION=7.1.2
 # PIP version used for python 2.7
 PIP_VERSION_PY27=7.1.2
 DISTRIBUTE_VERSION=0.6.9
 
 SETUPTOOLS_VERSION=24.0.2
 
+ZLIB_REBUILT=no
 ZLIBINC=
 ZLIBLIB=
 BUILDZLIB=yes
@@ -108,6 +108,8 @@ bootstrap_python() {
   
   cd Python-$python_version || exit 127
   
+  make distclean > /dev/null
+  
   echo "configuring Python $python_version"
 
   if [ "$ZLIBINC" != "" ]; then
@@ -559,6 +561,7 @@ for arg in $*; do
     --with-bropo) ;;
     --with-beamb) ;;
     --with-bwrwp) ;;
+    --with-netcdf=*) ;;
     --bdb-port=*) ;;
     --bdb-uri=*) ;;
     --bdb-pool-max-size=*) ;;
@@ -640,10 +643,8 @@ if [ -z $TPREFIX ]; then
   TPREFIX=$PREFIX/third_party
 fi
 
-if [ -n "$EXPERIMENTAL" ]; then
-  PYTHON_VERSION=2.7.2
-  PIP_VERSION=$PIP_VERSION_PY27
-fi
+PYTHON_VERSION=2.7.2
+PIP_VERSION=$PIP_VERSION_PY27
 
 if [ -n "$ZLIBARG" ]; then
   # We have some options here.
@@ -689,14 +690,15 @@ fi
 if [ "$BUILDZLIB" = "yes" ]; then
   ZLIBINC=$TPREFIX/include
   ZLIBLIB=$TPREFIX/lib
-  if [ -f "$ZLIBINC/zlib.h" -a -f "$ZLIBLIB/libz.so" ]; then
+  if [ -f "$ZLIBINC/zlib.h" -a -f "$ZLIBLIB/libz.so" -a -f "$ZLIBLIB/libz.so.1.2.11" ]; then
     echo "ZLIB already installed"
   else
     bootstrap_zlib $TPREFIX $ZLIB_VERSION
+    ZLIB_REBUILT=yes
   fi
 fi
 
-if [ -f $PYTHON_EXECUTABLE ]; then
+if [ -f $PYTHON_EXECUTABLE -a "$ZLIB_REBUILT" = "no" ]; then
   echo "PYTHON already installed at $TPREFIX/bin/python"
 else
   bootstrap_python $TPREFIX $PYTHON_VERSION
index 496b765..77b07ef 100644 (file)
@@ -24,11 +24,11 @@ Actual versions for the different software modules that should be installed
 @date 2011-02-09
 '''
 versions = {
-  "HLHDF": "v0.8.5",
+  "HLHDF": "v0.8.7",
   "BALTRAD-DB": "jenkins-baltrad-db-406",
   "BEAST": "jenkins-Beast-369",
   "BALTRAD-DEX": "jenkins-BaltradDex-584",
-  "RAVE": "jenkins-Rave-593",
+  "RAVE": "jenkins-Rave-598",
   "RAVE-GMAP": "jenkins-GoogleMapsPlugin-37",
   "BROPO": "jenkins-bRopo-46",
   "BBUFR": "jenkins-bbufr-8",
index 0ac3e73..3f13b8d 100644 (file)
@@ -48,6 +48,7 @@ class raveinstaller(installer):
                     "CENTER_ID":"$RAVE_CENTER_ID",
                     "DEX_SPOE":"$RAVE_DEX_SPOE",
                     "BUFRARG":"",
+                    "NETCDFARG":"",
                     "DEX_PRIVATEKEY":"$PREFIX/etc/bltnode-keys/$NODENAME.priv",
                     "BDB_CONFIG_FILE":"$PREFIX/etc/bltnode.properties",
                     "DEX_NODENAME":"$NODENAME",
@@ -77,6 +78,9 @@ class raveinstaller(installer):
     if not env.isExcluded("BBUFR"):
       self.osenvironment().setEnvironmentVariable(env, "BUFRARG", "$PREFIX/bbufr")
     
+    if env.hasArg("NETCDFINC") and env.hasArg("NETCDFLIB"):
+      self.osenvironment().setEnvironmentVariable(env, "NETCDFARG", "%s,%s"%(env.getArg("NETCDFINC"),env.getArg("NETCDFLIB")))
+    
     self.osenvironment().setEnvironmentVariable(env, "LD_LIBRARY_PATH", "%s:%s"%(env.getLdLibraryPath(),self.osenvironment().getSnapshotVariable("LD_LIBRARY_PATH")))
     self.osenvironment().setEnvironmentVariable(env, "PATH", "%s:%s"%(env.getPath(),self.osenvironment().getSnapshotVariable("PATH")))