0

On Pop!_OS 22.04 LTS x86_64, I am trying to install libLAS-1.8.1 from source (downloaded as a targz2)(as a dependency of ESRI - 3DForests. I am following the official? tutorial but am stuck.

"Issue" 1: Per the guide, I need to -

$ cd liblas 
$ mkdir makefiles 
$ cd makefiles
$ cmake -G "Unix Makefiles"

However, this gives -

CMake Error: The source directory "/home/sd/myApps/libLAS-1.8.1/makefiles" does not appear to contain CMakeLists.txt.

So I instead add the following, and it works (for now) -

$ cmake -G "Unix Makefiles" -S "./.."

Issue 2: (The actual issue) When I do make, the following error occurs:

/home/sd/myApps/libLAS-1.8.1/src/../include/liblas/detail/binary.hpp:28:10: fatal error: boost/detail/endian.hpp: No such file or directory

I verify (using ls) that the file "/usr/include/boost/endian/endian.hpp" does indeed exist. Next I search around and it seems I need to add it to CMake path, for which I do -

export CPATH=/usr/include/boost

This however does not help. And I keep getting the error.

Any help as to why this is happening and how I can fix this is much appreciated. Also, I believe there are binaries for liblas on "DebianGIS's" repositories. Is there any way to get and install that on other debian based OSs'?

EDIT1:

Per a comment, tried deleting the directory and doing it again (after export CPATH). Didn't work.

The following is the full error line, reading which again, makes me think that it was looking for the endian.hpp within the sourcefiles.

/home/sd/myApps/libLAS-1.8.1/src/../include/liblas/detail/binary.hpp:28:10: fatal error: boost/detail/endian.hpp: No such file or directory

Doing find, I see the file exists.

sd@pop-os:~/myApps/libLAS-1.8.1$ find ~/myApps/libLAS-1.8.1 -type f -iname *endian.hpp 
/home/sd/myApps/libLAS-1.8.1/include/liblas/detail/endian.hpp 
sd@pop-os:~/myApps/libLAS-1.8.1$

EDIT2:

Per suggestion of user @steeldriver, downloaded the source using git clone (was using the targz2 before). This fixed it.

6
  • It should be looking for (and finding) its own modified endian.hpp rather than your system's /usr/include/boost/endian.hpp I think Commented May 11 at 12:11
  • ... if it took a few attempts to get the cmake command right then it may have cached some bad values - if you haven't already done so, delete the makefiles directory and start over with a new empty one. fyi cmake .. should be sufficient (no need for -G or -S but the .. for "parent directory" is important) Commented May 11 at 12:28
  • will try this and update Commented May 11 at 13:07
  • Please use the edit button to add the full information to your question. Did you git clone the repo, or download it by some other means? Commented May 11 at 13:23
  • Yeah sorry. Updated it now. well it was available as a tar.gz2 archive. Should I try doing git clone? Commented May 11 at 13:28

1 Answer 1

1

AFAIK the preferred way to add header search paths in cmake is via CMAKE_INCLUDE_PATH rather than CPATH - so the appropriate command would be

cmake -DCMAKE_INCLUDE_PATH=/usr/include/boost ..

however that won't help in this case since it's looking for <boost/detail/endian.hpp> whereas your system has <boost/endian/endian.hpp>. The tutorial notes

Warning: You need Boost version 1.38.0 or higher to build libLAS 1.6.

whereas the version of Boost on Pop!OS / Ubuntu 22.04 is 1.74; endian.hpp seems to have been moved to its own endian library since at least 1.71.

The issue was raised here Boost : New versions and new endian.hpp location on the project's sporadically maintained github repository - the solution seems to have been to add a private (modified?) copy of the endian.hpp header file into the project source at include/liblas/detail and change the include directive to

#include <liblas/detail/endian.hpp>

The source code in the libLAS-1.8.1.tar.bz2 tarball from the tutorial's linked download page does not appear to reflect this fix - instead you will need to clone or download the zip from the github repo directly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .