Skip to content

Conversation

Copy link

Copilot AI commented Oct 3, 2025

Problem

The CogUtil implementation was complete and functional, but had CMake configuration issues that prevented dependent projects from finding and linking to it properly. This caused several modules (robotics-embodied, cogserver, etc.) to be excluded from builds due to "missing CogUtil" errors.

Root Cause

The cogutil-config.cmake.in template was missing essential CMake helpers and compatibility variables needed for proper package discovery:

# Before - caused "Unknown CMake command" errors
check_required_components(cogutil)

Solution

Enhanced the CMake configuration to provide proper package support:

  1. Fixed Package Configuration: Updated cogutil-config.cmake.in to use CMakePackageConfigHelpers and include necessary CMake modules
  2. Added Compatibility Variables: Provided multiple variable names (COGUTIL_*, CogUtil_*) for different dependent projects
  3. Enhanced Build System: Updated CMakeLists.txt to use proper package configuration helpers
  4. Resolved Dependencies: Updated root build exclusions to reflect that CogUtil is no longer the blocking issue

Key Changes

  • Enhanced cogutil/cogutil-config.cmake.in with proper CMake helpers and compatibility variables
  • Updated cogutil/CMakeLists.txt to use configure_package_config_file()
  • Fixed cogutil/demo.sh path resolution
  • Updated root CMakeLists.txt dependency comments to reflect resolved CogUtil issues

Validation

The fix enables dependent projects to successfully find CogUtil:

# Before: Failed with "missing CogUtil"
cmake /path/to/robotics-embodied  # ❌ CogUtil not found

# After: CogUtil found successfully  
cmake /path/to/robotics-embodied  # ✅ CogUtil found, now fails on AtomSpace (expected)

Integration test confirms proper functionality:

#include <opencog/util/cogutil_minimal.h>
opencog::util::initialize_cogutil();  // ✅ Works
auto tensor = opencog::util::TensorUtils::createTensor();  // ✅ Works

Impact

  • robotics-embodied: No longer blocked by missing CogUtil dependency
  • Build System: Cleaner, more accurate dependency tracking
  • Future Projects: Reliable Foundation Layer available with proper CMake support
  • Backwards Compatibility: All existing functionality preserved

The CogUtil Foundation Layer (524,288 DOF tensor architecture) is now properly packaged and ready for use across the OpenCog ecosystem.

Original prompt

This section details on the original issue you should resolve

<issue_title>cogutil</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #6

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: drzo <15202748+drzo@users.noreply.github.com>
Copilot AI changed the title [WIP] cogutil Fix CogUtil CMake configuration and resolve dependency issues Oct 3, 2025
Copilot AI requested a review from drzo October 3, 2025 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cogutil

2 participants