dist-hook:
rm -rf `find $(distdir)/appliskel -name CVS`
-DISTCLEANFILES = $(top_builddir)/bin/@PACKAGE@/Makefile.am
+DISTCLEANFILES = $(top_builddir)/bin/salome/Makefile.am
clean-local:
- rm -rf $(top_builddir)/bin/@PACKAGE@/appliskel
- cd $(top_builddir)/bin/@PACKAGE@; \
+ rm -rf $(top_builddir)/bin/salome/appliskel
+ cd $(top_builddir)/bin/salome; \
rm -f $(dist_salomescript_DATA) $(dist_salomescript_SCRIPTS)
# This is an ugly target to avoid exploring the appliskel subdirectory.
install-exec-local:
- $(INSTALL) -d $(salomescriptdir)
- $(RM) -rf $(salomescriptdir)/appliskel 1> /dev/null 2>&1
- cp -r $(srcdir)/appliskel $(salomescriptdir)
- find $(salomescriptdir) -name CVS -prune -exec rm -rf {} \;
+ $(INSTALL) -d $(DESTDIR)$(salomescriptdir)
+ $(RM) -rf $(DESTDIR)$(salomescriptdir)/appliskel 1> /dev/null 2>&1
+ cp -r $(srcdir)/appliskel $(DESTDIR)$(salomescriptdir)
+ find $(DESTDIR)$(salomescriptdir) -name CVS -prune -exec rm -rf {} \;
uninstall-local:
- find $(salomescriptdir)/appliskel -exec chmod +w {} \;
- rm -rf $(salomescriptdir)/appliskel
+ if test -d $(DESTDIR)$(salomescriptdir)/appliskel; then \
+ find $(DESTDIR)$(salomescriptdir)/appliskel -exec chmod +w {} ';' ; \
+ rm -rf $(DESTDIR)$(salomescriptdir)/appliskel; \
+ fi;
+
#
#clean appli
-rm -rf bin lib share doc env.d envd setAppliPath.sh searchFreePort.sh runAppli runConsole runSession runRemote.sh runTests SalomeApp.xml *.pyc *~ .bashrc
+rm -rf bin lib share doc env.d envd getAppliPath.py searchFreePort.sh runAppli runConsole runSession runRemote.sh runTests SalomeApp.xml *.pyc *~ .bashrc
appliskel_dir=os.path.join(home_dir,'bin','salome','appliskel')
for fn in ('envd',
- 'setAppliPath.sh',
+ 'getAppliPath.py',
'searchFreePort.sh',
'runRemote.sh',
'runAppli',
'runTests',
'.bashrc',
):
- virtual_salome.symlink(os.path.join(appliskel_dir, fn),os.path.join(home_dir, fn))
+ virtual_salome.symlink("./bin/salome/appliskel/"+fn,os.path.join(home_dir, fn))
pass
if filename != os.path.join(home_dir,"config_appli.xml"):
f =open(os.path.join(home_dir,'env.d','configSalome.sh'),'w')
for module in _config["modules"]:
- command='export '+ module + '_ROOT_DIR=' + home_dir +'\n'
+ command='export '+ module + '_ROOT_DIR=${HOME}/${APPLI}\n'
f.write(command)
pass
if _config.has_key("samples_path"):
f =open(os.path.join(home_dir,'env.d','configGUI.sh'),'w')
- command = 'export SalomeAppConfig=' + home_dir +'\n'
+ command = 'export SalomeAppConfig=${HOME}/${APPLI}\n'
f.write(command)
- command = 'export SUITRoot=' + os.path.join(home_dir,'share','salome') +'\n'
+ command = 'export SUITRoot=${HOME}/${APPLI}/share/salome\n'
f.write(command)
f.write('export DISABLE_FPE=1\n')
f.write('export MMGT_REENTRANT=1\n')
APPLI_ROOT=`pwd`
# --- clean appli
-rm -rf bin lib share doc envd setAppliPath.sh searchFreePort.sh runAppli runConsole runSession env.d
+rm -rf bin lib share doc envd getAppliPath.py searchFreePort.sh runAppli runConsole runSession env.d
# --- install appli
mkdir -p env.d
ln -fs bin/salome/appliskel/envd .
-ln -fs bin/salome/appliskel/setAppliPath.sh .
+ln -fs bin/salome/appliskel/getAppliPath.py .
ln -fs bin/salome/appliskel/searchFreePort.sh .
ln -fs bin/salome/appliskel/runRemote.sh .
ln -fs bin/salome/appliskel/runAppli .
<!DOCTYPE ResourcesCatalog>
<resources>
- <machine
- protocol="ssh"
- nbOfNodes="1"
- mode="interactif"
- OS="LINUX"
- CPUFreqMHz="2800"
- userName="prascle"
- memInMB="1500"
- nbOfProcPerNode="2"
- alias="cli76cd"
- hostname="cli76cd" >
- </machine>
-
- <machine
- protocol="ssh"
- nbOfNodes="1"
- mode="interactif"
- OS="LINUX"
- CPUFreqMHz="2000"
- userName="prascle"
- memInMB="1000"
- nbOfProcPerNode="1"
- alias="cli76ce"
- hostname="cli76ce" >
- </machine>
+ <machine hostname="localhost" />
</resources>
envd
Sets SALOME application environment, envd is sourced by other scripts.
-setAppliPath.sh
+getAppliPath.py
Used by other scripts to define the Application Path.
searchFreePort.sh
--- /dev/null
+#!/usr/bin/env python
+
+import os
+
+def relpath(target, base):
+ """ Find relative path from base to target
+ if target== "/local/chris/appli" and base== "/local/chris" the result is appli
+ if target== /tmp/appli and base /local/chris the result is ../../tmp/appli
+ """
+ target=target.split(os.path.sep)
+ base=base.split(os.path.sep)
+ for i in xrange(len(base)):
+ if base[i] != target[i]:
+ i=i-1
+ #not in base
+ break
+ p=['..']*(len(base)-i-1)+target[i+1:]
+ if p == []:
+ return '.'
+ return os.path.join( *p )
+
+def set_var(VAR, strpath):
+ """Set VAR environment variable """
+ value = "%r" % strpath
+ shell = os.getenv('SHELL')
+ if shell and shell.endswith('csh'):
+ return "setenv %s %s" % (VAR, value)
+ else:
+ return "export %s=%s" % (VAR, value)
+
+
+applipath=relpath(os.path.abspath(os.path.dirname(__file__)),os.path.abspath(os.getenv('HOME')))
+
+#print set_var('APPLI', applipath)
+print applipath
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. `dirname $0`/setAppliPath.sh
+APPLI_HOME=`dirname $0`
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. ${APPLI_HOME}/setAppliPath.sh
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. ${APPLI_HOME}/setAppliPath.sh
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. `dirname $0`/setAppliPath.sh
+APPLI_HOME=`dirname $0`
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. ${APPLI_HOME}/setAppliPath.sh
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-. `dirname $0`/setAppliPath.sh
+APPLI_HOME=`dirname $0`
+export APPLI=`${APPLI_HOME}/getAppliPath.py`
# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
+++ /dev/null
-#!/bin/bash
-
-# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
-# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-# on sarge, "which" gives not allways the absolute path...
-
-comName=`which $0`
-aa=${comName:0:1}
-if test x$aa == x\/; then
- mycom=${comName}
-elif test x$aa == x\.; then
- mycom=${PWD}/${comName:2}
-else
- mycom=${PWD}/${comName}
-fi
-APPLI=`echo ${HOME} \`dirname $mycom\` | awk ' { print substr($2,length($1)+2) } '`
-#echo $APPLI
-export APPLI
# ================================================================
#
#AC_PREREQ(2.59)
-#AC_INIT(src)
-AC_INIT([Salome2 Project], [4.1.1], [paul.rascle@edf.fr], [salome])
+AC_INIT([Salome2 Project], [4.1.1], [paul.rascle@edf.fr], [SalomeKer])
# AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
# scripts such as config.guess, install-sh, ...
AM_INIT_AUTOMAKE([tar-pax])
#AC_CONFIG_HEADER([config.h])
-PACKAGE=salome
-AC_SUBST(PACKAGE)
-
-VERSION=4.1.1
XVERSION=0x040101
-AC_SUBST(VERSION)
AC_SUBST(XVERSION)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
check_fatal_error $basic_mandatory_products
echo
-corba_mandatory_products="omniORB_ok boost_ok libxml_ok"
+corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok libxml_ok"
if test x$corba_gen = xtrue; then
echo --- CORBA mandatory products - default configuration:
summary $corba_mandatory_products
summary $parallel_products
echo
-optional_products="cppunit_ok openpbs_ok lsf_ok"
+optional_products="cppunit_ok openpbs_ok lsf_ok numpy_ok"
echo --- Optional products:
echo [" These products are optional because the KERNEL functions"]
echo [" using them are built only if the products are detected."]
SUBDIRSTUI= tui
index_html:
- $(INSTALL) -d $(docdir);
+ $(INSTALL) -d $(DESTDIR)$(docdir);
usr_docs: index_html
list='$(SUBDIRSGUI)'; for subdir in $$list; do \
info_TEXINFOS = Batch.texi
install-data-local: html usr_docs
- cp -rp $(top_builddir)/doc/salome/Batch.html $(docdir)
+ cp -rp $(top_builddir)/doc/salome/Batch.html $(DESTDIR)$(docdir)
+uninstall-local:
+ rm -rf $(DESTDIR)$(docdir)/Batch.html
EXTRA_DIST= main.dox install.dox \
kernel_resources.dox kernel_services.dox \
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-EXTRA_DIST = KERNEL pythfilter.py
+EXTRA_DIST = pythfilter.py
dist-hook:
+ cp -rf $(srcdir)/KERNEL $(distdir)
+ if test -d "KERNEL"; then \
+ find "KERNEL" -name "*.*" -exec cp -rf {} $(distdir)/KERNEL ';' ; \
+ fi
rm -rf `find $(distdir) -name CVS`
-usr_docs:
+KERNEL/main.html:../main.dox
cp -fr $(srcdir)/KERNEL/* ./INPUT; \
cd ./INPUT; \
pwd; ls;\
fi; \
$(DOXYGEN) ./doxyuser1; \
cd ..;
-# $(INSTALL) -d $(docdir)/tui/KERNEL;
- cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir);
- cp -fr $(srcdir)/KERNEL/sources/ $(docdir);
- cp -fr KERNEL/[a-f]*.* $(docdir)
- cp -fr KERNEL/[g-l]*.* $(docdir)
- cp -fr KERNEL/[m-z]*.* $(docdir)
- cp -fr $(srcdir)/KERNEL/HTML/ $(docdir);
- cp -f $(srcdir)/pythfilter.py $(docdir);
- cp -fr $(srcdir)/KERNEL/exemple/ $(docdir);
-# cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL;
-# cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL;
-# cp -fr KERNEL $(docdir)/tui
-# cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL;
-# cp -f $(srcdir)/pythfilter.py $(docdir)/tui/KERNEL;
-# cp -fr $(srcdir)/KERNEL/exemple/ $(docdir)/tui/KERNEL;
+
+usr_docs:KERNEL/main.html
+ if test -d "KERNEL"; then b=; else b="$(srcdir)/"; fi; \
+ cp -fr $(srcdir)/KERNEL/sources/static/*.* $(DESTDIR)$(docdir); \
+ cp -fr $(srcdir)/KERNEL/sources/ $(DESTDIR)$(docdir); \
+ find $$b"KERNEL" -name "*.*" -exec cp -rf {} $(DESTDIR)$(docdir) ';' ; \
+ cp -fr $(srcdir)/KERNEL/HTML/ $(DESTDIR)$(docdir); \
+ cp -f $(srcdir)/pythfilter.py $(DESTDIR)$(docdir); \
+ cp -fr $(srcdir)/KERNEL/exemple/ $(DESTDIR)$(docdir);
+
+uninstall-local:
+ chmod +w $(DESTDIR)$(docdir)/sources
+ chmod +w $(DESTDIR)$(docdir)/sources/static
+ chmod +w $(DESTDIR)$(docdir)/HTML
+ chmod +w $(DESTDIR)$(docdir)/exemple
+ rm -rf $(DESTDIR)$(docdir)/pythfilter.py
+ find $(DESTDIR)$(docdir) -name "*.html" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.jpg" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.map" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.md5" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.png" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.gif" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.css" -type f -exec rm -rf {} \;
+ find $(DESTDIR)$(docdir) -name "*.js*" -type f -exec rm -rf {} \;
+ rm -rf $(DESTDIR)$(docdir)/sources
+ rm -rf $(DESTDIR)$(docdir)/HTML
+ rm -rf $(DESTDIR)$(docdir)/exemple
+ rm -rf $(DESTDIR)$(docdir)/*.in
dev_docs:
cp -fr $(srcdir)/KERNEL/* ./INPUT; \
@PACO_IDL@ -I $(srcdir):@PACOPATH@/idl $^ omniORB4 0
install-exec-local: $(IDL_FILES:%=$(top_srcdir)/idl/%)
- $(INSTALL) -d $(pkgpythondir)
+ $(INSTALL) -d $(DESTDIR)$(salomepythondir)
ls $^ | while read file; do \
- $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \
+ $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
# uninstall-local removes too much, but it works in distcheck
uninstall-local:
- rm -rf $(pkgpythondir)/*
+ rm -rf $(DESTDIR)$(salomepythondir)/*
mostlyclean-local:
-rm -f *.hh *.cc .depidl
LOCAL_INCLUDES=""
LOCAL_LIBS=""
+LOCAL_RLIBS=""
if test -z $HDF5HOME
then
LOCAL_LIBS=""
else
LOCAL_LIBS="-L$HDF5HOME/lib"
+ LOCAL_RLIBS="-R$HDF5HOME/lib"
fi
fi
if test "x$hdf5_ok" = "xyes"
then
HDF5_INCLUDES="$LOCAL_INCLUDES"
- HDF5_LIBS="$LOCAL_LIBS -lhdf5"
- HDF5_MT_LIBS="$LOCAL_LIBS -lhdf5"
+ HDF5_LIBS="$LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
+ HDF5_MT_LIBS="$LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
fi
AC_MSG_RESULT(for hdf5: $hdf5_ok)
AC_LANG_CPLUSPLUS
AC_PATH_PROG(OMNIORB_IDL, omniidl)
-if test "xOMNIORB_IDL" = "x"
+if test "x$OMNIORB_IDL" = "x"
then
omniORB_ok=no
AC_MSG_RESULT(omniORB binaries not in PATH variable)
fi
-dnl omniORB_ok=yes
-
if test "x$omniORB_ok" = "xyes"
then
if test "x$OMNIORB_LIB" = "x/usr/lib"
then
OMNIORB_LDFLAGS=""
+ OMNIORB_RFLAGS=""
else
OMNIORB_LDFLAGS="-L$OMNIORB_LIB"
+ OMNIORB_RFLAGS="-R$OMNIORB_LIB"
fi
LIBS_old=$LIBS
OMNIORB_LIBS="$OMNIORB_LIBS -lCOS${OMNIORB_VERSION}"
OMNIORB_LIBS="$OMNIORB_LIBS -lCOSDynamic${OMNIORB_VERSION}"
OMNIORB_LIBS="$OMNIORB_LIBS -lomnithread"
+ OMNIORB_LIBS="$OMNIORB_LIBS ${OMNIORB_RFLAGS}"
if test $OMNIORB_VERSION = 3 ; then
OMNIORB_LIBS="$OMNIORB_LIBS -ltcpwrapGK"
fi
then
OMNIORB_IDLCXXFLAGS="-Wba -nf -I${OMNIORB_ROOT}/idl"
- OMNIORB_IDLPYFLAGS_1='-bpython -p ${top_srcdir}/salome_adm/unix'
+ OMNIORB_IDLPYFLAGS_1='-bpython'
OMNIORB_IDLPYFLAGS_2=" -I${OMNIORB_ROOT}/idl"
OMNIORB_IDLPYFLAGS=${OMNIORB_IDLPYFLAGS_1}${OMNIORB_IDLPYFLAGS_2}
AC_REQUIRE([CHECK_PYTHON])dnl
swig_ok=yes
+numpy_ok=no
AC_ARG_WITH(swig,
[AC_HELP_STRING([--with-swig=EXEC],[swig executable])],
numpydir=`$PYTHON -c "import numpy;print numpy.get_include()" 2>/dev/null`
if test -d "$numpydir"; then
- SWIG_FLAGS="$SWIG_FLAGS -DWITH_NUMPY"
+ numpy_ok=yes
PYTHON_INCLUDES="$PYTHON_INCLUDES -I$numpydir"
AC_DEFINE([WITH_NUMPY], [], [Python has numpy extension])
fi
#
# Standard directory for installation
-salomeincludedir = $(includedir)/@PACKAGE@
-libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@
-bindir = $(prefix)/bin/@PACKAGE@
+salomeincludedir = $(includedir)/salome
+libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+bindir = $(prefix)/bin/salome
salomescriptdir = $(bindir)
+salomepythondir = $(pythondir)/salome
+salomepyexecdir = $(pyexecdir)/salome
+
# Directory for installing idl files
-salomeidldir = $(prefix)/idl/@PACKAGE@
+salomeidldir = $(prefix)/idl/salome
# Directory for installing resource files
-salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@
+salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@
# Directories for installing admin files
salomeadmdir = $(prefix)/salome_adm
salome4deprdir = $(salomeadmdir)/unix/config_files/DEPRECATED
# Shared modules installation directory
-sharedpkgpythondir =$(pkgpythondir)/shared_modules
+sharedpkgpythondir =$(salomepythondir)/shared_modules
# Documentation directory
-docdir = $(datadir)/doc/@PACKAGE@
+docdir = $(datadir)/doc/salome
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Batch
SWIG_SOURCES = libBatch_Swig.i libBatch_Swig_exception.i libBatch_Swig_typemap.i
-pkgpython_PYTHON = libBatch_Swig.py
-pkgpyexec_LTLIBRARIES = _libBatch_Swig.la
+salomepython_PYTHON = libBatch_Swig.py
+salomepyexec_LTLIBRARIES = _libBatch_Swig.la
_libBatch_Swig_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libBatch_Swig_la_CPPFLAGS = @PYTHON_INCLUDES@ -I$(srcdir) -I$(srcdir)/../Batch
_libBatch_Swig_la_LDFLAGS = -module
dist_salomescript_SCRIPTS = Batch_test.py
# You don't need to specify libBatch_Swig.py. It is automatically
-# installed by means of the swig target pkgpython_PYTHON.
+# installed by means of the swig target salomepython_PYTHON.
SWIG_SOURCES = libSALOME_Comm.i
-pkgpython_PYTHON = libSALOME_Comm.py
-pkgpyexec_LTLIBRARIES = _libSALOME_Comm.la
+salomepython_PYTHON = libSALOME_Comm.py
+salomepyexec_LTLIBRARIES = _libSALOME_Comm.la
_libSALOME_Comm_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libSALOME_Comm_la_CPPFLAGS =\
@PYTHON_INCLUDES@ \
# (see LifeCycleCORBA_SWIG for an example)
# It's not needed to specify libSALOME_Comm.py. It is
-# automaticaly installed through the swig target pkgpython_PYTHON.
+# automaticaly installed through the swig target salomepython_PYTHON.
_numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, finalize_removal))
- if (_toRemove_map[impl_name]) _toRemove_map.erase(impl_name);
- if (_library_map[impl_name])
+ if (_toRemove_map.count(impl_name) != 0) _toRemove_map.erase(impl_name);
+ if (_library_map.count(impl_name) != 0)
{
MESSAGE("Library " << impl_name << " already loaded");
_numInstanceMutex.unlock();
_numInstanceMutex.unlock();
return true;
}
- else
- {
- INFOS( "Can't load shared library: " << impl_name );
-#ifndef WNT
- INFOS("error dlopen: " << dlerror());
-#endif
- }
_numInstanceMutex.unlock();
// --- try import Python component
INFOS("Supervision Container does not support Python Component Engines");
return false;
}
- if (_library_map[aCompName])
+ if (_library_map.count(aCompName) != 0)
{
return true; // Python Component, already imported
}
"import_component",
"s",componentName);
int ret= PyInt_AsLong(result);
+ Py_XDECREF(result);
SCRUTE(ret);
Py_RELEASE_NEW_THREAD;
return true;
}
}
+ INFOS( "Impossible to load component: " << componentName );
+ INFOS( "Can't load shared library: " << impl_name );
+ INFOS( "Can't import Python module: " << componentName );
return false;
}
Engines::Component_var iobject = Engines::Component::_nil() ;
string aCompName = genericRegisterName;
- if (_library_map[aCompName]) // Python component
+ if (_library_map.count(aCompName) != 0) // Python component
{
if (_isSupervContainer)
{
#else
string impl_name = genericRegisterName +string("Engine.dll");
#endif
- void* handle = _library_map[impl_name];
- if ( !handle )
+ if (_library_map.count(impl_name) == 0)
{
- INFOS("shared library " << impl_name <<"must be loaded before instance");
+ INFOS("shared library " << impl_name <<" must be loaded before creating instance");
return Engines::Component::_nil() ;
}
else
{
+ void* handle = _library_map[impl_name];
iobject = createInstance(genericRegisterName,
handle,
studyId);
{
string aGenRegisterName = genericRegisterName;
string impl_name = componentLibraryName;
- void* handle = _library_map[impl_name];
- if ( !handle )
+ if (_library_map.count(impl_name) == 0)
{
- INFOS("shared library " << impl_name <<"must be loaded before instance");
+ INFOS("shared library " << impl_name <<" must be loaded before creating instance");
return Engines::Component::_nil() ;
}
else
{
// --- find a registered instance in naming service, or create
+ void* handle = _library_map[impl_name];
string component_registerBase =
_containerName + "/" + aGenRegisterName;
Engines::Component_var iobject = Engines::Component::_nil() ;
../Batch/libSalomeBatch.la \
$(top_builddir)/idl/libSalomeIDLKernel.la\
@MPI_LIBS@ \
- @CORBA_LIBS@
-
-# @PYTHON_LIBS@
+ @CORBA_LIBS@ \
+ $(PYTHON_LIBS)
#
# ===============================================================
@LDEXPDYNFLAGS@
libSalomeContainer_la_LIBADD =\
- $(PYTHON_LIBS) \
$(COMMON_LIBS)
if WITH_PACO_PARALLEL
SALOME_Container_CPPFLAGS =\
$(COMMON_CPPFLAGS)
-SALOME_Container_LDADD =\
+SALOME_Container_LDADD = \
libSalomeContainer.la \
- $(COMMON_LIBS) \
- ../Basics/libSALOMEBasics.la \
- ../Batch/libSalomeBatch.la
+ $(HDF5_LIBS) \
+ $(MPI_LIBS) \
+ $(CORBA_LIBS) \
+ $(PYTHON_LIBS)
SALOME_Container_LDFLAGS =\
-Xlinker -export-dynamic
TestSalome_file_LDADD =\
libSalomeContainer.la \
- $(COMMON_LIBS) \
- ../Basics/libSALOMEBasics.la
+ $(HDF5_LIBS) \
+ $(MPI_LIBS) \
+ $(CORBA_LIBS) \
+ $(PYTHON_LIBS)
self._numInstance = self._numInstance +1
instanceName = nameToRegister + "_inst_" + `self._numInstance`
- component=__import__(componentName)
- factory=getattr(component,componentName)
- comp_i=factory(self._orb, self._poa, self._this(), self._containerName,
- instanceName, nameToRegister)
+ component=__import__(componentName)
+ factory=getattr(component,componentName)
+ comp_i=factory(self._orb, self._poa, self._this(), self._containerName,
+ instanceName, nameToRegister)
MESSAGE( "SALOME_ContainerPy_i::instance : component created")
comp_o = comp_i._this()
ret=0
try:
if verbose(): print "try import ",componentName
- __import__(componentName)
+ module=__import__(componentName)
if verbose(): print "import ",componentName," successful"
ret=1
except:
@HDF5_INCLUDES@ \
@BOOST_CPPFLAGS@
-# This flag is used to resolve the dependencies of OCC libraries.
-LDXMUFLAGS = -L/usr/X11R6/lib@LIB_LOCATION_SUFFIX@ -lXmu
-
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS =\
../HDFPersist/libSalomeHDFPersist.la \
- @HDF5_LIBS@ \
- $(LDXMUFLAGS)
-
+ @HDF5_LIBS@
#
# ===============================================================
bin_PROGRAMS = testDF
testDF_SOURCES = testDF.cxx
testDF_CPPFLAGS = $(COMMON_CPPFLAGS)
-testDF_LDADD = libDF.la $(COMMON_LIBS)
+testDF_LDADD = ./libDF.la \
+ $(HDF5_LIBS)
#
AM_CFLAGS = -fexceptions
-pkgpython_PYTHON = calcium.py dsccalcium.py
-pkgpyexec_LTLIBRARIES = _calcium.la
-MY_SWIG_FLAGS= $(SWIG_FLAGS) -noexcept
+salomepython_PYTHON = calcium.py dsccalcium.py
+salomepyexec_LTLIBRARIES = _calcium.la
+MY_SWIG_FLAGS= $(SWIG_FLAGS) -noexcept -I$(top_srcdir)/src/DSC/DSC_User/Datastream/Calcium
SWIG_SRC=calcium.i
_calcium_la_SOURCES = calcium_wrap.cpp
_calcium_la_LDFLAGS = -module
_calcium_la_CXXFLAGS = $(PYTHON_INCLUDES) $(COMMON_CPPFLAGS)
+EXTRA_DIST=calcium_wrap.cpp calcium.i
+
calcium_wrap.cpp calcium.py:calcium.i
$(SWIG) $(MY_SWIG_FLAGS) -o calcium_wrap.cpp $<
%module(docstring=DOCSTRING) calcium
-%feature("autodoc", "0");
+%feature("autodoc", "1");
%{
//C++ Includes
// Raises BAD_PARAM if the Python object is not an object reference.
// If <hold_lock> is true, caller holds the Python interpreter lock.
-
- omniORBpyAPI();
- // Constructor for the singleton. Sets up the function pointers.
+ PyObject* (*handleCxxSystemException)(const CORBA::SystemException& ex);
+ // Sets the Python exception state to reflect the given C++ system
+ // exception. Always returns NULL. The caller must hold the Python
+ // interpreter lock.
};
omniORBpyAPI* api;
+#define OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS \
+catch (const CORBA::SystemException& ex) { \
+ return api->handleCxxSystemException(ex); \
+}
+
%}
%init
Py_DECREF(pyapi);
%}
+%include <exception.i>
%include "carrays.i"
%array_class(int, intArray);
%array_class(float, floatArray);
%array_class(double, doubleArray);
-#ifdef WITH_NUMPY
/*
* Most of this code is borrowed from numpy distribution
* The following code originally appeared in enthought/kiva/agg/src/numeric.i,
%{
+#ifdef WITH_NUMPY
+/* With Numpy */
#include <numpy/arrayobject.h>
+typedef PyArrayObject ArrayObject;
+
/* Macros to extract array attributes.
*/
#define is_array(a) ((a) && PyArray_Check((PyArrayObject *)a))
return success;
}
+#else
+/* Without Numpy */
+typedef PyObject ArrayObject;
+
+#endif
%}
-/* input typemap */
+/* input typemap
+ This typemap can be used for input array objects only.
+ It accepts swig carray objects or numpy contiguous or non contiguous objects.
+ In case of non-contiguous numpy object, it is converted (new object) into a contiguous numpy object
+ This new object is deleted after the call.
+*/
%define TYPEMAP_IN3(type,typecode)
%typemap(in) type* IN_ARRAY3
- (PyArrayObject* array=NULL, int is_new_object) {
+ (ArrayObject* array=NULL, int is_new_object) {
int size[1] = {-1};
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
{
+%#ifdef WITH_NUMPY
array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (type*) array->data;
+%#else
+ SWIG_exception(SWIG_TypeError, "type* expected");
+%#endif
}
}
%typemap(freearg) type* IN_ARRAY3 {
#undef TYPEMAP_IN3
-%apply int* IN_ARRAY3 {int *val};
-%apply float* IN_ARRAY3 {float *val};
-%apply double* IN_ARRAY3 {double *val};
+%apply int* IN_ARRAY3 {int *eval};
+%apply float* IN_ARRAY3 {float *eval};
+%apply double* IN_ARRAY3 {double *eval};
-/* inplace typemaps */
+/* inplace typemaps
+ This typemap can be used for input/output array objects.
+ It accepts swig carray objects or numpy contiguous objects.
+*/
%define TYPEMAP_INPLACE3(type,typecode)
-%typemap(in) type* INPLACE_ARRAY3 (PyArrayObject* temp=NULL) {
+%typemap(in) type* INPLACE_ARRAY3 (ArrayObject* temp=NULL) {
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
{
+%#ifdef WITH_NUMPY
temp = obj_to_array_no_conversion($input,typecode);
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (type*) temp->data;
+%#else
+ SWIG_exception(SWIG_TypeError, "type* expected");
+%#endif
}
}
%enddef
%apply float* INPLACE_ARRAY3 {float *lval};
%apply double* INPLACE_ARRAY3 {double *lval};
-#endif
%typemap(in) CORBA::Boolean
{
%exception {
try {
$action
- } catch(Engines::DSC::PortNotDefined& _e) {
+ }
+ catch(Engines::DSC::PortNotDefined& _e) {
PyErr_SetString(PyExc_ValueError,"Port not defined");
return NULL;
- } catch(Engines::DSC::PortNotConnected& _e) {
+ }
+ catch(Engines::DSC::PortNotConnected& _e) {
PyErr_SetString(PyExc_ValueError,"Port not connected");
return NULL;
- } catch(Engines::DSC::BadPortType& _e) {
+ }
+ catch(Engines::DSC::BadPortType& _e) {
PyErr_SetString(PyExc_ValueError,"Bad port type");
return NULL;
- } catch(...) {
+ }
+ catch (SALOME_Exception &e) {
+ PyErr_SetString(PyExc_RuntimeError,e.what());
+ return NULL;
+ }
+ catch (SALOME::SALOME_Exception &e) {
+ PyErr_SetString(PyExc_RuntimeError,e.details.text);
+ return NULL;
+ }
+ OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+ catch(...) {
PyErr_SetString(PyExc_ValueError,"Unknown exception");
return NULL;
}
extern "C" void create_calcium_port(Superv_Component_i* compo,char* name,char* type,char *mode,char* depend);
-#define CP_TEMPS 40
-#define CP_ITERATION 41
-#define CP_SEQUENTIEL 42
-#define CP_CONT 20
-#define CP_ARRET 21
+%ignore CPMESSAGE;
+%include "calciumP.h"
-int cp_cd(void *component,char *name);
+int cp_cd(Superv_Component_i *component,char *name);
-int cp_een(void *component,int dep,float t,int n,char *nom,int nval,int *eval);
-int cp_edb(void *component,int dep,double t,int n,char *nom,int nval,double *eval);
-int cp_ere(void *component,int dep,float t,int n,char *nom,int nval,float *eval);
-int cp_ecp(void *component,int dep,float t,int n,char *nom,int nval,float *eval);
-int cp_elo(void *component,int dep,float t,int n,char *nom,int nval,int *eval);
+int cp_een(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
+int cp_edb(Superv_Component_i *component,int dep,double t,int n,char *nom,int nval,double *eval);
+int cp_ere(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,float *eval);
+int cp_ecp(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,float *eval);
+int cp_elo(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
-int cp_len(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
-int cp_ldb(void *component,int dep,double *ti,double *tf,int *niter,char *nom,int nmax,int *nval,double *lval);
-int cp_lre(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
-int cp_lcp(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
-int cp_llo(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
+int cp_len(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
+int cp_ldb(Superv_Component_i *component,int dep,double *ti,double *tf,int *niter,char *nom,int nmax,int *nval,double *lval);
+int cp_lre(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
+int cp_lcp(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
+int cp_llo(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
-int cp_fin(void *component,int cp_end);
+int cp_fin(Superv_Component_i *component,int cp_end);
( dependencyType != CalciumTypes::SEQUENCE_DEPENDENCY ) )
throw CalciumException(CalciumTypes::CPITVR,
LOC(OSS()<<"Le mode de dépendance de la variable "
- << nomVar << " ne correspond pas au mode demandé."));
+ << nomVar << ": " << portDependencyType << " ne correspond pas au mode demandé: " << dependencyType));
if ( dependencyType == CalciumTypes::TIME_DEPENDENCY ) {
calciumP.h \
version.h \
calcium.hf
+
+EXTRA_DIST=fortoc.h
#
# ===============================================================
# Local definitions
test_DSC_Exception_CXXFLAGS = $(COMMON_CPPFLAGS)
-test_DSC_Exception_LDADD = $(top_builddir)/src/Utils/libOpUtil.la
+test_DSC_Exception_LDADD = $(top_builddir)/src/Utils/libOpUtil.la \
+ $(CORBA_LIBS)
SUBDIRS = Basic Datastream
include $(top_srcdir)/salome_adm/unix/make_common_starter.am
-# Scripts to be installed (pkgpython is an automake keyword for python targets)
-pkgpython_PYTHON = \
+# Scripts to be installed (salomepython is an automake keyword for python targets)
+salomepython_PYTHON = \
Help.py \
PyInterp.py \
salome.py \
../SALOMELocalTrace/libSALOMELocalTrace.la \
../Basics/libSALOMEBasics.la \
../Batch/libSalomeBatch.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
+ $(top_builddir)/idl/libSalomeIDLKernel.la \
@MPI_LIBS@ \
- @CORBA_LIBS@
- @LIBXML_LIBS@
-
-# @PYTHON_LIBS@
+ @CORBA_LIBS@ \
+ @LIBXML_LIBS@ \
+ @PYTHON_LIBS@
#
# ===============================================================
@LDEXPDYNFLAGS@
libSalomeLauncher_la_LIBADD =\
- $(PYTHON_LIBS) \
$(COMMON_LIBS)
SALOME_LauncherServer_LDADD =\
libSalomeLauncher.la \
- $(COMMON_LIBS) \
- ../Basics/libSALOMEBasics.la \
- ../Batch/libSalomeBatch.la
+ $(MPI_LIBS) \
+ $(CORBA_LIBS) \
+ $(LIBXML_LIBS) \
+ $(PYTHON_LIBS)
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../LifeCycleCORBA -I$(srcdir)/../Utils
SWIG_SOURCES = libSALOME_LifeCycleCORBA.i
-pkgpython_PYTHON = libSALOME_LifeCycleCORBA.py
-pkgpyexec_LTLIBRARIES = _libSALOME_LifeCycleCORBA.la
+salomepython_PYTHON = libSALOME_LifeCycleCORBA.py
+salomepyexec_LTLIBRARIES = _libSALOME_LifeCycleCORBA.la
_libSALOME_LifeCycleCORBA_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
_libSALOME_LifeCycleCORBA_la_CPPFLAGS =\
@PYTHON_INCLUDES@ \
TestLifeCycleCORBA.py
# It's not needed to specify libSALOME_LifeCycleCORBA.py. It is
-# automaticaly installed through the swig target pkgpython_PYTHON.
+# automaticaly installed through the swig target salomepython_PYTHON.
SALOME_ModuleCatalog_Server_LDADD =\
libSalomeCatalog.la \
- $(COMMON_LIBS) \
@CORBA_LIBS@
# SALOME_ModuleCatalog_Client
SALOME_ModuleCatalog_Client_LDADD =\
libSalomeCatalog.la \
- $(COMMON_LIBS) \
@CORBA_LIBS@
SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Notification
SWIG_SOURCES = NOTIFICATION.i
-pkgpython_PYTHON = libNOTIFICATION.py
-pkgpyexec_LTLIBRARIES = _libNOTIFICATION.la
+salomepython_PYTHON = libNOTIFICATION.py
+salomepyexec_LTLIBRARIES = _libNOTIFICATION.la
_libNOTIFICATION_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES) \
NOTIFICATION_Swig.cxx NOTIFICATION_Swig.hxx SALOME_NOTIFICATION_SWIG.hxx
_libNOTIFICATION_la_CPPFLAGS =\
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-# This flag is used to resolve the dependencies of OCC libraries.
-LDXMUFLAGS = -L/usr/X11R6/lib@LIB_LOCATION_SUFFIX@ -lXmu
-
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS =\
../TOOLSDS/libTOOLSDS.la \
../GenericObj/libSalomeGenericObj.la \
../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \
$(top_builddir)/idl/libSalomeIDLKernel.la\
- @HDF5_LIBS@ \
- $(LDXMUFLAGS)
+ @HDF5_LIBS@
#LDFLAGS+= -lSalomeGenericObj -lSalomeLifeCycleCORBA
SALOMEDS_Server_SOURCES = SALOMEDS_Server.cxx
SALOMEDS_Server_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Server_LDADD = libSalomeDS.la
+SALOMEDS_Server_LDADD = libSalomeDS.la \
+ $(HDF5_LIBS) $(CORBA_LIBS)
SALOMEDS_Client_SOURCES = SALOMEDS_Client.cxx
SALOMEDS_Client_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Client_LDADD = libSalomeDS.la
+SALOMEDS_Client_LDADD = libSalomeDS.la \
+ $(HDF5_LIBS) $(CORBA_LIBS)
bin_PROGRAMS = TestSALOMEDS
dist_TestSALOMEDS_SOURCES = TestSALOMEDS.cxx
TestSALOMEDS_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestSALOMEDS_LDADD = libSALOMEDSTest.la
+TestSALOMEDS_LDADD = libSALOMEDSTest.la \
+ $(CORBA_LIBS)
@HDF5_INCLUDES@ \
@BOOST_CPPFLAGS@
-# This flag is used to resolve the dependencies of OCC libraries.
-LDXMUFLAGS = -L/usr/X11R6/lib@LIB_LOCATION_SUFFIX@ -lXmu
-
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS =\
../HDFPersist/libSalomeHDFPersist.la \
../DF/libDF.la \
- @HDF5_LIBS@ \
- $(LDXMUFLAGS)
+ @HDF5_LIBS@
#
bin_PROGRAMS = testDS
testDS_SOURCES = testDS.cxx
testDS_CPPFLAGS = $(COMMON_CPPFLAGS)
-testDS_LDADD = libSalomeDSImpl.la $(COMMON_LIBS)
+testDS_LDADD = libSalomeDSImpl.la \
+ $(HDF5_LIBS)
bin_PROGRAMS = TestContainer TestLogger
TestContainer_SOURCES = TestContainer.cxx
TestContainer_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestContainer_LDADD = libSalomeTestComponentEngine.la
+TestContainer_LDADD = libSalomeTestComponentEngine.la \
+ $(CORBA_LIBS)
TestLogger_SOURCES = TestLogger.cxx
TestLogger_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestLogger_LDADD = libSalomeTestComponentEngine.la
+TestLogger_LDADD = libSalomeTestComponentEngine.la \
+ $(CORBA_LIBS)
libOpUtil_la_LIBADD = \
../SALOMELocalTrace/libSALOMELocalTrace.la \
- $(top_builddir)/idl/libSalomeIDLKernel.la\
+ $(top_builddir)/idl/libSalomeIDLKernel.la \
@CORBA_LIBS@
bin_PROGRAMS = TestUtils
TestUtils_SOURCES = TestUtils.cxx
TestUtils_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestUtils_LDADD = libUtilsTest.la $(COMMON_LIBS)
+TestUtils_LDADD = libUtilsTest.la $(CORBA_LIBS)
virtual void operator()(void){
typedef PortableServer::ServantBase TServant;
if(_PtrObjet){
- if(TServant* aServant = dynamic_cast<TServant*>(_PtrObjet)){
- std::cerr << "WARNING: automatic destruction for servant is no more used. It's too late in exit. Use explicit call" << std::endl;
+ if(dynamic_cast<TServant*>(_PtrObjet)){
+ // std::cerr << "WARNING: automatic destruction for servant is no more used. It's too late in exit. Use explicit call" << std::endl;
/*
+ if(TServant* aServant = dynamic_cast<TServant*>(_PtrObjet)){
PortableServer::POA_var aPOA = aServant->_default_POA();
PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant);
aPOA->deactivate_object(anObjectId.in());
{
if ( ! CORBA::is_nil( _orb ) )
{
- std::cerr << "WARNING: orb destroy is no more called at exit. Use explicit call." << std::endl;
+ MESSAGE("WARNING: orb destroy is no more called at exit. Use explicit call.");
//std::cerr << "appel _orb->destroy()" << std::endl;
/*
try {