kwiver icon indicating copy to clipboard operation
kwiver copied to clipboard

``tools/kwiver_tools_applet_export.h`` required even when tools flag OFF

Open Purg opened this issue 6 years ago • 4 comments

I'm having an issue with building with the following CMake parameters. A single-threaded make will encounter the following error:

$ make                                                                                                                                                      
[  0%] Built target gen_symlinks                                                                                                                                                    
[  0%] Configuring version.h file "/home/purg/dev/kwiver/source/vital/version.h.in" -> "/home/purg/dev/kwiver/build-master/vital/version.h"                                         
-- Source Path       : '/home/purg/dev/kwiver/source/vital/version.h.in'                                                                                                            
-- Intermediate Path : '/home/purg/dev/kwiver/build-master/configure.version.h.output'                                                                                              
-- Output Path       : '/home/purg/dev/kwiver/build-master/vital/version.h'                                                                                                         
-- Project Root      : '/home/purg/dev/kwiver/source'                                                                                                                               
-- Found Git: /usr/bin/git (found version "2.14.5")                                                                                                                                 
-- version: 1.3.0                                                                                                                                                                   
-- git hash: 1c68cbfc0873bbfd744d2f6867db601556e21736                                                                                                                               
-- git short hash: 1c68cbfc0                                                                                                                                                        
-- git dirty:                                                                                                                                                                       
[  0%] Built target configure-version.h                                                                                                                                             
[  0%] Built target kwiver_configure                                                                                                                                                
[  4%] Built target kwiversys                                                                                                                                                       
[  5%] Built target vital_logger                                                                                                                                                    
[  7%] Built target vital_exceptions                                                                                                                                                
[ 11%] Built target vital_util                                                                                                                                                      
[ 13%] Built target vital_vpm                                                                                                                                                       
[ 15%] Built target vital_config                                                                                                                                                    
[ 28%] Built target vital                                                                                                                                                           
[ 43%] Built target vital_algo                                                                                                                                                      
[ 59%] Built target kwiver_algo_core                                                                                                                                                
[ 60%] Built target kwiver_algo_core_plugin                                                                                                                                         
[ 60%] Building CXX object arrows/core/applets/CMakeFiles/kwiver_algo_core_applets.dir/register_applets.cxx.o                                                                       
In file included from /home/purg/dev/kwiver/source/arrows/core/applets/render_mesh.h:34:0,                                                                                          
                 from /home/purg/dev/kwiver/source/arrows/core/applets/register_applets.cxx:39:                                                                                     
/home/purg/dev/kwiver/source/tools/kwiver_applet.h:34:10: fatal error: tools/kwiver_tools_applet_export.h: No such file or directory                                                
 #include <tools/kwiver_tools_applet_export.h>                                                                                                                                      
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                      
compilation terminated.                                                                                                                                                             
make[2]: *** [arrows/core/applets/CMakeFiles/kwiver_algo_core_applets.dir/build.make:63: arrows/core/applets/CMakeFiles/kwiver_algo_core_applets.dir/register_applets.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:444: arrows/core/applets/CMakeFiles/kwiver_algo_core_applets.dir/all] Error 2                                                                    
make: *** [Makefile:152: all] Error 2                                                                                                                                               

If I turn on KWIVER_ENABLE_TOOLS then this error "goes away". Subsequently turning that option off and rebuilding does not trigger the same error because that header file is now generated in the expected location. make clean will not remove the generated header file regardless of the state of the KWIVER_ENABLE_TOOLS flag, so the "tools" directory needs to be rm -r'd and KWIVER_ENABLE_TOOLS needs to be turned off again before the error can be reproduced with the same build tree.

KWIVER CMake params:

CMAKE_BUILD_TYPE=DEBUG
KWIVER_ENABLE_SPROKIT=ON
KWIVER_ENABLE_ARROWS=ON
KWIVER_ENABLE_GDAL=ON
KWIVER_ENABLE_OPENCV=ON
KWIVER_ENABLE_PROJ=ON
KWIVER_ENABLE_TOOLS=OFF
fletch_DIR=/home/purg/dev/fletch/build-master

With Fletch master build with parameters:

CMAKE_BUILD_TYPE=DEBUG
fletch_BUILD_WITH_CUDA=ON
fletch_BUILD_WITH_PYTHON=ON
fletch_ENABLE_Boost=ON
Boost_SELECT_VERSION=1.65.1
fletch_ENABLE_GDAL=ON
GDAL_SELECT_VERSION=2.3.2
fletch_ENABLE_GLog=ON
fletch_ENABLE_GTest=ON
fletch_ENABLE_OpenCV=ON
fletch_ENABLE_OpenCV_contrib=ON
OpenCV_SELECT_VERSION=3.4.0
fletch_ENABLE_PROJ4=ON
fletch_ENABLE_ZeroMQ=ON

Purg avatar Feb 18 '19 22:02 Purg

I'm assigning this to @linus-sherrill. I think he was aware of this (or at least related issues) already and was planning to fix them. There should be no public headers (generated or otherwise) in the tools directory. All of the tool support code needs to be moved into vital. tools should primarily contain only contain the actual kwiver tool runner.

mleotta avatar Feb 19 '19 03:02 mleotta

The immediate problem is that arrows/core/applets is built even if TOOLS has not been enabled. The applet is looking for the export header for the library. One possible solution is to condition building the applets on the TOOLS enable option.

linus-sherrill avatar Feb 19 '19 15:02 linus-sherrill

@linus-sherrill, that sounds like something that could be done in the short term before addressing the larger issue that @mleotta described. Is conditioning the building of arrows/core/applets on KWIVER_ENABLE_TOOLS straight forward?

Purg avatar Feb 19 '19 15:02 Purg

It is a short term fix and adding the if should be easy

linus-sherrill avatar Feb 19 '19 16:02 linus-sherrill