[pdal] Building pdal 1.3.0 under Windows
Charles Karney
charles.karney at sri.com
Thu Oct 20 14:10:52 PDT 2016
Thanks for the feedback. We expect to compile all the dependencies
separately, so we'll end up doing something rather different.
Nevertheless, it's good to have your script as a starting point.
By the way, I would normally compile, test, and install with
cmake --build . --config Release
cmake --build . --config Release --target RUN_TESTS
cmake --build . --config Release --target INSTALL
(This obviates the need to run vcvarsall.bat.)
--Charles
On 10/20/16 04:39, Kristian Evers wrote:
> Charles,
>
> I use the script below to set up cmake for Visual Studio 2015 on Windows 7. It took me quite a while to find a setup that worked, but in the end I settled on building with VS2015 inside an OSGeo4W shell. Most dependencies are met this way. The remaining dependencies, boost and hexer, for the configuration below I had to build myself. Boost and hexer dll's need to be in the system search path if I remember correctly. If you don't need hexbin I think you can do without both boost and hexer, but I am not entirely sure about that.
>
> /Kristian
>
> ---------------------------------------pdal_cmake_setup.bat--------------------------------------
> @echo off
> REM Run this to get access to the Microsoft command line build stuff:
> REM
> REM "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
> REM
> REM Run script from build directory, e.g. C:\dev\pdal_build
> REM Build with:
> REM
> REM devenv PDAL.sln /Build "Release|x64"
> REM
> REM Run tests:
> REM
> REM ctest -V --output-on-failure -C Release
> REM
>
> set OSGEO4W_ROOT=C:\OSGeo4W64
> set BUILD_TYPE=Release
> set BOOST_ROOT=C:\lib\boost_1_61_0
>
>
> cmake -G "Visual Studio 14 2015 Win64" ^
> -DBoost_DEBUG=OFF ^
> -DBOOST_ROOT=%BOOST_ROOT% ^
> -DBUILD_PLUGIN_CPD=OFF ^
> -DBUILD_PLUGIN_GEOWAVE=OFF ^
> -DBUILD_PLUGIN_GREYHOUND=OFF ^
> -DBUILD_PLUGIN_HEXBIN=ON ^
> -DBUILD_PLUGIN_ICEBRIDGE=OFF ^
> -DBUILD_PLUGIN_MATLAB=OFF ^
> -DBUILD_PLUGIN_MRSID=OFF ^
> -DBUILD_PLUGIN_NITF=OFF ^
> -DBUILD_PLUGIN_OCI=OFF ^
> -DBUILD_PLUGIN_P2G=OFF ^
> -DBUILD_PLUGIN_PCL=OFF ^
> -DBUILD_PLUGIN_PGPOINTCLOUD=OFF ^
> -DBUILD_PLUGIN_PYTHON=ON ^
> -DBUILD_PLUGIN_RIVLIB=OFF ^
> -DBUILD_PLUGIN_SQLITE=OFF ^
> -DENABLE_CTEST=OFF ^
> -DWITH_APPS=ON ^
> -DWITH_LAZPERF=OFF ^
> -DWITH_GEOTIFF=ON ^
> -DWITH_LASZIP=ON ^
> -DWITH_TESTS=ON ^
> -DPYTHON_LIBRARY=%OSGEO4W_ROOT%\apps\python27\libs\python27.lib ^
> -DPYTHON_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\python27\include ^
> -DNUMPY_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\python27\lib\site-packages\numpy\core\include ^
> -DNUMPY_VERSION=1.11.0 ^
> -Dgtest_force_shared_crt=ON ^
> -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
> -DCMAKE_INSTALL_PREFIX=C:\bin\PDAL ^
> C:\dev\PDAL\
> ---------------------------------------------------------------------------------------------------------
>
>
>
>> -----Oprindelig meddelelse-----
>> Fra: pdal [mailto:pdal-bounces at lists.osgeo.org] På vegne af Howard Butler
>> Sendt: 19. oktober 2016 21:32
>> Til: Charles Karney
>> Cc: pdal
>> Emne: Re: [pdal] Building pdal 1.3.0 under Windows
>>
>>
>>> On Oct 19, 2016, at 1:48 PM, Charles Karney <charles.karney at sri.com>
>> wrote:
>>>
>>> I've started investigating using pdal as a substitute for liblas for
>>> reading point cloud data. I have it building under Linux OK (with
>>> cmake). I having problems building under Windows (this is pdal 1.3.0):
>>>
>>> (1) A required dependency is geos. The seems to require Visual Studio
>>> 2013 or later. This comes from
>>>
>>> geos/tests/xmltester/XMLTester.cpp
>>>
>>> expecting std::round to be defined in <cmath>. Is this right? Or can I
>>> skip the tests in geos and compile with Visual Studio 2012 as well.
>>
>> You should be fine to skip the tests there. I didn't realize GEOS gave up on
>> 2012, but maybe this wasn't intentional.
>>
>>>
>>> (2) curl appears to be an optional dependency (cmake does not insist
>>> that it be found). And yet
>>>
>>> pdal/src/PDALUtils.cpp
>>>
>>> includes vendor/arbiter/arbiter.hpp and this tries to do
>>>
>>> #include <curl/curl.h>
>>>
>>> (3) Installing curl (for Visual Studio 2013 this time) and building with
>>> cmake hits an error on line 898 or pdal/util/Utils.hpp:
>>>
>>> error C2144: syntax error : 'std::underlying_type<_Ty>::type' should
>>> be preceded by ';'
>>>
>>> This looks like some new-fangled C++11 stuff which perhaps Visual Studio
>>> 2013 doesn't recognize.
>>
>> PDAL definitely has requirement for the new-fangled C++11 stuff, which was
>> the deal with the devil we made to (almost entirely) ditch Boost (we have a
>> small embedded copy of a few things that are about to be ditched in 1.4 or
>> 1.5 PDAL release). That probably means 2013 *might* work, but we only
>> auto-build stuff with 2015. We are happy to take patches to get that down to
>> 2013 as long as they aren't too disruptive, but we can't back off of the C++11
>> stuff because it's sprinkled throughout the codebase now.
>>
>>
>> I'll also note that none of the very active PDAL developers are windows-first
>> devs, and we're happy to take patches to bolster that particular topic. The
>> effort done on the AppVeyor builds have mostly been an attempt to prevent
>> things from diverging so far that we could never get windows happy again,
>> but they haven't been there to keep windows a first class operator with
>> PDAL.
>>
>> IMO, curl should be an optional dependency, and I see that our AppVeyor
>> builds [1] are failing because of it. AppVeyor uses MSVC 19.0.24215.1 (MSVC
>> 2015). Run [2] to ground to see what we're doing for our windows builds. I
>> will try to clean up the curl thing so we degrade gracefully without that
>> library.
>>
>> [1] https://ci.appveyor.com/project/hobu/pdal
>> [2] https://github.com/PDAL/PDAL/blob/master/appveyor.yml
>>
>>>
>>> I'm happy to delve into this further. But I thought I should first
>>> align my expectations with those of the developer:
>>>
>>> With what versions of Visual Studio should I expect success?
>>> I've attempting to build it with
>>> gdal 2.1.1
>>> LASzip 2.2.0
>>> eigen 3.2.8
>>> geos 3.5.0
>>> curl (maybe) 7.39.0
>>> Should I expect this combination to work?
>>
>> PDAL embeds a copy of eigen at the moment. This may or may not be a
>> problem for you depending on what you're doing. That should be fixable
>> though with some CMake tweaks.
>>
>> Count on any windows-specific patches getting merged as long as they don't
>> regress our C++11 situation too much. We've been waiting on a champion for
>> this particular topic.
>>
>> Howard
>>
>>
>> _______________________________________________
>> pdal mailing list
>> pdal at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pdal
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pdal
>
--
Charles Karney <charles.karney at sri.com>
SRI International, Princeton, NJ 08543-5300
Tel: +1 609 734 2312
Fax: +1 609 734 2662
More information about the pdal
mailing list