[gdal-dev] building on macOS - fatal error: 'direct.h' file not found

Paul Harwood runette at gmail.com
Wed Jun 29 05:18:48 PDT 2022


When I did some work on the csharp build scripts - I ended up building on
mac about 100 times with different configurations so - to state the obvious
- it does work!

That said - for various reasons that are not relevant here - I don't use
Homebrew. But I would be surprised if that is the problem.

You should not need any of the configuration items you have! Have you tried
just the basic build ?

Start with a clean repo (as Greg says -- make is very good at caching)

mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target install

provided the dependencies are actually all loaded, then that should work.

On Wed, 29 Jun 2022 at 02:50, <nik at nixanz.com> wrote:

> Thanks for all the replies so far.  I'm aim to work through them
> properly when I get time and expect to have some follow-up questions.
>
> For now, I just wanted to briefly address this comment:
>
> >
> > You can still build with Autotools!
> >
>
> For GDAL 3.5.x, this is true.  However, it is GDAL 3.6 (not yet
> released) that has the new features that I really need.  And on GDAL
> GitHub, it states:
>
> RFC 84:
> Addition of a CMake build system, which deprecates the existing
> autoconf/automake and nmake build systems, that will be removed
> in GDAL 3.6.0. Users are encouraged to adopt the new CMake build system.
> Documentation of the CMake build system is at
> https://gdal.org/build_hints.html.
>
> Therefore the purpose of this exercise is to get the CMake system
> working.  So if my understanding is correct, avoiding CMake is not an
> option for me if I want to use GDAL 3.6.
>
> Cheers,
> Nik.
>
> -----------------------------------------
>
> NIK SANDS
> Line Tamer | Time Traveller | Space Cadet
>
> On 2022-06-28 20:14, Mateusz Loskot wrote:
> > On Tue, 28 Jun 2022 at 03:28, Nik Sands <nik at nixanz.com> wrote:
> >> However, I’m getting numerous build errors, starting with the
> >> following error when running cmake to build GDAL 3.5.0:
> >>
> >>         fatal error: 'direct.h' file not found
> >
> > Check cmake command output for
> >
> > -- Looking for direct.h
> >
> > and what is the look-up result it reports.
> >
> > GDAL's CMake configuration checks for direct.h
> >
> https://github.com/OSGeo/gdal/blob/14be6dea87fd44dc58c3e6a2befb5913147ddbc7/cmake/helpers/configure.cmake#L38
> >
> >> I’m a hobbyist and not a professional developer, so my understanding
> >> of these things is quite limited.
> >
> > You can still build with Autotools!
> >
> >> However, my research so far indicates that ‘direct.h’ is a
> >> Windows-specific header file
> >
> > Correct.
> >
> >> and therefore perhaps cmake has not been configured correctly for
> >> macOS in this GDAL distribution?
> >
> > As per the earlier link, it's simple, it runs
> > `check_include_file("direct.h" HAVE_DIRECT_H)`
> > and if the header is found, then HAVE_DIRECT_H is set.
> > The CMake configuration does almost the same as the Autotools does:
> >
> https://github.com/OSGeo/gdal/blob/14be6dea87fd44dc58c3e6a2befb5913147ddbc7/configure.ac#L295
> >
> > Question is, is HAVE_DIRECT_H set on macOS or not.
> >
> > Best regards,
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220629/135c830b/attachment.htm>


More information about the gdal-dev mailing list