Author: | Michael Rosen |
---|---|
Contact: | unknown at lizardtech dot com |
Date: | 3/19/2012 |
Note
OSGeo4W contains a pre-built up-to-date 64 bit Windows binary. It is fully-featured, and if you do not need anything custom, it is likely the fastest way to get going.
See also
Docker describes a way to get a PDAL build and all of its dependencies. If you just want to apply PDAL commandline operations to data, this mechanism is likely to be much faster than compiling your own.
If you just want to build PDAL so you can
you are OK with doing all this with a 32 bit compiler, check the Prerequisites and follow the Basic Build Steps below.
If your needs go beyond this, then check the Prerequisites and use the Advanced Build Steps below as a guide to configuring the library.
The steps below assume that these tools are available from your command line. For Git and CMake, that’s just adding them to your %PATH%. For VStudio, you need to run vsvars32.bat (“Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat”)
Most users can use this procedure to build PDAL on Windows. We satisfy all dependencies using OSGeo4W.
0. If you plan to use LAZ support (compressed LAS), get the LASzip source code and build it (http://www.laszip.org). Add the directory with laszip.dll to your %PATH% (or copy the laszip.* files into the bin directory of PDAL itself). Make sure it appears in your PATH before OSGeo4W (as per step 4 below).
While LASzip is included in the OSGeo4W distribution below (see step 1), the version there is compiled with Visual Studio 2008 and we have some suspicion that it is incompatible with the version of PDAL you are about to build with Visual Studio 2010. Building the LASzip library should be no more complicated than:
set G="Visual Studio 10"
set BUILD_TYPE=Debug
cmake -G %G% ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_VERBOSE_MAKEFILE=OFF ^
.
1. Install OSGeo4W (http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe) using the “Advanced Install” option and include the following: gdal-dev, laszip, libxml2, iconv.
![]()
- Install from Internet
![]()
- Leave the “Root Directory” for the installation unchanged.
![]()
- You can leave the “Select Local Package Directory” and “Internet Connection Type” at the defaults. Under the “libs” tree, select “gdal-dev” for installation. (You should probably use the latest version, e.g. 1.8pre-6.)
![]()
- Select “laszip” (this is not required currently – see step 0 above).
![]()
- Select “libxml2”.
![]()
- Select “iconv”.
![]()
- Select “oci”.
![]()
There are some other required dependencies (e.g. libtiff, libgeotiff) but they are installed by default.
Select Next to continue on to install the packages.
c:\dev> git clone https://github.com/PDAL/PDAL.git
c:\dev\PDAL> ./cmake/examples/mpg-config.batNote
The config.bat file is set up to build PDAL in the “officially supported” configuration – that is, with Oracle, and GDAL, and LASzip, and such. If you followed the previous steps, you should be fine to use this default configuration. You may modify this file if you need to (such as to use a local copy of GDAL or to use NMake instead of Visual Studio); see the Advanced Build Steps below for more instructions.
- PATH should include %OSGeo4W%bin
- GDAL_DATA should be set to %OSGeo4W%shareepsg_csv
- PROJ_LIB should be set to %OSGeo4W%shareproj
Start Visual Studio and open PDAL.sln. Build the solution (F6).
Set pdal_test as the startup project and run it (F5). You should see a console window startup, print something like “Running 158 test cases...” (exact number may vary), and then after a short period print something like “*** No errors detected”. If you do get errors, that means either something is broken on the version of PDAL you checked out OR something is wrong with your installation.
PYTHON/PLANG NOTE: If you build WITH_PLANG=ON in Debug mode, the system will try to link against “python27d.lib”. You need to change .../Python27/include/pyconfig.h as follows:
- change the line #pragma comment(lib,”python27d.lib”) to refer to python27.lib instead
- comment out the line “#define Py_DEBUG”
Advanced users can use this procedure to customize their PDAL build on Windows. This enables the use of custom-built external libraries to satisify situations (including x64 support) where using OSGeo4W is inadequate.
- GDAL (get version 1.6 or later from http://gdal.org) [ optional ]
- LASZip (get version 1.0.1 or later from http://laszip.org) [ optional ]
- libxml2 (http://libxml2.org) [ optional ]
- iconv (http://www.gnu.org/software/libiconv/) [ optional (required by libxml2) ]
- oci (optional, http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)
- libtiff (optional)
- libgeotiff (optional)
One option for all dependencies is OSGeo4W (free, win32 installer, no x64 – see “Basic Build Steps”_ above).
:: LASZIP set LASZIP_ENABLED=ON set LASZIP_LIBRARY=%DEV_DIR%\laszip\bin\Debug\laszip.lib set LASZIP_INCLUDE_DIR=%DEV_DIR%\laszip\include
:: Pick your Generator. NMake will pick up architecture (x32, x64) from your environment rem set GENERATOR="NMake Makefiles" rem set GENERATOR="Visual Studio 10 Win64" set GENERATOR="Visual Studio 10" set BUILD_TYPE=Release rem set BUILD_TYPE=Debug
c:\dev\PDAL> config.bat
Set pdal_test as the default/startup application in Visual Studio Run with debug (F5)
C:\OSGeo4W\bin
is on your system PATH variableC:\OSGeo4W\share\gdal
C:\OSGeo4W\share\proj