def generate_gecode_wrapper_constraints(packages_to_include_in_solve=nil)
      unless @gecode_wrapper
        packages_in_solve =
          if packages_to_include_in_solve
            packages_to_include_in_solve
          else
            packages.map{ |name, pkg| pkg }
          end

        logId = SecureRandom.uuid
        debugFlag = DebugOptionFile && File::exists?(DebugOptionFile)
        Debug.log.level = Logger::INFO unless debugFlag
        Debug.log.formatter = proc do |severity, datetime, progname, msg|
          "#{logId}: #{msg}\n"
        end

        # In addition to all the packages that the user specified,
        # there is a "ghost" package that contains the solution
        # constraints. See Selector#solve for more information.
        @gecode_wrapper = GecodeWrapper.new(packages_in_solve.size + 1, logId, debugFlag)
        packages_in_solve.each{ |pkg| pkg.generate_gecode_wrapper_constraints }
      end
    end
def generate_gecode_wrapper_constraints(packages_to_include_in_solve=nil)
      unless @gecode_wrapper
        packages_in_solve =
          if packages_to_include_in_solve
            packages_to_include_in_solve
          else
            packages.map{ |name, pkg| pkg }
          end

        logId = SecureRandom.uuid
        debugFlag = DebugOptionFile && File::exists?(DebugOptionFile)
        Debug.log.level = Logger::INFO unless debugFlag
        Debug.log.formatter = proc do |severity, datetime, progname, msg|
          "#{logId}: #{msg}\n"
        end

        # In addition to all the packages that the user specified,
        # there is a "ghost" package that contains the solution
        # constraints. See Selector#solve for more information.
        @gecode_wrapper = GecodeWrapper.new(packages_in_solve.size + 1, logId, debugFlag)
        packages_in_solve.each{ |pkg| pkg.generate_gecode_wrapper_constraints }
      end
    end
Note: only invoke this method once all Packages and
 PackageVersions have been added.