tudelft3d / prepair

Automatic repair of single polygons (according to the OGC Simple Features / ISO19107 rules) using a constrained triangulation.
GNU General Public License v3.0
115 stars 24 forks source link

build error when using OS X 10.10 and homebrew gdal #19

Closed Ylannl closed 9 years ago

Ylannl commented 9 years ago

When I try to compile prepair from source, I get an error about an OGR header file:

build $ cmake ..
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: Release
-- USING CXXFLAGS = ' -O3 -DNDEBUG'
-- USING EXEFLAGS = ' '
-- Targetting Unix Makefiles
-- Using /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ compiler.
-- DARWIN_VERSION=14
-- Mac Leopard detected
-- Requested component: MPFR
-- Requested component: GMP
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   program_options
-- Found GDAL: /usr/local/Cellar/gdal/1.11.2_2/lib/libgdal.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ravi/git/prepair/build
build $ make
Scanning dependencies of target prepair
[ 25%] Building CXX object CMakeFiles/prepair.dir/TriangleInfo.cpp.o
[ 50%] Building CXX object CMakeFiles/prepair.dir/PolygonRepair.cpp.o
In file included from /Users/ravi/git/prepair/PolygonRepair.cpp:22:
In file included from /Users/ravi/git/prepair/PolygonRepair.h:24:
/Users/ravi/git/prepair/definitions.h:35:10: fatal error: 'gdal/ogrsf_frmts.h' file not found
#include <gdal/ogrsf_frmts.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/prepair.dir/PolygonRepair.cpp.o] Error 1
make[1]: *** [CMakeFiles/prepair.dir/all] Error 2
make: *** [all] Error 2

As far as I can tell, the header file is present on my system, just not in the gdal directory that prepair expects:

build $ ls -lash /usr/local/include/ogrsf_frmts.h 
8 lrwxr-xr-x  1 ravi  admin    45B Aug  6 15:25 /usr/local/include/ogrsf_frmts.h -> ../Cellar/gdal/1.11.2_2/include/ogrsf_frmts.h

When I manually create a gdal directory and copy the OGR header files it works.

kenohori commented 9 years ago

Unfortunately, homebrew installs the GDAL headers straight in /usr/local, but most other methods put them in /usr/local/gdal. I don't know of any way to attempt fetch the headers from both locations, but I'd welcome any ideas!