Comments (7)
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.
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.
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.
Thank you very much.
from solver.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solver.