Bug 255216 - graphics/gdal: compiler error: unknown type name 'Int64'
Summary: graphics/gdal: compiler error: unknown type name 'Int64'
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
Depends on:
Reported: 2021-04-19 10:00 UTC by O. Hartmann
Modified: 2021-05-05 01:28 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)

[patch] fix compile error - missing #include for Imath header (783 bytes, patch)
2021-05-01 17:42 UTC, John Hein
no flags Details | Diff
[patch] fix compile error - missing #include for Imath header (+ allow parallel build) (1.13 KB, patch)
2021-05-01 19:48 UTC, John Hein
jcfyecrayz: maintainer-approval? (sunpoet)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2021-04-19 10:00:58 UTC
Recent update of graphics/gdal gives an error while compiling on recent 13-STABLE (FreeBSD 13.0-STABLE #12 stable/13-n245229-02816ecfb93: Fri Apr 16 13:07:52 CEST 2021 amd64) and recent 14-CURRENT (FreeBSD 14.0-CURRENT #7 main-n246069-112f007e128: Wed Apr 14 14:04:35 CEST 2021 amd64); ports tree is up to date:

c++ -I/usr/ports/graphics/gdal/work/gdal-3.2.1/port -I/usr/ports/graphics/gdal/work/gdal-3.2.1/gcore -I/usr/ports/graphics/gdal/work/gdal-3.2.1/alg -I/usr/ports/graphics/gdal/work/gdal-3.2.1/ogr -I/usr/ports/graphics/gdal/work/gdal-3.2.1/ogr/ogrsf_frmts -I/usr/ports/graphics/gdal/work/gdal-3.2.1/gnm -I/usr/ports/graphics/gdal/work/gdal-3.2.1/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -O2 -pipe  -fPIC -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -DLIBICONV_PLUG -isystem /usr/local/include -std=c++14  -fPIC  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough  -I/usr/local/include -I/usr/local/include/OpenEXR -I/usr/local/include/Imath  -DGNM_ENABLED -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -I/usr/ports/graphics/gdal/work/gdal-3.2.1/port -I/usr/local/include/openjpeg-2.4  -I/usr/local/include -I/usr -I/usr/include  -DGDAL_COMPILATION -DHAVE_XERCES -I/usr/local/include -I/usr/local/include/xercesc -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -I/usr/ports/graphics/gdal/work/gdal-3.2.1/port -I/usr/local/include/openjpeg-2.4  -I/usr/local/include -I/usr -I/usr/include  -DGDAL_COMPILATION -c -o ../o/exrdataset.o exrdataset.cpp
exrdataset.cpp:462:13: error: unknown type name 'Int64'; did you mean 'GInt64'?
    virtual Int64       tellg () override;
/usr/ports/graphics/gdal/work/gdal-3.2.1/port/cpl_port.h:267:26: note: 'GInt64' declared here
typedef GIntBig          GInt64;
Comment 1 John Hein 2021-05-01 17:42:47 UTC
Created attachment 224596 [details]
[patch] fix compile error - missing #include for Imath header

Same problem here.  It looks like this is missing #include "ImathInt64.h".  Probably an upstream problem (which may not work with the current version of ports' libImath), but also probably easily patched until fixed upstream.

Workaround: set EXR option off.

Fix is attached.  No need to bump PORTREVISION (just fixes build error and just for non-default option)
Comment 2 John Hein 2021-05-01 19:48:15 UTC
Created attachment 224598 [details]
[patch] fix compile error - missing #include for Imath header (+ allow parallel build)

patch v2: also remove MAKE_JOBS_UNSAFE=yes.  Builds fine now.  MAKE_JOBS_UNSAFE was added in 2009 many versions ago.  This reduces the build time substantially (6x in a quick experiment on a moderate 4-cpu build host).
Comment 3 commit-hook freebsd_committer 2021-05-04 21:51:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=66a03470a2924840d5ff13a874d93f95ed832d7b

commit 66a03470a2924840d5ff13a874d93f95ed832d7b
Author:     John Hein <jcfyecrayz@liamekaens.com>
AuthorDate: 2021-05-04 21:40:05 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-05-04 21:45:47 +0000

    graphics/gdal: Fix build with OpenEXR/Imath 3.0 (should be part of 9ab14902a13463a884c7446d358364ed5ee64088)

    - Remove MAKE_JOBS_UNSAFE [1]

    PR:             255216
    Reported by:    O. Hartmann <ohartmann@walstatt.org>
    Tested by:      John Hein <jcfyecrayz@liamekaens.com> [1]

 graphics/gdal/Makefile                                 |  1 -
 graphics/gdal/files/patch-frmts_exr_openexr__headers.h | 12 ++++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
Comment 4 Po-Chuan Hsieh freebsd_committer 2021-05-04 21:51:30 UTC
Committed. Thanks!
Comment 5 John Hein 2021-05-05 01:28:39 UTC
FYI, that patch file, patch-frmts_exr_openexr__headers.h, can go away when we update to 3.3.1.  Upstream has a fix.

See https://github.com/OSGeo/gdal/issues/3770