[ismrmrd] 155/177: Cleaning out old python swig bindings.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.

commit 3a80ba35e08e4601e9362926a0dcd701862cd6bb
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Tue Oct 21 15:26:37 2014 -0400

    Cleaning out old python swig bindings.
---
 CMakeLists.txt                   |  3 +-
 bindings/CMakeLists.txt          | 19 -----------
 bindings/python/CMakeLists.txt   | 47 ---------------------------
 bindings/python/ismrmrd_python.i | 70 ----------------------------------------
 4 files changed, 2 insertions(+), 137 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 694fa82..72d2117 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,11 +198,12 @@ enable_testing()
 add_subdirectory(doc)
 add_subdirectory(examples/c)
 add_subdirectory(utilities)
-#add_subdirectory(bindings)
 
 # install the matlab api
 install(DIRECTORY matlab DESTINATION share/ismrmrd)
 
+# TODO build and install the python bindings
+
 # Create package
 string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
 include(${ISMRMRD_CMAKE_DIR}/ismrmrd_cpack.cmake)
diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
deleted file mode 100644
index 3234b97..0000000
--- a/bindings/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-find_package(SWIG)
-
-if(SWIG_FOUND)
-
-    include(${SWIG_USE_FILE})
-
-    find_package(PythonLibs)
-    if(PYTHONLIBS_FOUND)
-        find_package(NumPy)
-        if(NUMPY_FOUND)
-            add_subdirectory(python)
-        else(NUMPY_FOUND)
-            message("NumPy not found. Not building Python bindings")
-        endif(NUMPY_FOUND)
-    else(PYTHONLIBS_FOUND)
-        message("PythonLibs not found. Not building Python bindings")
-    endif(PYTHONLIBS_FOUND)
-
-endif(SWIG_FOUND)
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
deleted file mode 100644
index 579be6b..0000000
--- a/bindings/python/CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-include_directories(${CMAKE_SOURCE_DIR}/include)
-include_directories(${PYTHON_INCLUDE_PATH} ${NUMPY_INCLUDE_DIRS})
-include_directories(${HDF5_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}/cpp)
-
-if ( WIN32 )
-    add_definitions(-Dismrmrd_EXPORTS)
-endif ( WIN32 )
-
-swig_add_module(ismrmrd python ismrmrd_python.i
-    ${CMAKE_SOURCE_DIR}/libsrc/ismrmrd.c
-    ${CMAKE_SOURCE_DIR}/libsrc/dataset.c
-)
-
-swig_link_libraries(ismrmrd ${HDF5_LIBRARIES} ${PYTHON_LIBRARIES})
-
-set(PYTHON_INSTALL_DIR share/ismrmrd/python)
-
-install(TARGETS ${SWIG_MODULE_ismrmrd_REAL_NAME}
-    DESTINATION ${PYTHON_INSTALL_DIR})
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ismrmrd.py
-    DESTINATION ${PYTHON_INSTALL_DIR})
-
-find_program(PYXBGEN pyxbgen
-    HINTS ${PYTHON_HOME} ${PYTHON_LIBRARY}/..
-    PATH_SUFFIXES bin)
-
-if(PYXBGEN)
-    set(SCHEMA "${CMAKE_SOURCE_DIR}/schema/ismrmrd.xsd")
-    set(XSD_PY_FILE "${CMAKE_CURRENT_BINARY_DIR}/ismrmrd_xsd.py")
-    set(XSD_PY_DIR "${CMAKE_CURRENT_BINARY_DIR}/raw")
-
-    add_custom_command(
-        OUTPUT ${XSD_PY_FILE} ${XSD_PY_DIR}
-        COMMAND ${PYXBGEN} -r -u "${SCHEMA}" -m ismrmrd_xsd
-        COMMAND ${CMAKE_COMMAND} -E echo "import" "pyxb.utils.domutils" >> ${XSD_PY_FILE}
-        COMMAND ${CMAKE_COMMAND} -E echo "'pyxb.utils.domutils.BindingDOMSupport.SetDefaultNamespace(Namespace)'" >> ${XSD_PY_FILE}
-        DEPENDS ${SCHEMA})
-
-    add_custom_target(pyismrmrd_xsd ALL DEPENDS ${XSD_PY_FILE})
-
-    install(FILES ${XSD_PY_FILE}
-        DESTINATION ${PYTHON_INSTALL_DIR})
-    install(DIRECTORY ${XSD_PY_DIR}
-        DESTINATION ${PYTHON_INSTALL_DIR})
-else(PYXBGEN)
-    message("Can't find pyxbgen executable. Not building ismrmrd_xsd.py")
-endif(PYXBGEN)
diff --git a/bindings/python/ismrmrd_python.i b/bindings/python/ismrmrd_python.i
deleted file mode 100644
index 81ceeed..0000000
--- a/bindings/python/ismrmrd_python.i
+++ /dev/null
@@ -1,70 +0,0 @@
-%module ismrmrd
-
-%{
-
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-
-#include "ismrmrd/ismrmrd.h"
-#include "ismrmrd/dataset.h"
-#include "numpy/arrayobject.h"
-
-// for compatibility with Numpy version <= 1.6
-#define NUMPY17_API 0x00000007
-#if NPY_FEATURE_VERSION < NUMPY17_API
-#define NPY_ARRAY_FARRAY NPY_FARRAY
-#endif
-
-#define SWIG_FILE_WITH_INIT
-
-    /* exception helpers */
-    static int swig_c_err_num = 0;
-    static char swig_c_err_msg[256];
-
-    const char *err_occurred()
-    {
-        if (swig_c_err_num) {
-            swig_c_err_num = 0;
-            return (const char*)swig_c_err_msg;
-        }
-        return NULL;
-    }
-
-    void set_err(const char *msg)
-    {
-        swig_c_err_num = 1;
-        strncpy(swig_c_err_msg, msg, 256);
-    }
-%}
-
-// Initialize NumPy
-%init %{
-    import_array();
-%}
-
-%include "carrays.i"
-
-%array_class(uint16_t, ushortArray);
-%array_class(int32_t, intArray);
-%array_class(uint32_t, uintArray);
-%array_class(uint64_t, ulongArray);
-%array_class(float, floatArray);
-
-
-%exception {
-    const char *err;
-    $action
-    if ((err = err_occurred())) {
-        PyErr_SetString(PyExc_RuntimeError, err);
-        return NULL;
-    }
-}
-
-// Process the main ISMRMRD header
-%include "ismrmrd/export.h"
-%include "ismrmrd/ismrmrd.h"
-
-// These definitions are needed for the HDF5 stuff to work
-// %define EXPORTISMRMRD %enddef
-
-// Process the HDF5 ISMRMD headers
-%include "ismrmrd/dataset.h"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list