Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package plplot for openSUSE:Factory checked in at 2021-04-06 17:31:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plplot (Old) and /work/SRC/openSUSE:Factory/.plplot.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plplot" Tue Apr 6 17:31:19 2021 rev:65 rq:883294 version:5.15.0 Changes: -------- --- /work/SRC/openSUSE:Factory/plplot/plplot.changes 2021-02-15 23:21:27.743858405 +0100 +++ /work/SRC/openSUSE:Factory/.plplot.new.2401/plplot.changes 2021-04-06 17:32:56.803338556 +0200 @@ -1,0 +2,7 @@ +Sun Apr 4 13:56:35 UTC 2021 - Stefan Br??ns <stefan.bru...@rwth-aachen.de> + +- Reenable qhull support, link against reentrant libqhull_r: + 0001-Use-reentrant-libqhull_r-instead-of-deprecated-libqh.patch +- Some minor specfile cleanups + +------------------------------------------------------------------- New: ---- 0001-Use-reentrant-libqhull_r-instead-of-deprecated-libqh.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plplot.spec ++++++ --- /var/tmp/diff_new_pack.thWbo9/_old 2021-04-06 17:32:57.411339243 +0200 +++ /var/tmp/diff_new_pack.thWbo9/_new 2021-04-06 17:32:57.415339248 +0200 @@ -16,11 +16,7 @@ # -%if 0%{?suse_version} <= 1320 -%define lua_version 5.2 -%else %define lua_version 5.3 -%endif %bcond_with ocaml_camlidl %define tk_enabled 1 @@ -29,9 +25,7 @@ %define octave_enabled 0 # /SECTION -# SECTION Does not build against qhull_r -%bcond_with qhull -# /SECTION +%bcond_without qhull # FIXME Doesn't build with fPIC (it seems) %bcond_with ada @@ -54,7 +48,7 @@ Release: 0 Summary: Software package for creating scientific plots # Main license is LGPL-2.1+, but Octave bindings are licensed as GPL-2.0+ -License: LGPL-2.1-or-later AND GPL-2.0-or-later +License: GPL-2.0-or-later AND LGPL-2.1-or-later Group: Productivity/Scientific/Other URL: http://plplot.sourceforge.net/ Source0: http://download.sf.net/plplot/%{name}-%{version}.tar.gz @@ -65,6 +59,8 @@ Patch2: plplot-include-QPainterPath.patch # PATCH-FIX-UPSTREAM plplot-drop-FindLua-cmake-module.patch badshah...@gmail.com -- Drop in-house FindLua.cmake module, which is severely dated, to use cmake's own module and fix building for lua >= 5.4; patch taken from upstream. Patch3: plplot-drop-FindLua-cmake-module.patch +# PATCH-FIX-UPSTREAM https://sourceforge.net/p/plplot/bugs/196/ -- Use reentrant libqhull_r +Patch4: 0001-Use-reentrant-libqhull_r-instead-of-deprecated-libqh.patch # List based on build_ada in gcc.spec ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le s390 s390x ia64 aarch64 riscv64 BuildRequires: cmake >= 3.13.2 @@ -122,7 +118,6 @@ Requires: libtool Requires: python3-numpy Recommends: %{name}-doc = %{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description PLplot is a library of functions that are useful for making scientific @@ -236,26 +231,26 @@ %{_libdir}/pkgconfig/plplot.pc %dir %{_libdir}/cmake/plplot %{_libdir}/cmake/plplot/export_csirocsa.cmake -%{_libdir}/cmake/plplot/export_csirocsa-release.cmake +%{_libdir}/cmake/plplot/export_csirocsa-*.cmake %if %{with qhull} %{_libdir}/libcsironn.so %{_libdir}/cmake/plplot/export_csironn.cmake -%{_libdir}/cmake/plplot/export_csironn-release.cmake +%{_libdir}/cmake/plplot/export_csironn-*.cmake %endif %{_libdir}/cmake/plplot/export_mem.cmake -%{_libdir}/cmake/plplot/export_mem-release.cmake +%{_libdir}/cmake/plplot/export_mem-*.cmake %{_libdir}/cmake/plplot/export_null.cmake -%{_libdir}/cmake/plplot/export_null-release.cmake +%{_libdir}/cmake/plplot/export_null-*.cmake %{_libdir}/cmake/plplot/export_plplot.cmake +%{_libdir}/cmake/plplot/export_plplot-*.cmake %{_libdir}/cmake/plplot/export_plplotc.cmake -%{_libdir}/cmake/plplot/export_plplotc-release.cmake -%{_libdir}/cmake/plplot/export_plplot-release.cmake +%{_libdir}/cmake/plplot/export_plplotc-*.cmake %{_libdir}/cmake/plplot/export_plserver.cmake -%{_libdir}/cmake/plplot/export_plserver-release.cmake +%{_libdir}/cmake/plplot/export_plserver-*.cmake %{_libdir}/cmake/plplot/export_pltek.cmake -%{_libdir}/cmake/plplot/export_pltek-release.cmake +%{_libdir}/cmake/plplot/export_pltek-*.cmake %{_libdir}/cmake/plplot/export_qsastime.cmake -%{_libdir}/cmake/plplot/export_qsastime-release.cmake +%{_libdir}/cmake/plplot/export_qsastime-*.cmake %{_libdir}/cmake/plplot/plplotConfig.cmake %{_libdir}/cmake/plplot/plplot_exports.cmake %{_mandir}/man3/pl*.3* @@ -358,7 +353,7 @@ %{_libdir}/ada/adalib/plplotada/ %{_libdir}/pkgconfig/plplot-ada.pc %{_libdir}/cmake/plplot/export_plplotada.cmake -%{_libdir}/cmake/plplot/export_plplotada-release.cmake +%{_libdir}/cmake/plplot/export_plplotada-*.cmake %{_datadir}/ada/adainclude/plplotada/ %{_datadir}/plplot%{version}/examples/ada/ %{_datadir}/plplot%{version}/examples/test_ada.sh @@ -413,9 +408,9 @@ %{_libdir}/libplplotfortran.so %{_libdir}/pkgconfig/plplot-fortran.pc %{_libdir}/cmake/plplot/export_plfortrandemolib.cmake -%{_libdir}/cmake/plplot/export_plfortrandemolib-release.cmake +%{_libdir}/cmake/plplot/export_plfortrandemolib-*.cmake %{_libdir}/cmake/plplot/export_plplotfortran.cmake -%{_libdir}/cmake/plplot/export_plplotfortran-release.cmake +%{_libdir}/cmake/plplot/export_plplotfortran-*.cmake %{_datadir}/plplot%{version}/examples/fortran/ %{_datadir}/plplot%{version}/examples/test_fortran.sh ########################################################################## @@ -438,7 +433,7 @@ %files java %{_libdir}/plplot%{version}/libplplotjavac_wrap.so %{_libdir}/cmake/plplot/export_plplotjavac_wrap.cmake -%{_libdir}/cmake/plplot/export_plplotjavac_wrap-release.cmake +%{_libdir}/cmake/plplot/export_plplotjavac_wrap-*.cmake %{_datadir}/java/plplot.jar %{_datadir}/plplot%{version}/examples/java/ %{_datadir}/plplot%{version}/examples/test_java.sh @@ -462,7 +457,7 @@ %files lua %{_libdir}/lua/plplot/ %{_libdir}/cmake/plplot/export_plplotluac.cmake -%{_libdir}/cmake/plplot/export_plplotluac-release.cmake +%{_libdir}/cmake/plplot/export_plplotluac-*.cmake %{_datadir}/plplot%{version}/examples/lua/ %{_datadir}/plplot%{version}/examples/test_lua.sh ########################################################################## @@ -487,7 +482,7 @@ %{_datadir}/%{name}_octave/ %{_datadir}/octave/site/m/PLplot/ %{_libdir}/octave/site/oct/*/plplot_octave.oct -%{_libdir}/cmake/plplot/export_plplot_octave-release.cmake +%{_libdir}/cmake/plplot/export_plplot_octave-*.cmake %{_libdir}/cmake/plplot/export_plplot_octave.cmake %{_datadir}/plplot%{version}/examples/octave/ %{_datadir}/plplot%{version}/examples/test_octave.sh @@ -512,7 +507,7 @@ %files python3-qt %{python3_sitearch}/plplot_pyqt5.so %{_libdir}/cmake/plplot/export_plplot_pyqt5.cmake -%{_libdir}/cmake/plplot/export_plplot_pyqt5-release.cmake +%{_libdir}/cmake/plplot/export_plplot_pyqt5-*.cmake ########################################################################## %package -n %{qt_shlib} @@ -565,9 +560,9 @@ %{_libdir}/plplot%{version}/drivers/qt.driver_info %{_libdir}/plplot%{version}/drivers/qt.so %{_libdir}/cmake/plplot/export_plplotqt.cmake -%{_libdir}/cmake/plplot/export_plplotqt-release.cmake +%{_libdir}/cmake/plplot/export_plplotqt-*.cmake %{_libdir}/cmake/plplot/export_qt.cmake -%{_libdir}/cmake/plplot/export_qt-release.cmake +%{_libdir}/cmake/plplot/export_qt-*.cmake ########################################################################## %package tcltk-libs @@ -618,10 +613,10 @@ %{_libdir}/libplplottcltk*.so %{_libdir}/libtclmatrix.so %{_libdir}/cmake/plplot/export_pltcl.cmake -%{_libdir}/cmake/plplot/export_pltcl-release.cmake +%{_libdir}/cmake/plplot/export_pltcl-*.cmake %{_libdir}/pkgconfig/plplot-tcl*.pc %{_libdir}/cmake/plplot/export_tclmatrix.cmake -%{_libdir}/cmake/plplot/export_tclmatrix-release.cmake +%{_libdir}/cmake/plplot/export_tclmatrix-*.cmake %{_datadir}/plplot%{version}/examples/test_tcl.sh %{_datadir}/plplot%{version}/examples/tcl/ %{_datadir}/plplot%{version}/pkgIndex.tcl @@ -637,15 +632,15 @@ %{_libdir}/plplot%{version}/drivers/tkwin.driver_info %{_libdir}/plplot%{version}/drivers/tkwin.so %{_libdir}/cmake/plplot/export_tk.cmake -%{_libdir}/cmake/plplot/export_tk-release.cmake +%{_libdir}/cmake/plplot/export_tk-*.cmake %{_libdir}/cmake/plplot/export_tkwin.cmake -%{_libdir}/cmake/plplot/export_tkwin-release.cmake +%{_libdir}/cmake/plplot/export_tkwin-*.cmake %{_libdir}/cmake/plplot/export_plplottcltk.cmake %{_libdir}/cmake/plplot/export_plplottcltk_Main.cmake -%{_libdir}/cmake/plplot/export_plplottcltk_Main-release.cmake -%{_libdir}/cmake/plplot/export_plplottcltk-release.cmake +%{_libdir}/cmake/plplot/export_plplottcltk_Main-*.cmake +%{_libdir}/cmake/plplot/export_plplottcltk-*.cmake %{_libdir}/cmake/plplot/export_Pltk_init.cmake -%{_libdir}/cmake/plplot/export_Pltk_init-release.cmake +%{_libdir}/cmake/plplot/export_Pltk_init-*.cmake %{python3_sitearch}/Plframe.py* %{python3_sitearch}/TclSup.py* %{python3_sitearch}/*Pltk_init.* @@ -691,7 +686,7 @@ %files wxwidgets %{_bindir}/wxPLViewer %{_libdir}/cmake/plplot/export_wxPLViewer.cmake -%{_libdir}/cmake/plplot/export_wxPLViewer-release.cmake +%{_libdir}/cmake/plplot/export_wxPLViewer-*.cmake ########################################################################## %package -n %{name}wxwidgets-devel @@ -720,9 +715,9 @@ %{_libdir}/plplot%{version}/drivers/wxwidgets.driver_info %{_libdir}/plplot%{version}/drivers/wxwidgets.so %{_libdir}/cmake/plplot/export_plplotwxwidgets.cmake -%{_libdir}/cmake/plplot/export_plplotwxwidgets-release.cmake +%{_libdir}/cmake/plplot/export_plplotwxwidgets-*.cmake %{_libdir}/cmake/plplot/export_wxwidgets.cmake -%{_libdir}/cmake/plplot/export_wxwidgets-release.cmake +%{_libdir}/cmake/plplot/export_wxwidgets-*.cmake ########################################################################## %package -n %{c_shlib} @@ -783,7 +778,7 @@ %{_libdir}/libplplotcxx.so %{_libdir}/pkgconfig/plplot-c++.pc %{_libdir}/cmake/plplot/export_plplotcxx.cmake -%{_libdir}/cmake/plplot/export_plplotcxx-release.cmake +%{_libdir}/cmake/plplot/export_plplotcxx-*.cmake %{_includedir}/plplot/plstream.h ########################################################################## @@ -891,7 +886,7 @@ %{_libdir}/plplot%{version}/drivers/cairo.driver_info %{_libdir}/plplot%{version}/drivers/cairo.so %{_libdir}/cmake/plplot/export_cairo.cmake -%{_libdir}/cmake/plplot/export_cairo-release.cmake +%{_libdir}/cmake/plplot/export_cairo-*.cmake ########################################################################## %package driver-ntk @@ -911,7 +906,7 @@ %{_libdir}/plplot%{version}/drivers/ntk.driver_info %{_libdir}/plplot%{version}/drivers/ntk.so %{_libdir}/cmake/plplot/export_ntk.cmake -%{_libdir}/cmake/plplot/export_ntk-release.cmake +%{_libdir}/cmake/plplot/export_ntk-*.cmake ########################################################################## %package driver-ps @@ -931,7 +926,7 @@ %{_libdir}/plplot%{version}/drivers/ps.driver_info %{_libdir}/plplot%{version}/drivers/ps.so %{_libdir}/cmake/plplot/export_ps.cmake -%{_libdir}/cmake/plplot/export_ps-release.cmake +%{_libdir}/cmake/plplot/export_ps-*.cmake ########################################################################## %package driver-psttf @@ -951,7 +946,7 @@ %{_libdir}/plplot%{version}/drivers/psttf.driver_info %{_libdir}/plplot%{version}/drivers/psttf.so %{_libdir}/cmake/plplot/export_psttf.cmake -%{_libdir}/cmake/plplot/export_psttf-release.cmake +%{_libdir}/cmake/plplot/export_psttf-*.cmake ########################################################################## %package driver-svg @@ -971,7 +966,7 @@ %{_libdir}/plplot%{version}/drivers/svg.driver_info %{_libdir}/plplot%{version}/drivers/svg.so %{_libdir}/cmake/plplot/export_svg.cmake -%{_libdir}/cmake/plplot/export_svg-release.cmake +%{_libdir}/cmake/plplot/export_svg-*.cmake ########################################################################## %package driver-xfig @@ -991,7 +986,7 @@ %{_libdir}/plplot%{version}/drivers/xfig.driver_info %{_libdir}/plplot%{version}/drivers/xfig.so %{_libdir}/cmake/plplot/export_xfig.cmake -%{_libdir}/cmake/plplot/export_xfig-release.cmake +%{_libdir}/cmake/plplot/export_xfig-*.cmake ########################################################################## %package driver-xwin @@ -1011,7 +1006,7 @@ %{_libdir}/plplot%{version}/drivers/xwin.driver_info %{_libdir}/plplot%{version}/drivers/xwin.so %{_libdir}/cmake/plplot/export_xwin.cmake -%{_libdir}/cmake/plplot/export_xwin-release.cmake +%{_libdir}/cmake/plplot/export_xwin-*.cmake ########################################################################## %prep @@ -1036,7 +1031,6 @@ trap "kill $! || true" EXIT sleep 5 %cmake \ - -DCMAKE_BUILD_TYPE:STRING=Release \ -DENABLE_compiler_diagnostics=ON \ -DPL_FREETYPE_FONT_PATH:PATH="%{_datadir}/fonts/truetype" \ -DUSE_RPATH:BOOL=OFF \ @@ -1051,12 +1045,12 @@ %endif -DENABLE_d:BOOL=ON \ -DENABLE_itcl:BOOL=ON \ -%if 0%{?tk_enabled} > 1320 - -DENABLE_itk:BOOL=OFF \ - -DENABLE_tk:BOOL=OFF \ -%else +%if 0%{?tk_enabled} -DENABLE_itk:BOOL=ON \ -DENABLE_tk:BOOL=ON \ +%else + -DENABLE_itk:BOOL=OFF \ + -DENABLE_tk:BOOL=OFF \ %endif %if %{with ocaml_camlidl} -DENABLE_ocaml:BOOL=ON \ @@ -1095,7 +1089,7 @@ rm -rf %{buildroot}%{_datadir}/plplot%{version}/examples/cmake/modules/Platform #Remove unnecessary examples that trigger build errors or warnings -rm -f %{buildroot}%{_datadir}/%{name}%{version}/examples/cmake/modules/export_plplot-release.cmake +rm -f %{buildroot}%{_datadir}/%{name}%{version}/examples/cmake/modules/export_plplot-*.cmake rm -f %{buildroot}%{_datadir}/%{name}%{version}/examples/test_octave_interactive.sh rm -f %{buildroot}%{_datadir}/%{name}%{version}/examples/tk/*.in rm -f %{buildroot}%{_datadir}/%{name}%{version}/examples/tcl/*.in ++++++ 0001-Use-reentrant-libqhull_r-instead-of-deprecated-libqh.patch ++++++ >From 07c5fb9d551dd04dd1d4e9e287c3901b7353b948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bru...@rwth-aachen.de> Date: Sun, 4 Apr 2021 15:56:15 +0200 Subject: [PATCH] Use reentrant libqhull_r instead of deprecated libqhull The non-reentrant version has been deprecated by upstream and is no longer built by default. The reentrant version is available since qhull 2015.1. As the old-style qhull/* headers were removed with qhull 2011.1 these are no longer relevant. --- cmake/modules/FindQHULL.cmake | 14 +++++++------- cmake/modules/csiro.cmake | 6 +----- lib/nn/delaunay.c | 21 ++++++++++----------- src/CMakeLists.txt | 4 ++-- src/plgridd.c | 27 +++++++++++++-------------- 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/cmake/modules/FindQHULL.cmake b/cmake/modules/FindQHULL.cmake index d5485ed..ba8c7aa 100644 --- a/cmake/modules/FindQHULL.cmake +++ b/cmake/modules/FindQHULL.cmake @@ -16,27 +16,27 @@ include(FindPackageHandleStandardArgs) # that is what is supplied by upstream qhull, and if the user is # finding a local install of the upstream library below, he wants to # access that same upstream version of the headers to be consistent. -find_file(QHULL_HEADER_FILE NAMES libqhull/qhull_a.h qhull/qhull_a.h) +find_file(QHULL_HEADER_FILE NAMES libqhull_r/qhull_ra.h) if(QHULL_HEADER_FILE) # message(STATUS "QHULL_HEADER_FILE = ${QHULL_HEADER_FILE}") - if(QHULL_HEADER_FILE MATCHES "libqhull") + if(QHULL_HEADER_FILE MATCHES "libqhull_r") set(HAS_LIBQHULL_INCLUDE ON) - else(QHULL_HEADER_FILE MATCHES "libqhull") + else() set(HAS_LIBQHULL_INCLUDE OFF) - endif(QHULL_HEADER_FILE MATCHES "libqhull") + endif() # Determine grandparent directory of header file get_filename_component(QHULL_INCLUDE_DIRS ${QHULL_HEADER_FILE} DIRECTORY) get_filename_component(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIRS} DIRECTORY) elseif(NOT QHULL_HEADER_FILE AND NOT QHULL_FIND_QUIETLY) - message(STATUS "Neither qhull/qhull_a.h header nor libqhull/qhull_a.h could be found") + message(STATUS "libqhull_r/qhull_ra.h could not be found") endif(QHULL_HEADER_FILE) -find_library(QHULL_LIBRARY qhull) +find_library(QHULL_LIBRARY qhull_r) if( QHULL_LIBRARY ) get_filename_component(QHULL_LIBRARY_DIRS ${QHULL_LIBRARY} DIRECTORY) set(QHULL_LIBRARIES ${QHULL_LIBRARY}) elseif(NOT QHULL_LIBRARY AND NOT QHULL_FIND_QUIETLY) - message(STATUS "qhull library could not be found") + message(STATUS "qhull_r library could not be found") endif(QHULL_LIBRARY) find_package_handle_standard_args(QHULL diff --git a/cmake/modules/csiro.cmake b/cmake/modules/csiro.cmake index cd427c4..c0df044 100644 --- a/cmake/modules/csiro.cmake +++ b/cmake/modules/csiro.cmake @@ -89,11 +89,7 @@ if(PL_HAVE_QHULL) message(STATUS "WARNING: function qh_new_qhull not found. Setting PL_HAVE_QHULL to OFF.") set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) endif(NOT QH_NEW_EXIST) - if(HAS_LIBQHULL_INCLUDE) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Check_realT_size.c "#include <libqhull/qhull_a.h>") - else(HAS_LIBQHULL_INCLUDE) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Check_realT_size.c "#include <qhull/qhull_a.h>") - endif(HAS_LIBQHULL_INCLUDE) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Check_realT_size.c "#include <libqhull_r/qhull_ra.h>") file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/Check_realT_size.c " int main(void) diff --git a/lib/nn/delaunay.c b/lib/nn/delaunay.c index f44c990..b0143c7 100644 --- a/lib/nn/delaunay.c +++ b/lib/nn/delaunay.c @@ -34,11 +34,7 @@ #include <limits.h> #include <float.h> #ifdef USE_QHULL -#ifdef HAS_LIBQHULL_INCLUDE -#include <libqhull/qhull_a.h> -#else -#include <qhull/qhull_a.h> -#endif +#include <libqhull_r/qhull_ra.h> #else #include "triangle.h" #endif @@ -388,7 +384,10 @@ delaunay* delaunay_build( int np, point points[], int ns, int segments[], int nh // climax // - exitcode = qh_new_qhull( dim, np, qpoints, ismalloc, + qhT context = { 0 }; + qhT* qh = &context; + + exitcode = qh_new_qhull( qh, dim, np, qpoints, ismalloc, flags, outfile, errfile ); if ( !exitcode ) @@ -433,8 +432,8 @@ delaunay* delaunay_build( int np, point points[], int ns, int segments[], int nh } } - qh_findgood_all( qh facet_list ); - qh_countfacets( qh facet_list, NULL, !qh_ALL, &numfacets, + qh_findgood_all( qh, qh->facet_list ); + qh_countfacets( qh, qh->facet_list, NULL, !qh_ALL, &numfacets, &numsimplicial, &totneighbors, &numridges, &numcoplanars, &numtricoplanars ); @@ -462,7 +461,7 @@ delaunay* delaunay_build( int np, point points[], int ns, int segments[], int nh j = 0; FOREACHvertex_( facet->vertices ) - t->vids[j++] = qh_pointid( vertex->point ); + t->vids[j++] = qh_pointid( qh, vertex->point ); j = 0; FOREACHneighbor_( facet ) @@ -548,8 +547,8 @@ delaunay* delaunay_build( int np, point points[], int ns, int segments[], int nh } free( qpoints ); - qh_freeqhull( !qh_ALL ); // free long memory - qh_memfreeshort( &curlong, &totlong ); // free short memory and memory allocator + qh_freeqhull( qh, !qh_ALL ); // free long memory + qh_memfreeshort( qh, &curlong, &totlong ); // free short memory and memory allocator if ( curlong || totlong ) fprintf( errfile, "qhull: did not free %d bytes of long memory (%d pieces)\n", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 757b4ed..18c6016 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -259,9 +259,9 @@ if(PL_HAVE_QHULL) # No *.pc files for lib subdirectory libraries so must add relevant bits # to the plplot.pc file instead. if(QHULL_RPATH) - list(APPEND pc_libplplot_LINK_FLAGS -l${WRITEABLE_TARGET}csironn -L${QHULL_RPATH} -lqhull) + list(APPEND pc_libplplot_LINK_FLAGS -l${WRITEABLE_TARGET}csironn -L${QHULL_RPATH} -lqhull_r) else(QHULL_RPATH) - list(APPEND pc_libplplot_LINK_FLAGS -l${WRITEABLE_TARGET}csironn -lqhull) + list(APPEND pc_libplplot_LINK_FLAGS -l${WRITEABLE_TARGET}csironn -lqhull_r) endif(QHULL_RPATH) # Needed by plgridd.c. diff --git a/src/plgridd.c b/src/plgridd.c index 3982016..607e5a3 100644 --- a/src/plgridd.c +++ b/src/plgridd.c @@ -32,11 +32,7 @@ #include "../lib/nn/nn.h" // PLPLOT_NONN not #defined or tested for more than a decade. #ifdef PLPLOT_NONN // another DTLI, based only on QHULL, not nn -#ifdef HAS_LIBQHULL_INCLUDE -#include <libqhull/qhull_a.h> -#else //#ifdef HAS_LIBQHULL_INCLUDE -#include <qhull/qhull_a.h> -#endif //#ifdef HAS_LIBQHULL_INCLUDE +#include <libqhull_r/qhull_ra.h> #endif //#ifdef PLPLOT_NONN #endif //#ifdef PL_HAVE_QHUL @@ -852,8 +848,11 @@ grid_adtli( PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_VECTOR z, int npts, points[i * dim + 1] = y[i]; } + qhT context = { 0 }; + qhT* qh = &context; + #if 1 // easy way - exitcode = qh_new_qhull( dim, npts, points, ismalloc, + exitcode = qh_new_qhull( qh, dim, npts, points, ismalloc, flags, outfile, errfile ); #else qh_init_A( stdin, stdout, stderr, 0, NULL ); @@ -899,17 +898,17 @@ grid_adtli( PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_VECTOR z, int npts, #endif // Without the setjmp(), Qhull will exit() after reporting an error - exitcode = setjmp( qh errexit ); + exitcode = setjmp( qh->errexit ); if ( !exitcode ) { - qh NOerrexit = False; + qh->NOerrexit = False; for ( i = 0; i < nptsx; i++ ) for ( j = 0; j < nptsy; j++ ) { l = 0; point[0] = xg[i]; point[1] = yg[j]; - qh_setdelaunay( 3, 1, point ); + qh_setdelaunay( qh, 3, 1, point ); // several ways to find the triangle given a point follow. @@ -942,7 +941,7 @@ grid_adtli( PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_VECTOR z, int npts, // Another possibility is to implement the 'walking // triangle algorithm - facet = qh_findfacet_all( point, &bestdist, &isoutside, &totpart ); + facet = qh_findfacet_all( qh, point, &bestdist, &isoutside, &totpart ); if ( facet->upperdelaunay ) zops->set( zgp, i, j, NaN ); @@ -950,7 +949,7 @@ grid_adtli( PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_VECTOR z, int npts, { FOREACHvertex_( facet->vertices ) { - k = qh_pointid( vertex->point ); + k = qh_pointid( qh, vertex->point ); xt[l] = x[k]; yt[l] = y[k]; zt[l] = z[k]; @@ -969,12 +968,12 @@ grid_adtli( PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_VECTOR z, int npts, } } } - qh NOerrexit = True; + qh->NOerrexit = True; } free( points ); - qh_freeqhull( !qh_ALL ); // free long memory - qh_memfreeshort( &curlong, &totlong ); // free short memory and memory allocator + qh_freeqhull( qh, !qh_ALL ); // free long memory + qh_memfreeshort( qh, &curlong, &totlong ); // free short memory and memory allocator if ( curlong || totlong ) fprintf( errfile, "qhull: did not free %d bytes of long memory (%d pieces)\n", -- 2.30.2