rg2 / xreg

Library and executables for modeling and registration applications in medical image analysis. Particular emphasis on intraoperative fluoroscopic (X-ray) navigation via 2D/3D registration.
MIT License
94 stars 19 forks source link

Target Opencv contains Eigen3::Eigen but was not found. #21

Closed liushuya7 closed 1 year ago

liushuya7 commented 2 years ago

By running the example_build_script_2,I was able to build all the third-party packages, but when I tried to build xreg, I got the following error:

CMake Warning at apps/image_io/convert_resample_dicom/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-convert-dicom-vols because files in some directories may conflict with
  libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/report_dicom/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-report-dcm
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/crop_vol/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-crop-vol because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/remap_and_tile_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-remap-tile-proj-data because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/extract_nii_from_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-proj-data-extract-nii because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/add_lands_to_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-add-lands-to-proj-data because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/draw_xray_scene/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-draw-xray-scene
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/regi2d3d_replay/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-regi2d3d-replay
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/convert_rad_raw_to_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-convert-rad-raw-to-proj-data because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/convert_sta_raw_to_itk/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-convert-sta-raw-to-itk because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/convert_radiograph_dicom_to_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-convert-dicom-radiograph because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/make_video_from_image_dir/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-vid-from-img-dir
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/remap_dicom_dir/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-remap-dcm-dir
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/proj_cat/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-proj-cat because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/proj_make_fiducial_world/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-proj-make-fiducial-world because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/proj_est_orbital_rot/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-proj-est-orbital-rot because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/image_io/convert_spare_projs_to_proj_data/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-convert-spare-proj-data because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/mesh/create_mesh/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-create-mesh
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/mesh/show_mesh/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-show-mesh
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/mesh/sur_regi/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-sur-regi because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/point_clouds/print_lands/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-print-lands
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/point_clouds/xform_fcsv/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-xform-fcsv
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/create_fragment/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-pao-create-frag
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/draw_bones/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target xreg-pao-draw-bones
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/sample_frag_moves/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-pao-sample-frag-moves because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/create_repo_vol/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-pao-create-repo-vol because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/add_screw_kwires_to_vol/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-pao-add-screw-kwires-to-vol because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/create_synthetic_fluoro/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-pao-create-synth-fluoro because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pao/frag_multi_view_regi_2d_3d/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-pao-frag-mult-view-regi-2d-3d because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/hip_surgery/pelvis_single_view_regi_2d_3d/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-hip-surg-pelvis-single-view-regi-2d-3d because files in some
  directories may conflict with libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Warning at apps/transforms/print_rigid_transform/CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target
  xreg-print-rigid-xform because files in some directories may conflict with
  libraries in implicit directories:

    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/josh/bigss/xreg_ws/xreg_deps_install/tbb/lib/intel64/gcc4.7

  Some of these libraries may not be found correctly.

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:76 (set_target_properties):
  The link interface of target "opencv_core" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:83 (set_target_properties):
  The link interface of target "opencv_flann" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:90 (set_target_properties):
  The link interface of target "opencv_imgproc" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:97 (set_target_properties):
  The link interface of target "opencv_ml" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:104 (set_target_properties):
  The link interface of target "opencv_photo" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:111 (set_target_properties):
  The link interface of target "opencv_video" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:118 (set_target_properties):
  The link interface of target "opencv_dnn" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:125 (set_target_properties):
  The link interface of target "opencv_features2d" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:132 (set_target_properties):
  The link interface of target "opencv_imgcodecs" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:139 (set_target_properties):
  The link interface of target "opencv_shape" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:146 (set_target_properties):
  The link interface of target "opencv_videoio" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:153 (set_target_properties):
  The link interface of target "opencv_calib3d" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:160 (set_target_properties):
  The link interface of target "opencv_highgui" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:167 (set_target_properties):
  The link interface of target "opencv_objdetect" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:174 (set_target_properties):
  The link interface of target "opencv_stitching" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:181 (set_target_properties):
  The link interface of target "opencv_superres" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

CMake Error at /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVModules.cmake:188 (set_target_properties):
  The link interface of target "opencv_videostab" contains:

    Eigen3::Eigen

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/josh/bigss/xreg_ws/xreg_deps_install/share/OpenCV/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:104 (find_package)

Any help is appreciated!

liushuya7 commented 2 years ago

It seems like the OpenCV finds the system's Eigen instead. There was only "EIGEN3_DIR" not "EIGEN3_INCLUDE_DIR". This is the opencv cmake configuration: image

liushuya7 commented 2 years ago

The third-party packages eigen 3.3.4 and opencv 3.4.12 specified by this repo couldn't make xreg to be built on my Ubuntu 20.04 I solved it by building it with system's Eigen 3.3.7 and OpenCV 4.2.0 Two files need to be modified due to switching to opencv 4:

// file:xreg/lib/opencv/xregOpenCVUtils.cpp - line 484
// change
// cv::cvtColor(img, dst_img, CV_GRAY2BGR);
// to
 cv::cvtColor(img, dst_img, cv::COLOR_GRAY2BGR);

and

// file:xreg/lib/regi/sim_metrics_2d/xregImgSimMetric2DBoundaryEdgesCPU.cpp - line 64
// change
// cv::distanceTransform(fixed_edges, fixed_edge_dist_map_, CV_DIST_L2, CV_DIST_MASK_PRECISE);
// to
  cv::distanceTransform(fixed_edges, fixed_edge_dist_map_, cv::DIST_L2, cv::DIST_MASK_PRECISE);
liushuya7 commented 2 years ago

Seems like the real issue is that the opencv didn't link to the specified eigen3 during building.

liushuya7 commented 2 years ago

As of now, I can only build it by using system's Eigen 3.3.7 and OpenCV 4.2.0 So something must have gone wrong when building these two third-party packages using the example_build_script image

liushuya7 commented 2 years ago

Although I still don't know why, I think I finally figured out something that will make it work: if you set -DWITH_EIGEN:BOOL=OFF when building opencv, then xreg builds successfully depending on the third-party libraries specified in the _example_buildscript.

rg2 commented 2 years ago

Hi Joshua,

Thanks a lot for investigating this. It sounds like the following happened in your original problem:

I will try to reproduce this and add: 1. a change to the example build script and 2. a source code change that works with OpenCV 3 and 4. Maybe there will be more errors to fix - I am not sure until I can reproduce the problem.

Another potential solution is to 1. remove the local Eigen download and 2. remove the OpenCV build from the build script (2) and instead use the system versions of OpenCV and Eigen (I understand there was that compile error, but you have a fix for that).

rg2 commented 2 years ago

I was able to reproduce this issue with this minimal docker file:

FROM ubuntu:20.04

RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && apt-get install -y --no-install-recommends \
      build-essential \
      ca-certificates \
      cmake \
      wget \
      libssl-dev \
      git \
      cmake \
      ninja-build \
      libopencv-dev \
      libeigen3-dev \
      libglew-dev \
      libxt-dev \
      unzip && \
    rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/rg2/xreg.git xreg-git

RUN cd xreg-git && ./example_build_script_2
liushuya7 commented 2 years ago

Thanks, Rob, for taking a look at this!

I personally prefer using the built-in system dependencies if possible. I was experimenting if I can compile xreg using system libraries. I was able to successfully build it on my Ubuntu 20.04. The only thing that I need to do is to download VTK 9.2.2 and ITK 5.2.1 to compile them, then configure the path for xreg to find them during cmake.

The rest of the dependencies can be easily installed by:

sudo apt install libtbb-dev libfmt-dev libeigen3-dev libviennacl-dev libnlopt-cxx-dev libopencv-dev

and the cmake should find these system libraries automatically.

Although you do need to update some syntax since Ubuntu 20.04 has opencv4 by default, see d8c1e433986f92b308fdacab4fa9469733fd046d.

rg2 commented 2 years ago

I think if that works for you, then that's great! The example is just that, an example. Glad that you were able to get things going to meet your needs.

I will try to update the example so at least it does NOT result in an error.

rg2 commented 1 year ago

Closing this for now as I have merged #23, which should fix this issue when using the example build script when system versions of Eigen and OpenCV are also installed.