Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Fix build and a failing test #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mholtom
Copy link

@mholtom mholtom commented Dec 20, 2020

The latest version of z3 would fail to run the tests when built:

go test -v
# github.com/mitchellh/go-z3
/usr/bin/ld: ./libz3.a(hwf.o): undefined reference to symbol 'remainder@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
FAIL    github.com/mitchellh/go-z3 [build failed]

I have added a reference to the Math library with -lm to fix this problem.

When the tests built after applying the fix, there was a failing test:

=== RUN   ExampleFindModel2
--- FAIL: ExampleFindModel2 (0.01s)
got:
Solving part 1
x = 0
y = 1

Solving part 2
x = (- 1)
y = 0
want:
Solving part 1
x = 0
y = 1

Solving part 2
x = 0
y = 1
FAIL

Which I fixed to match the comment.

// x < y + 1 && x > 2

Also with the additional constraint:
// !(x == y)

Giving a new output:

go-z3/z3_examples_test.go

Lines 183 to 190 in 121f7c6

// Output:
// Solving part 1
// x = 3
// y = 3
//
// Solving part 2
// x = 3
// y = 4

@raulojeda22
Copy link

This commit solved my issue, thanks 👍

Troublor added a commit to Troublor/go-z3 that referenced this pull request Oct 17, 2021
@shenyimings
Copy link

Thank you very much! This solved my issue, and using the MAKEFILE you provided reduced the previously lengthy build time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants