Giter Site home page Giter Site logo

Comments (7)

irfansharif avatar irfansharif commented on June 7, 2024

Are you using bazel for your build? For now this library comes with the caveat that you need to use bazel (though PRs to make it work with make/etc. are welcome, just not something I'll get to until a month or two). https://github.com/irfansharif/allocator/tree/210808.debuggability is an example of a package that uses this library if you want pointers on how.

from solver.

RobinKamps avatar RobinKamps commented on June 7, 2024

Can you please give an example/advice how to build a project with this library as a dependency?
(with the included top Makefile a project like the following main.go is not working)

package main

import (
	"github.com/irfansharif/solver"
	"log"
)

func main() {
	model := solver.NewModel("test")

	var numVals int64 = 3
	x := model.NewIntVar(0, numVals-1, "x")
	y := model.NewIntVar(0, numVals-1, "y")
	z := model.NewIntVar(0, numVals-1, "z")

	ct := solver.NewAllDifferentConstraint(x, y, z)
	model.AddConstraints(ct)

	result := model.Solve()
	log.Printf("optimal result: %v", result.Optimal())
	log.Printf("x: %v, y: %v, z: %v", result.Value(x), result.Value(y), result.Value(z))
}

from solver.

irfansharif avatar irfansharif commented on June 7, 2024

https://github.com/irfansharif/allocator is one example (https://github.com/irfansharif/allocator/tree/210808.debuggability is a branch using a more recent version of this library).

from solver.

RobinKamps avatar RobinKamps commented on June 7, 2024

Thank you very much.

from solver.

thomaspeugeot avatar thomaspeugeot commented on June 7, 2024

I agree with @RobinKamps , it would be most welcomed to have something simpler for compiling with dependencies.
Go is the promise of a simple toolchain and I feel like "pre go" times with bazel & makefile & long compile time. I would have contributed for this with pleasure but I am not at all familiar with the techniques involved.

from solver.

irfansharif avatar irfansharif commented on June 7, 2024

There’s a C++ dependency involved, and consequently cgo; some of this pain is unavoidable. What I’ve seen work for dependencies like this is linking against pre-built binary archives for various architectures and distributing that as part of the library itself. That’s a sizeable amount of work however and I’m unlikely to be able to do it.

from solver.

thomaspeugeot avatar thomaspeugeot commented on June 7, 2024

Ok, I understand. I surmise this is the kind of work they have done with the sqlite3 wrap. Thks for your answer.

from solver.

Related Issues (4)

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.