]> SALOME platform Git repositories - tools/pvdeliv.git/commitdiff
Salome HOME
Initiate Python build script
authorCédric Aguerre <cedric.aguerre@edf.fr>
Thu, 28 Jan 2016 13:14:21 +0000 (14:14 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Thu, 28 Jan 2016 13:14:21 +0000 (14:14 +0100)
scripts/BuildSalomeMini.py [new file with mode: 0755]

diff --git a/scripts/BuildSalomeMini.py b/scripts/BuildSalomeMini.py
new file mode 100755 (executable)
index 0000000..3621ba3
--- /dev/null
@@ -0,0 +1,459 @@
+#! /usr/bin/env python
+
+import os,subprocess,sys,re,datetime,shutil,glob
+
+rootDir="SalomeMini"
+cmakeLoc="/home/H87074/salome/archives/cmake-3.0.2.tar.gz"
+pythonLoc="/home/H87074/salome/archives/Python-2.7.10.tgz"
+hdf5Loc="/home/H87074/salome/archives/hdf5-1.8.14.tar.gz"
+swigLoc="/home/H87074/salome/archives/swig-2.0.8.tar.gz"
+qtLoc="/home/H87074/salome/archives/qt-everywhere-opensource-src-5.5.1.tar.gz"
+medLoc="/home/H87074/salome/archives/med-3.2.0rc1.tar.bz2"
+medcouplingLoc=("https://git.salome-platform.org/gitpub/tools/medcoupling.git","0b7cacaa925")
+paraviewLoc=("https://github.com/Kitware/ParaView.git","v5.0.0")
+kernelLoc=("https://git.salome-platform.org/gitpub/modules/kernel.git","f64e49d2e163b9de96ea0")
+guiLoc=("https://git.salome-platform.org/gitpub/modules/gui.git","7397622d22624ab84dd52c68a2")
+paravisLoc=("https://git.salome-platform.org/gitpub/modules/paravis.git","574ac287ed7022000")
+
+#env PATH=/local00/home/H87074/TMP46/SalomeMiniForKW/install/cmake-3.0.2/bin:/local00/home/H87074/TMP46/SalomeMiniForKW/install/Python-2.7.10/bin:/local00/home/H87074/TMP46/SalomeMiniForKW/install/hdf5-1.8.14/bin:/local00/home/H87074/TMP46/SalomeMiniForKW/install/swig-2.0.8/bin:/local00/home/H87074/Tools/git_2.0.1_install/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games SWIG_LIB=/local00/home/H87074/TMP46/SalomeMiniForKW/install/swig-2.0.8/share/swig/2.0.8 LD_LIBRARY_PATH=/local00/home/H87074/TMP46/SalomeMiniForKW/install/Python-2.7.10/lib:/local00/home/H87074/TMP46/SalomeMiniForKW/install/hdf5-1.8.14/lib PYTHON_VERSION=2.7 HDF5HOME=/local00/home/H87074/TMP46/SalomeMiniForKW/install/hdf5-1.8.14 SWIG_ROOT_DIR=/local00/home/H87074/TMP46/SalomeMiniForKW/install/swig-2.0.8 PYTHONSTARTUP=/local00/home/H87074/TMP46/SalomeMiniForKW/install/Python-2.7.10/pythonrc.py:/netdata/H87074/.pythonrc PYTHONHOME=/local00/home/H87074/TMP46/SalomeMiniForKW/install/Python-2.7.10 PYTHON_INCLUDE=/local00/home/H87074/TMP46/SalomeMiniForKW/install/Python-2.7.10/include/python2.7 HDF5_DISABLE_VERSION_CHECK=1
+
+paraCompFlag="-j8"
+cfgOut="config_out.txt"
+cfgErr="config_err.txt"
+compOut="compile_out.txt"
+compErr="compile_err.txt"
+okFlag=".install_ok"
+
+def cmake_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  addEnv(envAcc,"PATH",pathAdd)
+  pass
+
+def python_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  ldPathAdd=[os.path.join(installDir,"lib")]
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  envAcc["PYTHONHOME"]=installDir
+  envAcc["PYTHONSTARTUP"]=os.path.join(installDir,"pythonrc.py")
+  envAcc["PYTHON_VERSION"]="2.7"
+  envAcc["PYTHON_INCLUDE"]=os.path.join(installDir,"include","python%s"%envAcc["PYTHON_VERSION"])
+  pass
+
+def hdf5_Environ(installDir,envAcc):
+  envAcc["HDF5HOME"]=installDir
+  envAcc["HDF5_DISABLE_VERSION_CHECK"]="1"
+  pathAdd=[os.path.join(installDir,"bin")]
+  ldPathAdd=[os.path.join(installDir,"lib")]
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  pass
+
+def swig_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  addEnv(envAcc,"PATH",pathAdd)
+  envAcc["SWIG_ROOT_DIR"]=installDir
+  envAcc["SWIG_LIB"]=os.path.join(installDir,"share","swig","2.0.8")
+  pass
+
+def qt_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  ldPathAdd=[os.path.join(installDir,"lib")]
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  envAcc["QTDIR"]=installDir
+  envAcc["QT_PLUGIN_PATH"]=os.path.join(installDir,"plugins")
+  pass
+
+def med_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  ldPathAdd=[os.path.join(installDir,"lib")]
+  pyPathAdd=[os.path.join(installDir,"lib","python2.7","site-packages")]
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  addEnv(envAcc,"PYTHONPATH",pyPathAdd)
+  envAcc["MED3HOME"]=installDir
+  pass
+
+def medcoupling_Environ(installDir,envAcc):
+  pathAdd=[os.path.join(installDir,"bin")]
+  ldPathAdd=[os.path.join(installDir,"lib")]
+  pyPathAdd=[os.path.join(installDir,"lib","python2.7","site-packages")]
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  addEnv(envAcc,"PYTHONPATH",pyPathAdd)
+  addEnv(envAcc,"PATH",pathAdd)
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  addEnv(envAcc,"PYTHONPATH",pyPathAdd)
+  envAcc["MEDCOUPLINGHOME"]=installDir
+  pass
+
+def paraview_Environ(installDir,envAcc):
+  pvversion="5.0"
+  envAcc["PVHOME"]=installDir
+  envAcc["PVVERSION"]=pvversion
+  pathAdd=[os.path.join(installDir,"bin")]
+  addEnv(envAcc,"PATH",pathAdd)
+  ldPathAdd=[os.path.join(installDir,"lib","paraview-%s"%pvversion)]
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  pyPathAdd =[os.path.join(installDir,"lib","paraview-%s"%pvversion,"site-packages")]
+  pyPathAdd+=[os.path.join(installDir,"lib","paraview-%s"%pvversion,"site-packages","vtk")]
+  pyPathAdd+=[os.path.join(installDir,"lib","paraview-%s"%pvversion,"site-packages","paraview","vtk")]
+  addEnv(envAcc,"PYTHONPATH",pyPathAdd)
+  pvPlgPathAdd=[os.path.join(installDir,"lib","paraview-%s"%pvversion)]
+  addEnv(envAcc,"PV_PLUGIN_PATH",pvPlgPathAdd)
+  pass
+
+def paravis_Environ(installDir,envAcc):
+  ldPathAdd=[os.path.join(installDir,"lib","salome")]
+  pvPlgPathAdd=[os.path.join(installDir,"lib","paraview")]
+  addEnv(envAcc,"LD_LIBRARY_PATH",ldPathAdd)
+  addEnv(envAcc,"PV_PLUGIN_PATH",pvPlgPathAdd)
+  pass
+
+####################
+
+def addEnv(dico,key,val):
+  if key not in dico.keys():
+    dico[key]=val
+  else:
+    dico[key]+=val
+
+class AutoChdir:
+    def __init__(self,dn):
+        os.chdir(dn)
+    def __del__(self):
+        os.chdir("..")
+
+def extractSrcFromArchive(srcLoc,srcDir,pattern):
+    tmpDir="tmp"
+    zz=AutoChdir(srcDir)
+    if os.path.exists(tmpDir):
+      assert(False)
+    os.mkdir(tmpDir)
+    srcDN=None
+    ret=None
+    myExt=os.path.splitext(srcLoc)[1]
+    if myExt in [".gz",".tgz",".bz2"]:
+        if myExt in [".gz",".tgz"]:
+          myCmd=["tar","xfz",srcLoc]
+        else:
+          myCmd=["tar","xfj",srcLoc]
+        p=subprocess.Popen(myCmd,cwd=tmpDir,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+        p.communicate()
+        assert(p.returncode==0)
+        #
+        li=os.listdir(tmpDir)
+        assert(len(li)==1)
+        li=filter(lambda x: pattern.lower() in x.lower(),li)
+        assert(len(li)==1)
+        unzipDir=os.path.join(tmpDir,li[0])
+        assert(os.path.isdir(unzipDir))
+        srcDN=os.path.basename(li[0])
+        ret=os.path.realpath(os.path.join(os.getcwd(),srcDN))
+        if os.path.exists(ret):
+          print("\"%s\" already exists : keep it as this !"%ret)
+          shutil.rmtree(tmpDir)
+        else:
+          shutil.move(unzipDir,os.getcwd())
+          os.rmdir(tmpDir)
+        pass
+    else:
+        assert(False)
+    #for elt in os.listdir(os.getcwd()):
+    #    print datetime.date.fromtimestamp(os.stat(elt).st_ctime)
+    #    pass
+    return ret
+    
+def extractSrcFromGit(gitLoc,srcDir,pattern):
+    zz=AutoChdir(srcDir)
+    assert(isinstance(gitLoc,tuple))
+    assert(len(gitLoc)==2)
+    dirGitLoc=os.path.splitext(os.path.basename(gitLoc[0]))[0]
+    ret=os.path.realpath(os.path.join(os.getcwd(),dirGitLoc))
+    if not os.path.exists(dirGitLoc):
+      print("Cloning %s..."%dirGitLoc)
+      p=subprocess.Popen(["git","clone",gitLoc[0]],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p.communicate()
+      assert(p.returncode==0)
+    else:
+      assert(os.path.exists(os.path.join(dirGitLoc,".git")))
+    p=subprocess.Popen(["git","checkout",gitLoc[1]],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    p.communicate()
+    assert(p.returncode==0)
+    if dirGitLoc=="ParaView":
+      p=subprocess.Popen(["git","submodule","update","--init"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p.communicate()
+      assert(p.returncode==0)
+    return ret
+    
+  
+def extractSrc(srcDir,pattern):
+    srcLoc=eval("%sLoc"%pattern)
+    if isinstance(srcLoc,str):
+      return extractSrcFromArchive(srcLoc,srcDir,pattern)
+    elif isinstance(srcLoc,tuple):
+      return extractSrcFromGit(srcLoc,srcDir,pattern)
+    else:
+      raise Exception("Unrecognized localization of source : %s"%srcLoc)
+
+def computeEnv(envAcc,withDft=True):
+    import os,copy
+    if withDft:
+      d=copy.deepcopy(os.environ)
+      for k in os.environ.keys():
+        if k not in envAcc.keys():
+          del d[k]
+    else:
+      d={}
+    for k in envAcc.keys():
+      l=[]
+      if k in d.keys():
+        l=d[k].split(os.pathsep)
+      tmp=envAcc[k]
+      if not isinstance(tmp,list):
+        tmp=[tmp]
+      l=tmp+l
+      if k!="PYTHONSTARTUP":
+        d[k]=os.pathsep.join(l)
+      else:
+        d[k]=l[-1]
+    #
+    if "PATH" not in d.keys():
+      d["PATH"]=os.environ["PATH"]
+    return d
+
+def compilePart0(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild):
+    assert(os.path.isdir(srcDir))
+    baseName=os.path.basename(srcDir)
+    myBuildDir=os.path.realpath(os.path.join(topBuildDir,baseName))
+    myInstallDir=os.path.realpath(os.path.join(topInstallDir,baseName))
+    if os.path.exists(myBuildDir):
+        if forceRebuild:
+            shutil.rmtree(myBuildDir)
+        else:
+            if not os.path.exists(os.path.join(myBuildDir,okFlag)):
+              shutil.rmtree(myBuildDir)
+              os.mkdir(myBuildDir)
+            else:
+              print("For \"%s\" : Do nothing !"%srcDir)
+              return myBuildDir,myInstallDir,False
+    else:
+        os.mkdir(myBuildDir)
+    return myBuildDir,myInstallDir,True
+    
+def compilePart1(p,buildDir):
+    a,b=p.communicate()
+    f=file(os.path.join(buildDir,cfgOut),"w") ; f.write(a) ; f.flush()
+    f=file(os.path.join(buildDir,cfgErr),"w") ; f.write(b) ; f.flush()
+    assert(p.returncode==0)
+    
+def compilePart2(envAcc,buildDir,splitInstall):
+    print("make in %s"%(buildDir))
+    if not splitInstall:
+      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      a,b=p.communicate()
+      f=file(os.path.join(buildDir,compOut),"w") ; f.write(a) ; f.flush()
+      f=file(os.path.join(buildDir,compErr),"w") ; f.write(b) ; f.flush()
+      assert(p.returncode==0)
+    else:
+      p=subprocess.Popen(["make",paraCompFlag],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      a0,b0=p.communicate()
+      f=file(os.path.join(buildDir,compOut),"w") ; f.write(a0) ; f.flush()
+      f=file(os.path.join(buildDir,compErr),"w") ; f.write(b0) ; f.flush()
+      assert(p.returncode==0)
+      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      a1,b1=p.communicate()
+      f=file(os.path.join(buildDir,compOut),"w") ; f.write(a0+a1) ; f.flush()
+      f=file(os.path.join(buildDir,compErr),"w") ; f.write(b0+b1) ; f.flush()
+      assert(p.returncode==0)
+      pass
+    f=file(os.path.join(buildDir,okFlag),"w") ; f.write(str(datetime.datetime.now())) ; f.flush()
+    pass
+  
+def compileOldCommon(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild,splitInstall):
+    myBuildDir,myInstallDir,shouldContinue=compilePart0(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild)
+    if not shouldContinue:
+      return myInstallDir
+    myCmd=[os.path.join(srcDir,"configure"),"--prefix=%s"%(myInstallDir)]+addCfgParam
+    print(myCmd)
+    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    compilePart1(p,myBuildDir)
+    compilePart2(envAcc,myBuildDir,splitInstall)
+    return myInstallDir
+  
+def compileOld(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild):
+    return compileOldCommon(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild,False)
+    
+def compileVeryOld(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild):
+    return compileOldCommon(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild,True)
+    
+def compileNew(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild):
+    myBuildDir,myInstallDir,shouldContinue=compilePart0(envAcc,srcDir,topBuildDir,topInstallDir,addCfgParam,forceRebuild)
+    if not shouldContinue:
+      return myInstallDir
+    myCmd=["cmake","-DCMAKE_INSTALL_PREFIX=%s"%(myInstallDir)]+addCfgParam+[srcDir]
+    print(" ".join(myCmd))
+    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    compilePart1(p,myBuildDir)
+    compilePart2(envAcc,myBuildDir,False)
+    return myInstallDir
+    
+def accumulateEnv(installDir,pattern,envAcc):
+  """ envAcc out parameter"""
+  zeAccumulator=eval("%s_Environ"%pattern)
+  zeAccumulator(installDir,envAcc)
+  pass
+
+def generateInlineEnv(envAcc):
+  d=computeEnv(envAcc)
+  return "env "+" ".join(["%s=%s"%(k,d[k]) for k in d.keys()])
+  
+
+def generateFileEnv(envAcc):
+  d=computeEnv(envAcc)
+  return "\n".join(["export %s=\"%s\""%(k,d[k]) for k in d.keys()])
+
+def bidouilleForCMake(topSrcDir,guiSrcDir):
+  kernelFake="DUMMY_KERNEL"
+  zeKernelFake=os.path.join(topSrcDir,kernelFake)
+  if os.path.exists(zeKernelFake):
+    shutil.rmtree(zeKernelFake)
+  os.mkdir(zeKernelFake)
+  distDir=os.path.join(zeKernelFake,"salome_adm")
+  os.mkdir(distDir)
+  shutil.copytree(os.path.join(guiSrcDir,"adm_local","cmake_files"),os.path.join(distDir,"cmake_files"))
+  return os.path.abspath(zeKernelFake)
+  
+def copyCMakeFromSrcToInstall(srcDir,installDir):
+  zeSrcDir=os.path.join(srcDir,"cmake_files")
+  zeInstDir=os.path.join(installDir,"cmake_files")
+  for fi in glob.glob(os.path.join(zeSrcDir,"*.cmake")):
+    shutil.copy(fi,zeInstDir)
+
+def patchCMakeLists(topSrcDir,srcDir):
+  realSrcDirSrc=os.path.join(srcDir,'src','Plugins','MEDReader')
+  destReal=os.path.join(topSrcDir,'MEDReader')
+  if os.path.exists(destReal):
+      shutil.rmtree(destReal)
+  shutil.copytree(realSrcDirSrc,destReal)
+  linesToAdd0="""INCLUDE(UseQtExt)
+"""
+  linesToAdd1="""IF (NOT SALOME_GUI_BUILD_WITH_QT5)
+  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp)
+ELSE()
+  FIND_PACKAGE(SalomeQt5 REQUIRED)
+ENDIF()
+"""
+  #
+  cmakeToPatch=os.path.join(destReal,"CMakeLists.txt")
+  assert(os.path.exists(cmakeToPatch))
+  f=file(cmakeToPatch) ; lines=f.readlines()
+  pos0=filter(lambda (x,y): "INCLUDE(SalomeSetupPlatform)" in y,enumerate(lines))
+  assert(len(pos0)==1) ; pos0=pos0[0]
+  lines=lines[0:pos0[0]+1]+[linesToAdd0]+lines[pos0[0]+1:]
+  pos1=filter(lambda (x,y): "FIND_PACKAGE(SalomeMEDFile REQUIRED)" in y,enumerate(lines))
+  assert(len(pos1)==1) ; pos1=pos1[0]
+  lines=lines[0:pos1[0]+1]+[linesToAdd1]+lines[pos1[0]+1:]
+  f=file(cmakeToPatch,"w") ; f.writelines(lines)
+  return os.path.abspath(destReal)
+
+########### FINI LA PARLOTE !
+
+if not os.path.exists(rootDir):
+    os.mkdir(rootDir)
+
+zz=AutoChdir(rootDir)
+envAcc={}
+
+topSrcDir="src"
+topBuildDir="build"
+topInstallDir="install"
+for d in [topSrcDir,topBuildDir,topInstallDir]:
+    if not os.path.exists(d):
+        os.mkdir(d)
+
+#
+pattern="cmake"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileOld(envAcc,srcDir,topBuildDir,topInstallDir,[],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="python"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileOld(envAcc,srcDir,topBuildDir,topInstallDir,["--enable-shared","--enable-unicode=ucs4","-without-pymalloc"],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="hdf5"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileNew(envAcc,srcDir,topBuildDir,topInstallDir,
+  ['-DHDF5_BUILD_HL_LIB=ON','-DHDF5_BUILD_TOOLS=ON','-DBUILD_SHARED_LIBS=ON','-DHDF5_ENABLE_Z_LIB_SUPPORT=ON','-DCMAKE_BUILD_TYPE=Release'],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="swig"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileVeryOld(envAcc,srcDir,topBuildDir,topInstallDir,["--without-pcre","--without-octave"],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="qt"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileVeryOld(envAcc,srcDir,topBuildDir,topInstallDir,["-opensource","-confirm-license","-no-rpath","-qt-xcb"],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="med"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileOld(envAcc,srcDir,topBuildDir,topInstallDir,["--with-hdf5=%s"%(envAcc["HDF5HOME"]),"--enable-production"],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="medcoupling"
+srcDir=extractSrc(topSrcDir,pattern) ; medcouplingSrcDir=srcDir
+installDir=compileNew(envAcc,srcDir,topBuildDir,topInstallDir,
+  ["-DMEDFILE_ROOT_DIR=%s"%(envAcc["MED3HOME"]),"-DCMAKE_BUILD_TYPE=Debug","-DMEDCOUPLING_BUILD_DOC=OFF","-DMEDCOUPLING_BUILD_TESTS=OFF",
+   "-DMEDCOUPLING_PARTITIONER_METIS=OFF","-DMEDCOUPLING_ENABLE_RENUMBER=OFF","-DMEDCOUPLING_PARTITIONER_SCOTCH=OFF"],False)
+accumulateEnv(installDir,pattern,envAcc)
+#copyCMakeFromSrcToInstall(srcDir,installDir)#patch
+#
+pattern="paraview"
+srcDir=extractSrc(topSrcDir,pattern)
+installDir=compileNew(envAcc,srcDir,topBuildDir,topInstallDir,
+  ['-DPYTHON_ROOT_DIR=%s'%(envAcc["PYTHONHOME"]),'-DHDF5_ROOT_DIR=%s'%(envAcc["HDF5HOME"]),'-DPYTHON_EXECUTABLE=%s/bin/python%s'%(envAcc["PYTHONHOME"],envAcc["PYTHON_VERSION"]),
+   '-DPYTHON_INCLUDE_DIR=%s'%(envAcc["PYTHON_INCLUDE"]),'-DPYTHON_LIBRARY=%s/lib/libpython%s.so'%(envAcc["PYTHONHOME"],envAcc["PYTHON_VERSION"]),
+   '-DHDF5_LIBRARIES=%s/lib'%(envAcc["HDF5HOME"]),
+   '-DHDF5_INCLUDE_DIRS=%s/include'%(envAcc["HDF5HOME"]),'-DHDF5_CXX_COMPILER_EXECUTABLE=%s/bin/h5pcc'%(envAcc["HDF5HOME"]),
+   '-DHDF5_HL_INCLUDE_DIR=%s/include'%(envAcc["HDF5HOME"]),'-DHDF5_hdf5_hl_LIBRARY=%s/lib/libhdf5_hl.so'%(envAcc["HDF5HOME"]),
+   '-DHDF5_hdf5_hl_LIBRARY_RELEASE=%s/lib/libhdf5_hl.so'%(envAcc["HDF5HOME"]),'-DHDF5_hdf5_hl_LIBRARY_DEBUG=%s/lib/libhdf5_hl.so'%(envAcc["HDF5HOME"]),
+   '-DHDF5_HL_LIBRARY=%s/lib/libhdf5_hl.so'%(envAcc["HDF5HOME"]),'-DBUILD_SHARED_LIBS:BOOL=ON','-DCMAKE_BUILD_TYPE:STRING=Debug',
+   '-DPARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON','-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON','-DVTK_USE_64BIT_IDS:BOOL=OFF','-DPARAVIEW_BUILD_QT_GUI:BOOL=ON',
+   '-DVTK_QT_USE_WEBKIT:BOOL=ON','-DQT_TESTING_INSTALL_DEVELOPMENT:BOOL=ON','-DPARAVIEW_ENABLE_PYTHON:BOOL=ON','-DVTK_USE_SYSTEM_HDF5:BOOL=ON','-DVTK_USE_GL2PS:BOOL=ON',
+   '-DPARAVIEW_BUILD_PLUGIN_Moments:BOOL=OFF', '-DPARAVIEW_BUILD_PLUGIN_SierraPlotTools:BOOL=OFF', '-DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=OFF',
+   '-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON',
+   '-DVTK_NO_PYTHON_THREADS=OFF','-DPARAVIEW_ENABLE_CATALYST:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_ArrowGlyph:BOOL=OFF',
+   '-DPARAVIEW_BUILD_PLUGIN_CatalystScriptGeneratorPlugin:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_GMVReader:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_MobileRemoteControl:BOOL=OFF',
+   '-DPARAVIEW_BUILD_PLUGIN_NonOrthogonalSource:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_QuadView:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_PacMan:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_PrismPlugin:BOOL=OFF',
+   '-DPARAVIEW_BUILD_PLUGIN_RGBZView:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_SciberQuestToolKit:BOOL=OFF','-DPARAVIEW_BUILD_PLUGIN_StreamingParticles:BOOL=ON',
+   '-DPARAVIEW_BUILD_PLUGIN_UncertaintyRendering:BOOL=ON','-DPARAVIEW_ENABLE_MATPLOTLIB:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_ForceTime:BOOL=ON',
+   '-DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_PointSprite:BOOL=ON','-DPARAVIEW_BUILD_PLUGIN_SurfaceLIC:BOOL=ON',
+   '-DCMAKE_BUILD_QT_GUI:BOOL=ON','-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON','-DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON','-DPARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES:BOOL=OFF',
+   '-DBUILD_DOCUMENTATION:BOOL=ON','-DBUILD_EXAMPLES:BOOL=OFF','-DBUILD_TESTING:BOOL=OFF', '-DPARAVIEW_GENERATE_PROXY_DOCUMENTATION:BOOL=ON','-DVTK_NO_PYTHON_THREADS=OFF',
+   '-DVTK_PYTHON_FULL_THREADSAFE=ON','-DPARAVIEW_QT_VERSION=5','-DQT_HELP_GENERATOR=%s/bin/qhelpgenerator'%(envAcc["QTDIR"]),'-DVTK_BUILD_QT_DESIGNER_PLUGIN:BOOL=OFF','-DBUILD_DOCUMENTATION=OFF'],False)
+accumulateEnv(installDir,pattern,envAcc)
+#
+pattern="gui"
+srcDir=extractSrc(topSrcDir,pattern)
+fakeKernelDir=bidouilleForCMake(topSrcDir,srcDir)
+#
+pattern="paravis"# for MEDReader
+srcDir=extractSrc(topSrcDir,pattern)
+srcDir=patchCMakeLists(topSrcDir,srcDir)# change Reference for source
+installDir=compileNew(envAcc,srcDir,topBuildDir,topInstallDir,
+  ["-DMEDCOUPLING_ROOT_DIR=%s"%(envAcc["MEDCOUPLINGHOME"]),"-DKERNEL_ROOT_DIR=%s"%fakeKernelDir,
+  '-DPYTHON_ROOT_DIR=%s'%(envAcc["PYTHONHOME"]),'-DHDF5_ROOT_DIR=%s'%(envAcc["HDF5HOME"]),
+   '-DPYTHON_EXECUTABLE=%s/bin/python%s'%(envAcc["PYTHONHOME"],envAcc["PYTHON_VERSION"]),
+   '-DPYTHON_INCLUDE_DIR=%s'%(envAcc["PYTHON_INCLUDE"]),'-DPARAVIEW_QT_VERSION=5','-DQT_VERSION=5','-DSALOME_GUI_BUILD_WITH_QT5=ON','-DSALOME_INSTALL_SCRIPT_SCRIPTS=%s'%topInstallDir,
+   '-DPYTHON_LIBRARY=%s/lib/libpython%s.so'%(envAcc["PYTHONHOME"],envAcc["PYTHON_VERSION"])],False)
+accumulateEnv(installDir,pattern,envAcc)
+# END
+envFile=os.path.abspath(os.path.join(topInstallDir,"environment.sh"))
+f=file(envFile,"w")
+f.write(generateFileEnv(envAcc)) ; f.flush() ; del f
+print("Env file generated : %s"%envFile)