-
Notifications
You must be signed in to change notification settings - Fork 6
Description
If vxl is built without TIFF and GEOTIFF, then pyvxl will produce an error when importing vxl.vpgl:
ImportError: site-packages/vxl/vpgl/_vpgl.so: undefined symbol: _ZTI15vpgl_geo_camera
This is because in vxl/core/vpgl/file_formats (which is linked to by vpgl), the CMakeLists.txt file guards vpgl_geo_camera.cxx by TIFF_FOUND and GEOTIFF_FOUND flags. However, similar guards do not exist in pyvxl/vpgl/pyvpgl.cxx around definitions that use vpgl_geo_camera.
One solution to this problem would be to replicate the guards in pyvpgl.cxx using exported -D definitions, or splitting pyvpgl.cxx into two files and guarding the one of them in the pyvxl/vpgl/CMakeLists.txt file to mirror vxl/core/vpgl/file_formats/CMakeLists.txt.
However, I think this solution is pretty brittle. For one, this is in no way an isolated problem. A lot of files in vxl are guarded by SOME_LIBRARY_FOUND flag and replicating this guarding in pyvxl seems like it would be hard to keep in sync.
Another alternative might be to try something done in dlib, which is to use CMake to actually see if the symbol exists. See here for example. The problem with this approach is it simply moves the brittleness from the structure of the guards in the CMakeLists.txt files to the symbol names in vxl. Perhaps this may be more stable though...