From 646eb73dbbab6713ea1f82fa977b0a0a1ad64517 Mon Sep 17 00:00:00 2001 From: caremoli Date: Mon, 4 Feb 2008 10:25:12 +0000 Subject: [PATCH] CCAR: modifications for make dist and make distcheck - change package name from salome to SalomeKer - add EXTRA_DIST for SWIG targets - change calcium.i to make it conditionnaly compilable (numpy) - add -R option for libtool (hdf and omniorb) - add optional product (numpy) in configure.ac - add mandatory product (omniORBpy) in configure.ac - add DESTDIR target in make install - change @PACKAGE@ in salome in most places - split install doc in 2 phases --- bin/Makefile.am | 21 ++-- configure.ac | 12 +- doc/salome/Makefile.am | 6 +- doc/salome/tui/Makefile.am | 51 ++++++--- idl/Makefile.am | 6 +- salome_adm/unix/config_files/check_hdf5.m4 | 6 +- salome_adm/unix/config_files/check_omniorb.m4 | 3 + salome_adm/unix/config_files/check_swig.m4 | 3 +- salome_adm/unix/make_common_starter.am | 17 +-- src/Batch_SWIG/Makefile.am | 6 +- src/Communication_SWIG/Makefile.am | 6 +- src/Container/Makefile.am | 21 ++-- src/DF/Makefile.am | 10 +- src/DSC/DSC_Python/Makefile.am | 8 +- src/DSC/DSC_Python/calcium.i | 108 ++++++++++++------ .../DSC_User/Datastream/Calcium/Makefile.am | 2 + src/DSC/DSC_User/Makefile.am | 3 +- src/KERNEL_PY/Makefile.am | 4 +- src/Launcher/Makefile.am | 17 ++- src/LifeCycleCORBA_SWIG/Makefile.am | 6 +- src/ModuleCatalog/Makefile.am | 2 - src/NOTIFICATION_SWIG/Makefile.am | 4 +- src/SALOMEDS/Makefile.am | 12 +- src/SALOMEDS/Test/Makefile.am | 3 +- src/SALOMEDSImpl/Makefile.am | 9 +- src/TestContainer/Makefile.am | 6 +- src/Utils/Makefile.am | 2 +- src/Utils/Test/Makefile.am | 2 +- src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx | 3 +- 29 files changed, 211 insertions(+), 148 deletions(-) diff --git a/bin/Makefile.am b/bin/Makefile.am index 2cf221ead..b8086e529 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -72,20 +72,23 @@ EXTRA_DIST = appliskel 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; + diff --git a/configure.ac b/configure.ac index cc389e952..730d4ae15 100644 --- a/configure.ac +++ b/configure.ac @@ -4,8 +4,7 @@ # ================================================================ # #AC_PREREQ(2.59) -#AC_INIT(src) -AC_INIT([Salome2 Project], [4.1.0], [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, ... @@ -15,12 +14,7 @@ AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([tar-pax]) #AC_CONFIG_HEADER([config.h]) -PACKAGE=salome -AC_SUBST(PACKAGE) - -VERSION=4.1.0 XVERSION=0x040100 -AC_SUBST(VERSION) AC_SUBST(XVERSION) # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) @@ -425,7 +419,7 @@ summary $basic_mandatory_products 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 @@ -447,7 +441,7 @@ echo --- Kernel parallel extensions: 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."] diff --git a/doc/salome/Makefile.am b/doc/salome/Makefile.am index 86089e1b9..9f43889c1 100644 --- a/doc/salome/Makefile.am +++ b/doc/salome/Makefile.am @@ -30,7 +30,7 @@ SUBDIRSGUI= tui SUBDIRSTUI= tui index_html: - $(INSTALL) -d $(docdir); + $(INSTALL) -d $(DESTDIR)$(docdir); usr_docs: index_html list='$(SUBDIRSGUI)'; for subdir in $$list; do \ @@ -48,7 +48,9 @@ dev_docs: index_html 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 \ diff --git a/doc/salome/tui/Makefile.am b/doc/salome/tui/Makefile.am index 9088dfa1c..794840fc4 100644 --- a/doc/salome/tui/Makefile.am +++ b/doc/salome/tui/Makefile.am @@ -25,12 +25,16 @@ 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;\ @@ -48,21 +52,34 @@ usr_docs: 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; \ diff --git a/idl/Makefile.am b/idl/Makefile.am index b046999d7..9ff37591d 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -235,14 +235,14 @@ SK.cc.hh: @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 diff --git a/salome_adm/unix/config_files/check_hdf5.m4 b/salome_adm/unix/config_files/check_hdf5.m4 index 4d200e8f3..9cc52b321 100644 --- a/salome_adm/unix/config_files/check_hdf5.m4 +++ b/salome_adm/unix/config_files/check_hdf5.m4 @@ -42,6 +42,7 @@ hdf5_ok=no LOCAL_INCLUDES="" LOCAL_LIBS="" +LOCAL_RLIBS="" if test -z $HDF5HOME then @@ -53,6 +54,7 @@ else LOCAL_LIBS="" else LOCAL_LIBS="-L$HDF5HOME/lib" + LOCAL_RLIBS="-R$HDF5HOME/lib" fi fi @@ -79,8 +81,8 @@ 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) diff --git a/salome_adm/unix/config_files/check_omniorb.m4 b/salome_adm/unix/config_files/check_omniorb.m4 index f82428747..aed2bcad4 100644 --- a/salome_adm/unix/config_files/check_omniorb.m4 +++ b/salome_adm/unix/config_files/check_omniorb.m4 @@ -108,8 +108,10 @@ 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 @@ -153,6 +155,7 @@ then 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 diff --git a/salome_adm/unix/config_files/check_swig.m4 b/salome_adm/unix/config_files/check_swig.m4 index 019755067..08668fb56 100644 --- a/salome_adm/unix/config_files/check_swig.m4 +++ b/salome_adm/unix/config_files/check_swig.m4 @@ -24,6 +24,7 @@ AC_DEFUN([CHECK_SWIG],[ AC_REQUIRE([CHECK_PYTHON])dnl swig_ok=yes +numpy_ok=no AC_ARG_WITH(swig, [AC_HELP_STRING([--with-swig=EXEC],[swig executable])], @@ -59,7 +60,7 @@ fi 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 diff --git a/salome_adm/unix/make_common_starter.am b/salome_adm/unix/make_common_starter.am index 258e057af..f54d8f4f2 100644 --- a/salome_adm/unix/make_common_starter.am +++ b/salome_adm/unix/make_common_starter.am @@ -7,16 +7,19 @@ # # 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 @@ -25,7 +28,7 @@ salomem4dir = $(salomeadmdir)/unix/config_files 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 diff --git a/src/Batch_SWIG/Makefile.am b/src/Batch_SWIG/Makefile.am index 71154d513..9fceccda1 100644 --- a/src/Batch_SWIG/Makefile.am +++ b/src/Batch_SWIG/Makefile.am @@ -55,8 +55,8 @@ BUILT_SOURCES = swig_wrap.cpp 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 @@ -83,4 +83,4 @@ CLEANFILES = swig_wrap.cpp 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. diff --git a/src/Communication_SWIG/Makefile.am b/src/Communication_SWIG/Makefile.am index 30907c8d4..9dd1946a5 100644 --- a/src/Communication_SWIG/Makefile.am +++ b/src/Communication_SWIG/Makefile.am @@ -56,8 +56,8 @@ SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir) -I$(srcdir)/../Communication 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@ \ @@ -97,4 +97,4 @@ CLEANFILES = swig_wrap.cpp # (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. diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index 409e9e0bb..a7cbd05da 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -91,9 +91,8 @@ COMMON_LIBS =\ ../Batch/libSalomeBatch.la \ $(top_builddir)/idl/libSalomeIDLKernel.la\ @MPI_LIBS@ \ - @CORBA_LIBS@ - -# @PYTHON_LIBS@ + @CORBA_LIBS@ \ + $(PYTHON_LIBS) # # =============================================================== @@ -118,7 +117,6 @@ libSalomeContainer_la_LDFLAGS =\ @LDEXPDYNFLAGS@ libSalomeContainer_la_LIBADD =\ - $(PYTHON_LIBS) \ $(COMMON_LIBS) if WITH_PACO_PARALLEL @@ -141,11 +139,12 @@ SALOME_Container_SOURCES =\ 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 @@ -158,5 +157,7 @@ TestSalome_file_CPPFLAGS =\ TestSalome_file_LDADD =\ libSalomeContainer.la \ - $(COMMON_LIBS) \ - ../Basics/libSALOMEBasics.la + $(HDF5_LIBS) \ + $(MPI_LIBS) \ + $(CORBA_LIBS) \ + $(PYTHON_LIBS) diff --git a/src/DF/Makefile.am b/src/DF/Makefile.am index 00dabed07..f06c02a41 100644 --- a/src/DF/Makefile.am +++ b/src/DF/Makefile.am @@ -51,15 +51,10 @@ COMMON_CPPFLAGS=\ @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@ # # =============================================================== @@ -95,5 +90,6 @@ libDF_la_LIBADD = $(COMMON_LIBS) bin_PROGRAMS = testDF testDF_SOURCES = testDF.cxx testDF_CPPFLAGS = $(COMMON_CPPFLAGS) -testDF_LDADD = libDF.la $(COMMON_LIBS) +testDF_LDADD = ./libDF.la \ + $(HDF5_LIBS) diff --git a/src/DSC/DSC_Python/Makefile.am b/src/DSC/DSC_Python/Makefile.am index a40629e79..d4f0d8e69 100644 --- a/src/DSC/DSC_Python/Makefile.am +++ b/src/DSC/DSC_Python/Makefile.am @@ -57,9 +57,9 @@ COMMON_LIBS = @CORBA_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 @@ -72,6 +72,8 @@ _calcium_la_LIBADD = ../DSC_User/Datastream/Calcium/libCalciumC.la \ _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 $< diff --git a/src/DSC/DSC_Python/calcium.i b/src/DSC/DSC_Python/calcium.i index 3d093153c..0deafca80 100644 --- a/src/DSC/DSC_Python/calcium.i +++ b/src/DSC/DSC_Python/calcium.i @@ -5,7 +5,7 @@ %module(docstring=DOCSTRING) calcium -%feature("autodoc", "0"); +%feature("autodoc", "1"); %{ //C++ Includes @@ -30,13 +30,19 @@ struct omniORBpyAPI { // Raises BAD_PARAM if the Python object is not an object reference. // If 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 @@ -59,13 +65,13 @@ struct omniORBpyAPI { Py_DECREF(pyapi); %} +%include %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, @@ -76,8 +82,12 @@ struct omniORBpyAPI { %{ +#ifdef WITH_NUMPY +/* With Numpy */ #include +typedef PyArrayObject ArrayObject; + /* Macros to extract array attributes. */ #define is_array(a) ((a) && PyArray_Check((PyArrayObject *)a)) @@ -320,18 +330,32 @@ int require_size(PyArrayObject* ary, int* size, int n) { 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 { @@ -345,19 +369,26 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) #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 @@ -372,7 +403,6 @@ TYPEMAP_INPLACE3(double, PyArray_DOUBLE) %apply float* INPLACE_ARRAY3 {float *lval}; %apply double* INPLACE_ARRAY3 {double *lval}; -#endif %typemap(in) CORBA::Boolean { @@ -435,16 +465,29 @@ TYPEMAP_INPLACE3(double, PyArray_DOUBLE) %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; } @@ -541,25 +584,22 @@ class PySupervCompo:public Superv_Component_i 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); diff --git a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am index 6f829cd01..f3d3fffb4 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am +++ b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am @@ -58,6 +58,8 @@ salomeinclude_HEADERS = calcium_port_factory.hxx \ calciumP.h \ version.h \ calcium.hf + +EXTRA_DIST=fortoc.h # # =============================================================== # Local definitions diff --git a/src/DSC/DSC_User/Makefile.am b/src/DSC/DSC_User/Makefile.am index 42c20a9c3..7db5294da 100644 --- a/src/DSC/DSC_User/Makefile.am +++ b/src/DSC/DSC_User/Makefile.am @@ -91,6 +91,7 @@ test_DSC_Exception_SOURCES = test_DSC_Exception.cxx 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 diff --git a/src/KERNEL_PY/Makefile.am b/src/KERNEL_PY/Makefile.am index bd5ab0a86..3b4e96641 100755 --- a/src/KERNEL_PY/Makefile.am +++ b/src/KERNEL_PY/Makefile.am @@ -25,8 +25,8 @@ 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 \ diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index b0323d754..a78dc3edb 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -84,12 +84,11 @@ COMMON_LIBS =\ ../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@ # # =============================================================== @@ -113,7 +112,6 @@ libSalomeLauncher_la_LDFLAGS =\ @LDEXPDYNFLAGS@ libSalomeLauncher_la_LIBADD =\ - $(PYTHON_LIBS) \ $(COMMON_LIBS) @@ -132,8 +130,9 @@ SALOME_LauncherServer_CPPFLAGS=\ SALOME_LauncherServer_LDADD =\ libSalomeLauncher.la \ - $(COMMON_LIBS) \ - ../Basics/libSALOMEBasics.la \ - ../Batch/libSalomeBatch.la + $(MPI_LIBS) \ + $(CORBA_LIBS) \ + $(LIBXML_LIBS) \ + $(PYTHON_LIBS) diff --git a/src/LifeCycleCORBA_SWIG/Makefile.am b/src/LifeCycleCORBA_SWIG/Makefile.am index b6e9dbebb..60f4b8305 100644 --- a/src/LifeCycleCORBA_SWIG/Makefile.am +++ b/src/LifeCycleCORBA_SWIG/Makefile.am @@ -55,8 +55,8 @@ BUILT_SOURCES = swig_wrap.cpp 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@ \ @@ -93,4 +93,4 @@ dist_salomescript_DATA =\ 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. diff --git a/src/ModuleCatalog/Makefile.am b/src/ModuleCatalog/Makefile.am index 83f138d3d..45dd39b49 100644 --- a/src/ModuleCatalog/Makefile.am +++ b/src/ModuleCatalog/Makefile.am @@ -103,7 +103,6 @@ SALOME_ModuleCatalog_Server_CPPFLAGS =\ SALOME_ModuleCatalog_Server_LDADD =\ libSalomeCatalog.la \ - $(COMMON_LIBS) \ @CORBA_LIBS@ # SALOME_ModuleCatalog_Client @@ -113,5 +112,4 @@ SALOME_ModuleCatalog_Client_CPPFLAGS =\ SALOME_ModuleCatalog_Client_LDADD =\ libSalomeCatalog.la \ - $(COMMON_LIBS) \ @CORBA_LIBS@ diff --git a/src/NOTIFICATION_SWIG/Makefile.am b/src/NOTIFICATION_SWIG/Makefile.am index 42f570e11..59f355d4b 100644 --- a/src/NOTIFICATION_SWIG/Makefile.am +++ b/src/NOTIFICATION_SWIG/Makefile.am @@ -40,8 +40,8 @@ BUILT_SOURCES = swig_wrap.cpp 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 =\ diff --git a/src/SALOMEDS/Makefile.am b/src/SALOMEDS/Makefile.am index 0d9bac30a..37686d204 100644 --- a/src/SALOMEDS/Makefile.am +++ b/src/SALOMEDS/Makefile.am @@ -71,9 +71,6 @@ COMMON_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 \ @@ -87,8 +84,7 @@ COMMON_LIBS =\ ../GenericObj/libSalomeGenericObj.la \ ../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \ $(top_builddir)/idl/libSalomeIDLKernel.la\ - @HDF5_LIBS@ \ - $(LDXMUFLAGS) + @HDF5_LIBS@ #LDFLAGS+= -lSalomeGenericObj -lSalomeLifeCycleCORBA @@ -288,8 +284,10 @@ bin_PROGRAMS = SALOMEDS_Server SALOMEDS_Client 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) diff --git a/src/SALOMEDS/Test/Makefile.am b/src/SALOMEDS/Test/Makefile.am index 79200aafc..7c765fa9f 100644 --- a/src/SALOMEDS/Test/Makefile.am +++ b/src/SALOMEDS/Test/Makefile.am @@ -144,4 +144,5 @@ EXTRA_DIST = \ bin_PROGRAMS = TestSALOMEDS dist_TestSALOMEDS_SOURCES = TestSALOMEDS.cxx TestSALOMEDS_CPPFLAGS = $(COMMON_CPPFLAGS) -TestSALOMEDS_LDADD = libSALOMEDSTest.la +TestSALOMEDS_LDADD = libSALOMEDSTest.la \ + $(CORBA_LIBS) diff --git a/src/SALOMEDSImpl/Makefile.am b/src/SALOMEDSImpl/Makefile.am index f1b3c72db..4ca4e58ab 100644 --- a/src/SALOMEDSImpl/Makefile.am +++ b/src/SALOMEDSImpl/Makefile.am @@ -92,15 +92,11 @@ COMMON_CPPFLAGS=\ @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@ # @@ -218,4 +214,5 @@ libSalomeDSImpl_la_LIBADD = $(COMMON_LIBS) bin_PROGRAMS = testDS testDS_SOURCES = testDS.cxx testDS_CPPFLAGS = $(COMMON_CPPFLAGS) -testDS_LDADD = libSalomeDSImpl.la $(COMMON_LIBS) +testDS_LDADD = libSalomeDSImpl.la \ + $(HDF5_LIBS) diff --git a/src/TestContainer/Makefile.am b/src/TestContainer/Makefile.am index bca922255..8101d8b2a 100644 --- a/src/TestContainer/Makefile.am +++ b/src/TestContainer/Makefile.am @@ -97,8 +97,10 @@ libSalomeTestComponentEngine_la_LIBADD = $(COMMON_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) diff --git a/src/Utils/Makefile.am b/src/Utils/Makefile.am index f0c0dd785..5b3c3a37a 100644 --- a/src/Utils/Makefile.am +++ b/src/Utils/Makefile.am @@ -71,7 +71,7 @@ libOpUtil_la_CPPFLAGS = \ libOpUtil_la_LIBADD = \ ../SALOMELocalTrace/libSALOMELocalTrace.la \ - $(top_builddir)/idl/libSalomeIDLKernel.la\ + $(top_builddir)/idl/libSalomeIDLKernel.la \ @CORBA_LIBS@ diff --git a/src/Utils/Test/Makefile.am b/src/Utils/Test/Makefile.am index 682b4b417..4bcdb9b64 100644 --- a/src/Utils/Test/Makefile.am +++ b/src/Utils/Test/Makefile.am @@ -84,5 +84,5 @@ libUtilsTest_la_LIBADD = $(COMMON_LIBS) bin_PROGRAMS = TestUtils TestUtils_SOURCES = TestUtils.cxx TestUtils_CPPFLAGS = $(COMMON_CPPFLAGS) -TestUtils_LDADD = libUtilsTest.la $(COMMON_LIBS) +TestUtils_LDADD = libUtilsTest.la $(CORBA_LIBS) diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx index c48e4afd9..830bb21cd 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx @@ -111,9 +111,10 @@ public : virtual void operator()(void){ typedef PortableServer::ServantBase TServant; if(_PtrObjet){ - if(TServant* aServant = dynamic_cast(_PtrObjet)){ + if(dynamic_cast(_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(_PtrObjet)){ PortableServer::POA_var aPOA = aServant->_default_POA(); PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant); aPOA->deactivate_object(anObjectId.in()); -- 2.39.2