From a66b03a69e4472ccdffa9ce5531072c84727d6ce Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 14 Nov 2005 15:53:40 +0000 Subject: [PATCH] PR: merge from branch BR_OCC_For_3_1_0a3 tag mergeto_trunk_14nov05 --- bin/addToKillList.py | 6 ++- bin/killSalome.py | 14 +++---- bin/killSalomeWithPort.py | 15 +++++++- bin/launchConfigureParser.py | 2 +- bin/runSalome.py | 10 ++--- doc/SALOME_Application.txt | 4 ++ salome_adm/unix/config_files/check_cas.m4 | 41 +++++++++----------- salome_adm/unix/make_commence.in | 3 ++ src/CASCatch/Makefile.in | 2 +- src/HDFPersist/HDFascii.cc | 22 ++++++++--- src/HDFPersist/HDFdataset.cc | 14 ++++++- src/HDFPersist/HDFdataset.hxx | 4 +- src/HDFPersist/HDFdatasetCreate.c | 28 +++++++++++--- src/HDFPersist/HDFdatasetGetOrder.c | 46 +++++++++++++++++++++++ src/HDFPersist/HDFtypes.h | 1 + src/HDFPersist/Makefile.in | 4 +- src/HDFPersist/hdfi.h | 5 ++- src/SALOMEDS/Makefile.in | 4 +- src/SALOMEDS/SALOMEDS_SComponent_i.cxx | 5 ++- src/SALOMEDSImpl/Makefile.in | 2 +- src/TOOLSDS/Makefile.in | 2 +- 21 files changed, 169 insertions(+), 65 deletions(-) create mode 100644 src/HDFPersist/HDFdatasetGetOrder.c 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 0827efa50..6e7b0938e 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -660,12 +660,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..de671066c 100644 --- a/doc/SALOME_Application.txt +++ b/doc/SALOME_Application.txt @@ -73,6 +73,8 @@ relative to ${HOME}. The directory is only a skeleton, the user has to edit several files to configure his own application. +---- Liste des fichiers a modifier + 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. (Sometimes it is not possible to use the same path everywhere, for instance @@ -87,6 +89,7 @@ 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 @@ -101,6 +104,7 @@ envProducts.sh envSALOME.sh Sets all the MODULE_ROOT_DIR that can be used in the SALOME application. +SalomeAppConfig 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;i + +hdf_byte_order +HDFdatasetGetOrder(hdf_idt dataset_id) +{ + hdf_idt type_id; + hdf_byte_order order; + + if ((type_id = H5Dget_type(dataset_id)) < 0) + return -1; + + order = H5Tget_order(type_id); + + H5Tclose(type_id); + + return order; +} diff --git a/src/HDFPersist/HDFtypes.h b/src/HDFPersist/HDFtypes.h index b1e54e293..34855308e 100644 --- a/src/HDFPersist/HDFtypes.h +++ b/src/HDFPersist/HDFtypes.h @@ -41,6 +41,7 @@ typedef hsize_t hdf_size; typedef hid_t hdf_idt; typedef herr_t hdf_err; typedef hbool_t hdf_bool; +typedef H5T_order_t hdf_byte_order; typedef int hdf_int32; typedef long hdf_int64; diff --git a/src/HDFPersist/Makefile.in b/src/HDFPersist/Makefile.in index 6fe8916d2..b3d95e0c3 100644 --- a/src/HDFPersist/Makefile.in +++ b/src/HDFPersist/Makefile.in @@ -71,6 +71,7 @@ LIB_SRC = \ HDFdatasetGetSize.c \ HDFdatasetGetType.c \ HDFdatasetGetnDim.c \ + HDFdatasetGetOrder.c \ HDFattrOpen.c \ HDFattrClose.c \ HDFattrWrite.c \ @@ -96,7 +97,6 @@ LIB_SRC = \ #BIN = test9 test8 CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) -DPCLINUX -LDFLAGS+= $(CAS_LDPATH) -lTKernel $(HDF5_LIBS) - +LDFLAGS+= $(CAS_KERNEL) $(HDF5_LIBS) @CONCLUDE@ diff --git a/src/HDFPersist/hdfi.h b/src/HDFPersist/hdfi.h index e1810953d..dec0560df 100644 --- a/src/HDFPersist/hdfi.h +++ b/src/HDFPersist/hdfi.h @@ -67,7 +67,7 @@ hdf_err HDFdatasetClose(hdf_idt id); extern hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type, - hdf_size *dimd, int ndim); + hdf_size *dimd, int ndim, hdf_byte_order order); extern hdf_err HDFdatasetWrite(hdf_idt id, void *val); @@ -87,6 +87,9 @@ hdf_err HDFdatasetGetDim(hdf_idt id,hdf_size dim[]); extern int HDFdatasetGetSize(hdf_idt id); +extern +hdf_byte_order HDFdatasetGetOrder(hdf_idt id); + /* Attribute interface */ extern hdf_idt HDFattrOpen(hdf_idt pid,char *name); diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index fc2714c18..96fb1ae2a 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -119,7 +119,7 @@ BIN_CLIENT_IDL = CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) CXXFLAGS+=$(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) -LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace -lSalomeDSImpl -lSalomeGenericObj $(CAS_LDPATH) -lTKernel -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA +LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace -lSalomeDSImpl -lSalomeGenericObj $(CAS_KERNEL) -lSalomeGenericObj -lSalomeLifeCycleCORBA # _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). @@ -134,7 +134,7 @@ LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOME # LDXMUFLAGS= -L/usr/X11R6/lib -lXmu LDFLAGS+=$(LDXMUFLAGS) -LDFLAGSFORBIN= $(LDFLAGS) -lTKLCAF -lTKMath -lRegistry -lSalomeNotification -lSalomeContainer -lSalomeResourcesManager -lSALOMEBasics +LDFLAGSFORBIN= $(LDFLAGS) $(CAS_OCAF) -lRegistry -lSalomeNotification -lSalomeContainer -lSalomeResourcesManager -lSALOMEBasics @CONCLUDE@ diff --git a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx index 01f0b62e6..85d0d8747 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx @@ -72,7 +72,10 @@ CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR) { SALOMEDS::Locker lock; TCollection_AsciiString ior; - if(!Handle(SALOMEDSImpl_SComponent)::DownCast(_impl)->ComponentIOR(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@ -- 2.39.2