conda-forge / pdal-feedstock

A conda-smithy repository for pdal.
BSD 3-Clause "New" or "Revised" License
3 stars 19 forks source link

On Ubuntu, libpdalcpp.so is not versioned so cannot be found by cmake for dependent projects #70

Open connormanning opened 5 years ago

connormanning commented 5 years ago

The PDAL libs installed on Ubuntu look like this:

(entwine) ubuntu@ip-172-31-28-152:~/miniconda3/envs/entwine$ ls lib/libpdal*
lib/libpdal_base.so                                    lib/libpdal_plugin_reader_nitf.so.9.0.1
lib/libpdal_base.so.8                                  lib/libpdal_plugin_reader_numpy.so
lib/libpdal_base.so.9.0.1                              lib/libpdal_plugin_reader_numpy.so.8
lib/libpdal_plugin_filter_gridprojection.so            lib/libpdal_plugin_reader_numpy.so.9.0.1

...

lib/libpdal_plugin_reader_icebridge.so.8               lib/libpdal_util.so
lib/libpdal_plugin_reader_icebridge.so.9.0.1           lib/libpdal_util.so.8
lib/libpdal_plugin_reader_nitf.so                      lib/libpdal_util.so.9.0.1
lib/libpdal_plugin_reader_nitf.so.8                    lib/libpdalcpp.so

The libpdalcpp.so lib does not have a versioned instance installed. For Entwine, a dependent project that links PDAL as a dependency, this means that cmake cannot find the PDAL library:

[22/45] Linking CXX shared library libentwine.so.2.0.0
FAILED: libentwine.so.2.0.0 
: && /usr/bin/g++ -fPIC -O3 -DNDEBUG   -shared -Wl,-soname,libentwine.so.2 -o libentwine.so.2.0.0 entwine/formats/cesium/CMakeFiles/formats.dir/tileset.cpp.o

...

entwine/util/CMakeFiles/util.dir/executor.cpp.o  -Wl,-rpath,/home/ubuntu/miniconda3/envs/entwine/lib: -ldl -lpdalcpp /home/ubuntu/miniconda3/envs/entwine/lib/libcurl.so /home/ubuntu/miniconda3/envs/entwine/lib/libssl.so /home/ubuntu/miniconda3/envs/entwine/lib/libcrypto.so && :
/usr/bin/ld: cannot find -lpdalcpp
collect2: error: ld returned 1 exit status

Apparently when cmake cannot find a lib (which is the case here), it uses the library name with -l, rather than the full path, hoping that it's sitting someplace like /usr/lib, which explains the lack of Conda path in the link line for PDAL.

abellgithub commented 5 years ago

Why does the versioned instance need to exist?

hobu commented 5 years ago

https://github.com/PDAL/PDAL/commit/a642d6c23622d6e6004436565b9ee493dd297ac5 should have fixed this issue