Coder Social home page Coder Social logo

clingo-cs's Introduction

Hello world! 💚

local NEKERAFA = {
  fullname = "Rafa Alcalde Azpiazu",
  pronoums = "They/Them",
  location = "A Coruña - Galiza (Spain)",
  languages = {"galician", "spanish", "english"},
  engines = {"Godot", "LÖVE", "PyGame", "OneLua", "Unity"},
  currently_working = "https://github.com/NEKERAFA/CAH-twitch"
}

GitHub stats Top Languages

clingo-cs's People

Contributors

nekerafa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clingo-cs's Issues

Solve callbacks crashes Cities: Skylines

Problem in notifyCallback with out bool[] goon parameter. I think that it a issue from Mono.

Msg:
System.Runtime.InteropServices.MarshalDirectiveException: Byref array marshalling to managed code is not implemented.

adding clingo-cs to a C# project?

Hi Rafael,

Thank you for all your work making clingo-cs! I'm very interested in combining C# and Clingo. When clingo-cs is added to a project, will I then be able to follow the Python API example? Something like:

using Clingo-cs;
var ctl = clingo.Control()
ctl.add("base", [], "p(@id(10)). q(@seq(1,2)).");
ctl.ground([("base", [])], context=Context());

I've taken the following steps:

  1. downloaded clingo-cs from github as ZIP
  2. downloaded clingo-5.5.1, renamed it to "clingo", and placed it in clingo-cs-main
  3. created clingo\build\win and clingo\build\linux
  4. .\build.ps1 (success!)
  5. dotnet build --configuration Debug (partial success?)

clingo-cs-main\src\Clingo_cs\bin\Debug contains:
Clingo_cs.0.1.0.nupkg (11kb)
net6.0 (directory)

The net6.0 directory contains:
Clingo_c.dll (10kb)
Clingo_c.pdb (12kb)
Clingo_cs.deps.json (1kb)
Clingo_cs.dll (17kb)
Clingo_cs.pdb (17kb)
ref (directory)

The ref directory contains:
Clingo_cs.dll (10kb)

In Visual Studio, I created a package source entry for clingo-cs-main\src\Clingo_cs\bin\Debug and when I open Nuget and use this source, I see the option to install a single package:

Clingo_cs by Rafael Alcalde Azpiazu A C# bindings to the clingo library.

When I select that package, I see the following errors:

  • Package restore failed. Rolling back package changes for 'dle_clingo_cs_test' (my project)
  • NU1101 Unable to find package Clingo_c. No packages exist with this id in source(s): Local Clingo_CS, Microsoft Visual Studio Offline Packages dle_clingo_cs_test dle_clingo_cs_test\dle_clingo_cs_test D:\Documents\Programming\CSharp\dle_clingo_cs_test\dle_clingo_cs_test\dle_clingo_cs_test.csproj

Here are the detailed results of the build:

PS D:\Documents\Programming\CSharp\clingo-cs-main> dotnet build --configuration Debug
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
All projects are up-to-date for restore.
Clingo_c -> D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\bin\Debug\net6.0\Clingo_c.dll
C:\Program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'D:\Documents\Programming\CSharp\clingo-cs-main\clingo\build\linux\bin'. [D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\Clingo_c.csproj]
Clingo_cs -> D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_cs\bin\Debug\net6.0\Clingo_cs.dll
Clingo_cs.Tests -> D:\Documents\Programming\CSharp\clingo-cs-main\tests\bin\Debug\net6.0\Clingo_cs.Tests.dll

Build FAILED.

C:\Program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'D:\Documents\Programming\CSharp\clingo-cs-main\clingo\build\linux\bin'. [D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\Clingo_c.csproj]
0 Warning(s)
1 Error(s)

Building on Windows looks for /bin/linux?

I tried building clingo-cs on Mac, but ran into issues where it was looking for a .so library but Mac had built a .dylib. I wasn't sure how to fix this so I tried building on Windows - this results in the following error when performing the dotnet step:

C:\Program Files\dotnet\sdk\7.0.400\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'D:\clingo-cs\clingo\build\linux\bin'. [D:\clingo-cs\src\Clingo_c\Clingo_c.csproj]

The linux/bin folder doesn't exist becuase it's built a windows/bin folder instead - I'm not sure why the dotnet step is trying to find a Linux library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.