diff --git a/debian/control b/debian/control index 8ce8d3c..2d3282d 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Section: libs Priority: optional Build-Depends: autoconf, automake, - debhelper (>= 11), + debhelper (>= 10), dh-python, libblas-dev, libboost-all-dev, @@ -65,16 +65,16 @@ Description: Generic C++ template library for sparse, dense and skyline matrices and matrix types. However, basic sparse, dense and skyline matrix/vector types are built-in, hence it can be used as a standalone linear algebra library. -Package: python-getfem++ +Package: python3-getfem++ Architecture: any -Section: python +Section: python3 Depends: libgetfem5++ (= ${binary:Version}), - python (<< 2.8), - python, - python-numpy, - python-scipy, + python3, + python3-numpy, + python3-scipy, + python3-mpi4py, ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, ${shlibs:Depends} Provides: ${python:Provides} Description: Python interface to the GETFEM++ generic finite element library diff --git a/debian/patches/11_python3.patch b/debian/patches/11_python3.patch new file mode 100644 index 0000000..3da8334 --- /dev/null +++ b/debian/patches/11_python3.patch @@ -0,0 +1,84 @@ +diff --git a/bin/extract_doc b/bin/extract_doc +index 12cf717..b4ebe8c 100755 +--- a/bin/extract_doc ++++ b/bin/extract_doc +@@ -1622,7 +1622,11 @@ except ImportError: + + from numpy import * + +-from _getfem import * ++try: ++ from ._getfem import * ++except (ImportError, SystemError): ++ from _getfem import * ++ + obj_count = {} + getfem('workspace', 'clear all') + +diff --git a/interface/src/python/Makefile.am b/interface/src/python/Makefile.am +index 9e18ef1..7c42e70 100644 +--- a/interface/src/python/Makefile.am ++++ b/interface/src/python/Makefile.am +@@ -23,13 +23,13 @@ gfpythondir=$(pythondir)/getfem + gfpyexecdir=$(pyexecdir)/getfem + + gfpython_PYTHON = getfem.py __init__.py +-nodist_gfpyexec_PYTHON = _getfem.so ++nodist_gfpyexec_PYTHON = _getfem*.so + + EXTRA_DIST = getfem_python.c + + # $(warning PSEUDO_FUNCTIONS= $(PSEUDO_FUNCTIONS)) + +-CLEANFILES = getfem.py _getfem.so *.o getfem_python_c.o getfem_python_c.c getfem.pyc ++CLEANFILES = getfem.py _getfem*.so *.o getfem_python_c.o getfem_python_c.c getfem.pyc + + if BUILDPYTHONPAR + +@@ -53,13 +53,13 @@ getfem_python_c.c : getfem_python.c + cp $(srcdir)/getfem_python.c getfem_python_c.c + + # ARCHFLAGS is set to empty to disable universal binaries with python 2.5 on macos 10.5 +-_getfem.so: getfem_python_c.c ../libgetfemint.la $(GETFEM_LIB_LA) +- touch _getfem.so && rm _getfem.so ++_getfem*.so: getfem_python_c.c ../libgetfemint.la $(GETFEM_LIB_LA) ++ touch _getfem*.so && rm _getfem*.so + ARCHFLAGS="" CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py -v build @PYTHON_CC_ARG@ --build-temp . --build-base . --build-lib . --force + #LDSHARED="$(CXX) -shared" ARCHFLAGS="" python setup.py -v build --build-temp . --build-base . --build-lib . --force + + +-all: _getfem.so getfem.py ++all: _getfem*.so getfem.py + #pyexec_LTLIBRARIES = libgfpython.la + #libgfpython_la_LIBADD = ../.libs/libgetfemint.a @GETFEM_STATICLIBS@ + #libgfpython_la_SOURCES = \ +diff --git a/interface/src/python/__init__.py b/interface/src/python/__init__.py +index 8eb7e0c..6d3473e 100644 +--- a/interface/src/python/__init__.py ++++ b/interface/src/python/__init__.py +@@ -13,4 +13,7 @@ __LICENSE__ = """\ + GetFEM++ 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 3 of the License, or (at your option) any later version along with the GCC Runtime Library Exception either version 3.1 or (at your option) any later version. This program 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 and GCC Runtime Library Exception for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + """ + +-from getfem import * ++try: ++ from .getfem import * ++except (ImportError, SystemError): ++ from getfem import * +diff --git a/interface/src/python/getfem.py b/interface/src/python/getfem.py +index cbb6f3d..ff96ff7 100644 +--- a/interface/src/python/getfem.py ++++ b/interface/src/python/getfem.py +@@ -41,7 +41,11 @@ except ImportError: + + from numpy import * + +-from _getfem import * ++try: ++ from ._getfem import * ++except (ImportError, SystemError): ++ from _getfem import * ++ + obj_count = {} + getfem('workspace', 'clear all') + diff --git a/debian/patches/series b/debian/patches/series index f2a42a7..29927b1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 07_disable_scilab.patch 10_move_getfem_arch_config.patch numpy1.14.patch +11_python3.patch diff --git a/debian/python-getfem++.pyinstall b/debian/python-getfem++.pyinstall deleted file mode 100644 index 4ea9d25..0000000 --- a/debian/python-getfem++.pyinstall +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/lib/python*/*-packages/getfem/*.py getfem -debian/tmp/usr/lib/python*/*-packages/getfem/*.so getfem diff --git a/debian/python3-getfem++.pyinstall b/debian/python3-getfem++.pyinstall new file mode 100644 index 0000000..d63c266 --- /dev/null +++ b/debian/python3-getfem++.pyinstall @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/python3*/*-packages/getfem/*.py getfem +debian/tmp/usr/lib/python3*/*-packages/getfem/*.so getfem diff --git a/debian/rules b/debian/rules index e818fc7..34137a5 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,8 @@ #!/usr/bin/make -f +# -*- makefile -*- + %: - dh $@ --with python2 + dh $@ --with python3 #===================================================================== @@ -11,11 +13,11 @@ export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) export LD_LIBRARY_PATH :=$(LD_LIBRARY_PATH):$(CURDIR)/./src/.libs/ -export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie configure_flags= $(CROSS) --prefix=/usr \ --enable-boost --enable-shared --with-pic \ - --enable-python --enable-metis \ + --enable-python3 --enable-metis \ --disable-matlab --disable-superlu \ --enable-muparser --enable-mumps --disable-scilab \ --with-mumps="-lsmumps_seq -ldmumps_seq -lcmumps_seq -lzmumps_seq -lpord_seq" @@ -35,9 +37,3 @@ override_dh_install: override_dh_installchangelogs: dh_installchangelogs ChangeLog - -override_dh_python2: - dh_python2 --no-guessing-versions - -#override_dh_auto_test: -# dh_auto_test || true