Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2023 04:54:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 274061] graphics/gdal Fix TILEDB knob, tame a bit of overzealous cmake auto-feature creep for good measure
Message-ID:  <bug-274061-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274061

            Bug ID: 274061
           Summary: graphics/gdal Fix TILEDB knob, tame a bit of
                    overzealous cmake auto-feature creep for good measure
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: alt2600@icloud.com
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

Created attachment 245176
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D245176&action=
=3Dedit
git-fixtiledb-tamecmake.diff

amd64 13.2, live system building

With the update to tiledb the knob broke in gdal with the following error
during the tiledb module build

FAILED: frmts/tiledb/CMakeFiles/gdal_TileDB.dir/tiledbcommon.cpp.o=20
/usr/bin/c++ -DDONT_DEPRECATE_SPRINTF -DGDAL_COMPILATION -DTILEDB_DEPRECATE=
D=3D""
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/apps
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/alg
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/gcore
-I/usr/ports/graphics/gdal/work/.build/gcore
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/port
-I/usr/ports/graphics/gdal/work/.build/port
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/ogr
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/ogr/ogrsf_frmts
-I/usr/ports/graphics/gdal/work/gdal-3.7.2/frmts -O2 -pipe -march=3Dwestmer=
e=20
-DInt64=3Duint64_t -DLIBICONV_PLUG -fstack-protector-strong -isystem
/usr/local/include -fno-strict-aliasing   -DLIBICONV_PLUG -isystem
/usr/local/include -std=3Dc++17 -fno-finite-math-only -fvisibility=3Dhidden=
 -O2
-pipe -march=3Dwestmere  -DInt64=3Duint64_t -DLIBICONV_PLUG
-fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing=
=20=20
-DLIBICONV_PLUG -isystem /usr/local/include -std=3Dc++17  -DNDEBUG -std=3Dc=
++17
-flto=3Dthin -fPIC -Wall -Wextra -Winit-self -Wunused-parameter
-Wmissing-declarations -Wshorten-64-to-32 -Wshadow -Wshadow-field
-Wmissing-include-dirs -Wformat -Werror=3Dformat-security -Wno-format-nonli=
teral
-Werror=3Dvla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma
-Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync
-Wunused-private-field -Wnon-virtual-dtor -Woverloaded-virtual
-Wsuggest-override -fno-operator-names -Wzero-as-null-pointer-constant -MD =
-MT
frmts/tiledb/CMakeFiles/gdal_TileDB.dir/tiledbcommon.cpp.o -MF
frmts/tiledb/CMakeFiles/gdal_TileDB.dir/tiledbcommon.cpp.o.d -o
frmts/tiledb/CMakeFiles/gdal_TileDB.dir/tiledbcommon.cpp.o -c
/usr/ports/graphics/gdal/work/gdal-3.7.2/frmts/tiledb/tiledbcommon.cpp
In file included from
/usr/ports/graphics/gdal/work/gdal-3.7.2/frmts/tiledb/tiledbcommon.cpp:29:
In file included from
/usr/ports/graphics/gdal/work/gdal-3.7.2/frmts/tiledb/tiledbheaders.h:50:
In file included from /usr/local/include/tiledb/tiledb:49:
In file included from /usr/local/include/tiledb/array.h:38:
In file included from /usr/local/include/tiledb/array_schema.h:38:
In file included from /usr/local/include/tiledb/attribute.h:38:
In file included from /usr/local/include/tiledb/context.h:38:
In file included from /usr/local/include/tiledb/config.h:39:
In file included from /usr/local/include/tiledb/utils.h:36:
In file included from /usr/local/include/tiledb/exception.h:39:
/usr/local/include/tiledb/type.h:51:9: error: token is not a valid binary
operator in a preprocessor subexpression
#if not defined(__clang__) && __GNUG__ && __GNUC__ < 5
    ~~~ ^
1 error generated.

after stubbing the pre-processor code into a test stub file and trying all =
the
compile options until the error stopped it building I found it was because
cmake compiler checks included in gdal explicitly auto enable this flag if
supported by the compiler -fno-operator-names . this is a problem because
tiledb type.h above uses not instead of ! to fix an issue for old gcc versi=
ons,
and that flag explicitly dis-allows using not over !. after fighting with c=
make
I eventually found TILEDB_CMAKE_BOOL_OFF=3D HAVE_FLAG_NO_OPERATOR_NAMES to
disable that check when tiledb is turned on and it now builds, and things l=
ike
qgis use it fine. Gdal upstream should likely disable that check entirely if
they want to support tiledb, I have no idea why a person would want that on,
unless its a standards thing, then maybe tiledb should change their header,=
 but
maybe can't given its for an old gcc version, I don't know. Given how many
times I ran make clean configure i noticed a few other greedy checks and so
found was to tame them. Basically disabling finding swig, python, jni, and =
java
given no bindings are listed, and it could cause issues given it doesn't
necessarily find the default python anyway, since python.mk is never invoke=
d.
Quality of life for live system ports builders to get closer to pkg repo
builds, though I tried some of these first as my initial thought was python
3.10 instead of 3.9 being found was somehow breaking the TILEDB knob, but it
appears unrelated. I think it will lead to wild and painful debugging should
someone stumble onto unregistered dependencies breaking their builds or hav=
ing
unpredictable builds because of cmake greed.

#On live system builds, triggers potential PR 262109 issue if swig is found=
, by
also calling FindPython routines.=20
#If python alone is found it also triggers the issue. Disable explicitly for
consistent builds given no bindings are built here, as well as jni/java for
good measure
CMAKE_ARGS+=3D -DCMAKE_DISABLE_FIND_PACKAGE_SWIG:BOOL=3Dtrue
-DCMAKE_DISABLE_FIND_PACKAGE_Python:BOOL=3Dtrue
-DCMAKE_DISABLE_FIND_PACKAGE_JNI:BOOL=3Dtrue
-DCMAKE_DISABLE_FIND_PACKAGE_Java:BOOL=3Dtrue

I also found that Jpeg-XL is greedily added in, but at least it seems to be=
 an
option maybe a knob can be added for GDAL_USE_JXL, I didn't disable at this
time as it wasn't causing issues, when it breaks I'll post a patch for the
knob. I figured that would require a PORTREVISION. I also found that it see=
ms
to automatically be doing LTO, but likely this is going to happen with the =
repo
builds too as it is likely just a compiler check. Unlike tiledb, its AVX ch=
ecks
do not seem to auto add AVX compiler flags, or maybe just lucky this isn't
doing much vector math. cmake is a wild build system.

anyway, TILEDB knob is now working again with the posted patch. I think
limiting the scope of cmake's wild finds is a good idea too, but you can ch=
ose
to use or not use as you see fit. Not sure if technically turning off python
finding should be a PORTREVISION, but since Swig wouldn't be there, I don't
think it would be doing any python in the port.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-274061-7788>