Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:redwil:15.4
getfem
0001-Use-reentrant-qhull-library.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Use-reentrant-qhull-library.patch of Package getfem
From eb02c5debb29715c990b03654d46b6077ab92095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de> Date: Tue, 8 Mar 2022 00:53:40 +0100 Subject: [PATCH] Use reentrant qhull library The non-reentrant library has been deprecated. Fixes https://savannah.nongnu.org/bugs/?62151 --- configure.ac | 8 ++++---- src/bgeot_convex_ref.cc | 31 ++++++++++--------------------- 2 files changed, 14 insertions(+), 25 deletions(-) Index: getfem-5.4.2/configure.ac =================================================================== --- getfem-5.4.2.orig/configure.ac +++ getfem-5.4.2/configure.ac @@ -910,14 +910,14 @@ save_LIBS="$LIBS"; if test "x$useQHULL" = "xno"; then echo "Building with libqhull explicitly disabled"; else - AC_CHECK_LIB(qhull, qh_new_qhull, [QHULL_LIBS="-lqhull"], + AC_CHECK_LIB(qhull_r, qh_new_qhull, [QHULL_LIBS="-lqhull_r"], [ - AC_CHECK_LIB(qhullstatic, qh_new_qhull,[QHULL_LIBS="-lqhullstatic"],[QHULL_LIBS=""]) + AC_CHECK_LIB(qhullstatic_r, qh_new_qhull,[QHULL_LIBS="-lqhullstatic_r"],[QHULL_LIBS=""]) ]) - AC_CHECK_HEADERS(libqhull/qhull_a.h,[useQHULL="yes"], + AC_CHECK_HEADERS(libqhull_r/qhull_ra.h,[useQHULL="yes"], [ if test "x$useQHULL" = "xyes"; then - AC_MSG_ERROR([header files libqhull/qhull_a.h not found. Use --enable-qhull=no flag]); + AC_MSG_ERROR([header files libqhull_r/qhull_ra.h not found. Use --enable-qhull=no flag]); useQHULL="no" fi; ]) Index: getfem-5.4.2/src/bgeot_convex_ref.cc =================================================================== --- getfem-5.4.2.orig/src/bgeot_convex_ref.cc +++ getfem-5.4.2/src/bgeot_convex_ref.cc @@ -30,29 +30,15 @@ namespace bgeot { // Interface with qhull // ****************************************************************** -# ifndef GETFEM_HAVE_LIBQHULL_QHULL_A_H +# if !defined(GETFEM_HAVE_LIBQHULL_R_QHULL_RA_H) void qhull_delaunay(const std::vector<base_node> &, gmm::dense_matrix<size_type>&) { GMM_ASSERT1(false, "Qhull header files not installed. " "Install qhull library and reinstall GetFEM library."); } # else +# include <libqhull_r/qhull_ra.h> - extern "C" { - // #ifdef _MSC_VER -# include <libqhull/qhull_a.h> - // #else - // # include <qhull/qhull.h> - // # include <qhull/mem.h> - // # include <qhull/qset.h> - // # include <qhull/geom.h> - // # include <qhull/merge.h> - // # include <qhull/poly.h> - // # include <qhull/io.h> - // # include <qhull/stat.h> - // #endif - } - void qhull_delaunay(const std::vector<base_node> &pts, gmm::dense_matrix<size_type>& simplexes) { // cout << "running delaunay with " << pts.size() << " points\n"; @@ -79,7 +65,10 @@ namespace bgeot { facetT *facet; /* set by FORALLfacets */ int curlong, totlong; /* memory remaining after qh_memfreeshort */ vertexT *vertex, **vertexp; - exitcode = qh_new_qhull (int(dim), int(pts.size()), &Pts[0], ismalloc, + + qhT context = {}; + qhT* qh = &context; + exitcode = qh_new_qhull (qh, int(dim), int(pts.size()), &Pts[0], ismalloc, flags, outfile, errfile); if (!exitcode) { /* if no error */ size_type nbf=0; @@ -92,14 +81,14 @@ namespace bgeot { size_type s=0; FOREACHvertex_(facet->vertices) { assert(s < (unsigned)(dim+1)); - simplexes(s++,nbf) = qh_pointid(vertex->point); + simplexes(s++,nbf) = qh_pointid(qh, vertex->point); } nbf++; } } } - qh_freeqhull(!qh_ALL); - qh_memfreeshort (&curlong, &totlong); + qh_freeqhull(qh, !qh_ALL); + qh_memfreeshort(qh, &curlong, &totlong); if (curlong || totlong) cerr << "qhull internal warning (main): did not free " << totlong << " bytes of long memory (" << curlong << " pieces)\n"; @@ -132,7 +121,7 @@ namespace bgeot { m.add_simplex(n, ipts.begin()); } } else { -# ifdef GETFEM_HAVE_LIBQHULL_QHULL_A_H +# if defined(GETFEM_HAVE_LIBQHULL_R_QHULL_RA_H) gmm::dense_matrix<size_type> t; qhull_delaunay(cvr->points(), t); for (size_type nc = 0; nc < gmm::mat_ncols(t); ++nc) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor