Monday, March 25, 2013

Build the basic liblas for 64 bit Windows (no GDAL and GeoTIFF support)

In order to build 64 bit Windows binaries of liblas, the header files and 64 bit binaries for Boost must be accessible by Microsoft Visual Studio. The CMake utility from http://www.cmake.org needs to be used to configure and generate the Microsoft Visual Studio project files for liblas. The following illustrates how I build the basic liblas 64 bit binaries (no GDAL or GeoTIFF support). Note that the 64-bit executables may not run successfully even though the compilation is successful depending on how the source code was written.
  1. Download the latest liblas source code from http://www.liblas.org/download.html. Extract the files to a folder e.g. E:\Work\src\liblas-1.7.0\.
  2. On the Windows Desktop, select Start | All Programs | CMake 2.8 | CMake (cmake-gui).

    The CMake application appears.
  3. In the Where is the source code field, click Browse Source.

    The Browse for Folder dialog box appears.
  4. Select the folder where the liblas archive was extracted, e.g. E:\Work\src\libLAS-1.7.0\. Click OK.
  5. In the Where to build the binaries field, click Browse Build.

    The Browse for Folder dialog box appears.
  6. Select or create the folder where the Microsoft Visual Studio solution project files will be created e.g. E:\Work\src\libLAS-1.7.0\bin\. Click OK.

  7. Click Configure.

    A prompt appears.
  8. In the combo box, choose a generator for this project e.g. Visual Studio 10 Win64. Click Finish.

    A Error message appears.
  9. Close the message.

  10. In the list box, select Boost_INCLUDE_DIR. Then click the browse [...] button.

    The Browse For Folder dialog box appears.
  11. Choose the root folder containing Boost e.g. E:\Work\src\boost_1_52_0\. Click OK.

    Note: the boost folder containing the header include files should be underneath the root folder.
  12. Click Configure again.

    The configuration files are created.
  13. Click Generate.

    The Microsoft Visual Studio project files are generated the specified destination build folder.
  14. Close CMake.
  15. Run Microsoft Visual Studio 2010. Open up the libLAS.sln file.
  16. Press F7 to build all the projects.

    The 64 bit liblas binaries are generated.

1 comment:

Tisham Dhar said...

I have successfully built with GDAL 64 bit binaries from http://www.gisinternals.com/sdk/ and Geotiff according to your instructions. Had to add chrono from Boost into CMake by hand. I will try to publish my relese win_x64 build for those in need.