From: prascle Date: Tue, 15 Nov 2005 20:36:26 +0000 (+0000) Subject: PR: merge from trunk tag mergeto_BR_UT_V310a2_15nov05 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aaaeb56d37e619499171ed4c474fa2454f0dd877;p=modules%2Fkernel.git PR: merge from trunk tag mergeto_BR_UT_V310a2_15nov05 --- diff --git a/bin/addToKillList.py b/bin/addToKillList.py index 2d26f6698..7764ba01a 100755 --- a/bin/addToKillList.py +++ b/bin/addToKillList.py @@ -29,7 +29,8 @@ def findFileDict(): def addToKillList(command_pid, command): my_port = findFileDict() - filedict=os.getenv("HOME")+'/'+os.getenv('USER')+"_"+str(my_port)+'_SALOME_pidict' + from killSalomeWithPort import getPiDict + filedict=getPiDict(my_port) try: fpid=open(filedict, 'r') process_ids=pickle.load(fpid) @@ -64,7 +65,8 @@ def addToKillList(command_pid, command): def killList(): my_port = findFileDict() - filedict=os.getenv("HOME")+'/'+os.getenv('USER')+"_"+str(my_port)+'_SALOME_pidict' + from killSalomeWithPort import getPiDict + filedict=getPiDict(my_port) try: fpid=open(filedict, 'r') process_ids=pickle.load(fpid) diff --git a/bin/killSalome.py b/bin/killSalome.py index 7ed1d6372..d03c8f98c 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -1,16 +1,16 @@ #!/usr/bin/env python -import os, string, sys +import os, string, sys, re -from killSalomeWithPort import killMyPort +from killSalomeWithPort import killMyPort, getPiDict def killAllPorts(): user = os.getenv('USER') + filedict = "^%s$"%(getPiDict('(\d*)',full=False)) + fnamere = re.compile(filedict) for file in os.listdir(os.getenv("HOME")): - l = string.split(file, "_") - if len(l) >= 4: - if file[:len(user)] == user: - if l[len(l)-2] == "SALOME" and l[len(l)-1] == "pidict": - killMyPort(l[len(l)-3]) + mo = re.match(fnamere,file) + if mo and len(mo.groups()): + killMyPort(mo.groups()[0]) pass if __name__ == "__main__": diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index e3fdea77e..7cc60a73d 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -1,9 +1,22 @@ #!/usr/bin/env python import os, sys, pickle, signal, commands +def getPiDict(port,appname='salome',full=True): + filedict = [] + filedict.append( os.getenv('USER') ) # user name + filedict.append( os.getenv('HOSTNAME') ) # host name + filedict.append( str(port) ) # port number + filedict.append( appname.upper() ) # application name + filedict.append( 'pidict' ) # constant part + + filedict = '_'.join(filedict) + if full: + filedict = os.getenv("HOME") + '/' + filedict + return filedict + ########## kills all salome processes with the given port ########## def killMyPort(port): - filedict=os.getenv("HOME")+'/'+os.getenv('USER')+"_"+port+'_SALOME_pidict' + filedict=getPiDict(port) found = 0 try: fpid=open(filedict, 'r') diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index f1bd606db..fa814742d 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -49,7 +49,7 @@ def version(): root_dir = os.environ.get( 'GUI_ROOT_DIR', root_dir ) # GUI_ROOT_DIR or KERNEL_ROOT_DIR or "" if both not found filename = root_dir+'/bin/salome/VERSION' str = open( filename, "r" ).readline() # str = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0" - match = re.search( r':\s+([\d\.]+)\s*$', str ) + match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', str ) if match : return match.group( 1 ) return '' diff --git a/bin/runSalome.py b/bin/runSalome.py index 09ba5b958..311dc45ed 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -673,12 +673,10 @@ def useSalome(args, modules_list, modules_root_dir): print "--- erreur au lancement Salome ---" #print process_id - -# filedict = '/tmp/' + os.getenv('USER') + "_" + str(args['port']) \ -# + '_' + args['appname'].upper() + '_pidict' -# replaced args['appname'] by "SALOME" because in killSalome.py use of 'SALOME' in file name is hardcoded. - filedict = os.getenv("HOME") + '/' + os.getenv('USER') + "_" + str(args['port']) \ - + '_' + 'SALOME' + '_pidict' + + from killSalomeWithPort import getPiDict + filedict = getPiDict(args['port']) + process_ids = [] try: fpid=open(filedict, 'r') diff --git a/doc/SALOME_Application.txt b/doc/SALOME_Application.txt index 1133e1e62..ef4205242 100644 --- a/doc/SALOME_Application.txt +++ b/doc/SALOME_Application.txt @@ -71,7 +71,13 @@ application directory with the given path in parameter. ${APPLI} is a path relative to ${HOME}. The directory is only a skeleton, the user has to edit several files to -configure his own application. +configure his own application. These files are described after, the list is: + +- env.d/atFirst.sh +- env.d/envProducts.sh +- env.d/envSalome.sh +- CatalogResources.xml +- SalomeApp.xml Directory ${APPLI} must be created on each computer of the application. The easiest way is to use the same relative path (to ${HOME}) on each computer. @@ -87,10 +93,11 @@ The script ${APPLI}/envd sources **all** the files in ${APPLI}/env.d in alphanumeric order (after edition, think to remove backup files). the envd script is used by run scripts. + 2.1 Proposal for env.d scripts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Each user can define his own configuration for these scripts, following the -above rules. The following is only a proposal. +Each user **must define** his own configuration for these scripts, following +the above rules. **The following is only an example not working as it is**. atFirst.sh Sets the computer configuration not directly related to SALOME, @@ -102,6 +109,14 @@ envProducts.sh envSALOME.sh Sets all the MODULE_ROOT_DIR that can be used in the SALOME application. + SalomeAppConfig is also defined by:: + + export SalomeAppConfig=${HOME}/${APPLI} + + where SalomeAppConfig designates the directory containing SalomeApp.xml. + Note that ${APPLI} is already defined by the calling scripts when + envSALOME.sh is sourced. + 2.2 User run scripts ~~~~~~~~~~~~~~~~~~~~ diff --git a/salome_adm/unix/config_files/check_cas.m4 b/salome_adm/unix/config_files/check_cas.m4 index 99fd4be6b..345b13f48 100644 --- a/salome_adm/unix/config_files/check_cas.m4 +++ b/salome_adm/unix/config_files/check_cas.m4 @@ -31,9 +31,12 @@ AC_LANG_CPLUSPLUS AC_SUBST(CAS_CPPFLAGS) AC_SUBST(CAS_CXXFLAGS) AC_SUBST(CAS_KERNEL) +AC_SUBST(CAS_MATH) AC_SUBST(CAS_VIEWER) +AC_SUBST(CAS_TKTopAlgo) AC_SUBST(CAS_MODELER) AC_SUBST(CAS_OCAF) +AC_SUBST(CAS_OCAFVIS) AC_SUBST(CAS_DATAEXCHANGE) AC_SUBST(CAS_LDFLAGS) AC_SUBST(CAS_LDPATH) @@ -211,35 +214,25 @@ if test "x$occ_ok" = xno ; then AC_MSG_WARN(Opencascade libraries not found) else AC_MSG_RESULT(yes) - CAS_KERNEL="$CAS_LDPATH -lTKernel -lTKMath" + CAS_KERNEL="$CAS_LDPATH -lTKernel" + CAS_MATH="$CAS_LDPATH -lTKMath" - # E.A. compatibility version 4 and 5.x - CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKPShape -lTKCDF -lTKCAF -lTKShapeSchema -lTKPCAF -lFWOSPlugin -lTKStdSchema" - if test $OCC_VERSION_MAJOR -lt 5 ; then - CAS_OCAF="$CAS_OCAF -lTKPAppStd" - fi - if test -f $CASROOT/$casdir/lib/libPAppStdPlugin.so ; then - # this library is absent in CASCADE 5.2.3 - CAS_OCAF="$CAS_OCAF -lPAppStdPlugin" - CAS_STDPLUGIN="PAppStdPlugin" - fi - if test -f $CASROOT/$casdir/lib/libStdPlugin.so ; then - # this libraries are only for CASCADE 5.2.3 - CAS_STDPLUGIN="StdPlugin" - CAS_OCAF="$CAS_OCAF -lStdPlugin -lStdLPlugin -lTKLCAF -lTKPLCAF -lTKStdLSchema" - fi + CAS_OCAF="$CAS_LDPATH -lTKernel -lTKCDF -lTKLCAF" + CAS_OCAFVIS="$CAS_LDPATH -lTKCAF -lStdPlugin" - CAS_VIEWER="$CAS_LDPATH -lTKOpenGl -lTKV3d -lTKService" - CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBO -lTKBool -lTKHLR -lTKFillet -lTKOffset -lTKFeat" + CAS_TKV3d="$CAS_LDPATH -lTKV3d" + CAS_VIEWER="$CAS_TKV3d -lTKService" - # E.A. compatibility version 4 and 5.x - CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing" - if test $OCC_VERSION_MAJOR -lt 5 ; then - CAS_DATAEXCHANGE="$CAS_DATAEXCHANGE -lTKShHealingStd" - fi + CAS_TKBRep="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep" + + CAS_TKTopAlgo="$CAS_TKBRep -lTKGeomAlgo -lTKTopAlgo" + CAS_TKPrim="$CAS_TKTopAlgo -lTKPrim" + + CAS_MODELER="$CAS_TKPrim -lTKBO -lTKBool -lTKHLR -lTKFillet -lTKOffset -lTKFeat" + CAS_DATAEXCHANGE="$CAS_LDPATH -lTKIGES -lTKSTEP" - CAS_LDFLAGS="$CAS_KERNEL $CAS_OCAF $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE" + CAS_LDFLAGS="$CAS_KERNEL $CAS_MATH $CAS_OCAF $CAS_OCAFVIS $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE" fi diff --git a/salome_adm/unix/make_commence.in b/salome_adm/unix/make_commence.in index 8cc3f4c46..acd9fc70a 100644 --- a/salome_adm/unix/make_commence.in +++ b/salome_adm/unix/make_commence.in @@ -134,7 +134,10 @@ OCC_CXXFLAGS=@CAS_CXXFLAGS@ #OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ #OCC_LIBS=@CAS_LDFLAGS@ CAS_KERNEL=@CAS_KERNEL@ +CAS_MATH=@CAS_MATH@ CAS_OCAF=@CAS_OCAF@ +CAS_OCAFVIS=@CAS_OCAFVIS@ +CAS_TKTopAlgo=@CAS_TKTopAlgo@ CAS_VIEWER=@CAS_VIEWER@ CAS_MODELER=@CAS_MODELER@ CAS_DATAEXCHANGE=@CAS_DATAEXCHANGE@ diff --git a/src/CASCatch/Makefile.in b/src/CASCatch/Makefile.in index f6e17c1e8..f3477a8a5 100644 --- a/src/CASCatch/Makefile.in +++ b/src/CASCatch/Makefile.in @@ -24,7 +24,7 @@ LIB_SRC = CASCatch_Failure.cxx \ CPPFLAGS += $(OCC_INCLUDES) CXXFLAGS += $(OCC_CXXFLAGS) -LDFLAGS+= $(CAS_KERNEL) +LDFLAGS+= $(CAS_KERNEL) $(CAS_MATH) @CONCLUDE@ diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 54577e068..3e5d386e5 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -220,7 +220,8 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) long ndim = hdf_dataset->nDim(); //Get number of dimesions hdf_size *dim = new hdf_size[ndim]; hdf_type type = hdf_dataset->GetType(); - int nbAttr = hdf_dataset->nAttributes(), j; + hdf_byte_order order = hdf_dataset->GetOrder(); + int nbAttr = hdf_dataset->nAttributes(); TCollection_AsciiString anIdent(ident, '\t'); TCollection_AsciiString anIdentChild(ident+1, '\t'); @@ -247,7 +248,8 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) delete dim; /*fprintf(fp, "%s%li:", anIdentChild.ToCString(), size);*/ - fprintf(fp, "%li:", size); +// fprintf(fp, "%li:", size); + fprintf(fp, "%li %i:", size, order); if (type == HDF_STRING) { char* val = new char[size]; @@ -507,6 +509,7 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) { char name[HDF_NAME_MAX_LEN+1]; hdf_type type; + hdf_byte_order order; int nbDim, nbAttr; long i, size; @@ -522,15 +525,22 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) sizeArray[i] = dim; } - HDFdataset* hdf_dataset = new HDFdataset(new_name, father,type, sizeArray, nbDim); + // order (2-d member) was not written in earlier versions + char tmp; + int nbRead = fscanf(fp, "%li %i%c", &size, &order, &tmp); + if ( nbRead < 2 ) { // fscanf stops before ":" + fscanf(fp, "%c", &tmp); + order = H5T_ORDER_NONE; + } + if ( type != HDF_FLOAT64 ) // use order only for FLOAT64 + order = H5T_ORDER_NONE; + + HDFdataset* hdf_dataset = new HDFdataset(new_name, father,type, sizeArray, nbDim, order); delete new_name; delete sizeArray; hdf_dataset->CreateOnDisk(); - char tmp; - fscanf(fp, "%li%c", &size, &tmp); - if (type == HDF_STRING) { char *val = new char[size+1]; fread(val, 1, size, fp); diff --git a/src/HDFPersist/HDFdataset.cc b/src/HDFPersist/HDFdataset.cc index 84a2f5ae6..789f6e1a6 100644 --- a/src/HDFPersist/HDFdataset.cc +++ b/src/HDFPersist/HDFdataset.cc @@ -44,7 +44,7 @@ herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data) } HDFdataset::HDFdataset(char *name, HDFcontainerObject *father,hdf_type type, - hdf_size dim[], int dimsize) + hdf_size dim[], int dimsize, hdf_byte_order order) : HDFinternalObject(name) { int i; @@ -55,6 +55,7 @@ HDFdataset::HDFdataset(char *name, HDFcontainerObject *father,hdf_type type, _type = type; _ndim = dimsize; _dim = new hdf_size[dimsize]; + _byte_order = order; _size = 1; _attribute = NULL; for (i=0;iComponentIOR(ior)) return false; + if(!Handle(SALOMEDSImpl_SComponent)::DownCast(_impl)->ComponentIOR(ior)) { + IOR = CORBA::string_dup(""); + return false; + } IOR = CORBA::string_dup(ior.ToCString()); return true; } diff --git a/src/SALOMEDSImpl/Makefile.in b/src/SALOMEDSImpl/Makefile.in index de9c3e58b..fa73429a9 100644 --- a/src/SALOMEDSImpl/Makefile.in +++ b/src/SALOMEDSImpl/Makefile.in @@ -117,7 +117,7 @@ LIB_SRC = SALOMEDSImpl_Tool.cxx \ CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) CXXFLAGS+=$(OCC_CXXFLAGS) -LDFLAGS+= $(HDF5_LIBS) -lSalomeHDFPersist $(CAS_LDPATH) -lTKCAF -lTKBO -lTKLCAF -lTKMath -lTKStdSchema -lTKernel +LDFLAGS+= $(HDF5_LIBS) -lSalomeHDFPersist $(CAS_OCAF) # _CS_gbo_090604 Ajout Spécifique Calibre 3, pour l'utilisation de la version 5.12 de la bibliothèque OCC. # La bibliothèque OCC5.12 a été compilée sur Calibre 3 avec l'extention Xmu (impossible de compiler sans). diff --git a/src/TOOLSDS/Makefile.in b/src/TOOLSDS/Makefile.in index 866f491f1..1b41aefa7 100644 --- a/src/TOOLSDS/Makefile.in +++ b/src/TOOLSDS/Makefile.in @@ -29,7 +29,7 @@ BIN_CLIENT_IDL = CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) CXXFLAGS+=$(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) -LDFLAGS+= -lOpUtil $(CAS_LDPATH) -lTKernel +LDFLAGS+= -lOpUtil $(CAS_KERNEL) @CONCLUDE@