z3str / Z3-str

A Z3-Based String Constraint Solver
Other
87 stars 13 forks source link

Installation of Z3-str on Mac OS X #5

Closed mmicu closed 8 years ago

mmicu commented 8 years ago

Following the readme for the installation, I'm stuck on point 5. After changing the path of z3 directory, I get different errors when I execute 'make'.

ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've found this thread that specifies this kind of error. It seems that it's impossible to solve the error since, the use of 'static'. I report the message from the the thread:

This option will not work on Mac OS X unless all libraries (including libgcc.a) 
have also been compiled with -static. Since neither a static version of libSystem.dylib 
nor crt0.o are provided, this option is not useful to most people.
z3str commented 8 years ago

Hi, one thing you could try is to remove "-fopenmp", "-static", "-lrt" keywords from the Makefile. The following is a note about buiding z3-str from a Mac user:

Compile and build Z3-str2 using GCC 4.9

1. install gcc 4.9 (i installed it using brew)

    Make sure 9++-4.9 is used instead of default g++

2. Modify the Makefile for mac

    a. Remove "-fopenmp", "-static", "-lrt" keywords from the Makefile

3. make
mmicu commented 8 years ago

Hi, thank you for the answer. I've already modified the Makefile in that way, in order to find a solution. I also wrote a thread on stackoverflow. Anyway, I did not find a solution. I get this error:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1

with this Makefile:

default: all

Z3_path = /Users/mat/z3

JUNK = str
SOURCE = *.cpp
INCLUDE = $(Z3_path)/lib
LIB = $(Z3_path)/bin/external

all: $(SOURCE)
    @echo ">> Z3 Source Dir: "$(Z3_path)
    @echo ""
    g++ -O3 -std=c++11 -I$(INCLUDE) -L$(LIB) $(wildcard *.cpp) -lz3 -o str -Wall
    @echo ""

clean:
    rm -f $(JUNK)

Content of path LIB is:

libz3.a 
z3

Thank you for your help.

z3str commented 8 years ago

Thanks for the feedback! I just made some changes to the Makefile. I also updated the installation descriptions for Mac. Could you please try and let me know whether it works? Thanks!

mmicu commented 8 years ago

You're welcome. Now it works, thank you! (In the readme, there is an "error" when you execute $./Z3-str2.py -f test/concat-002 since the name of the directory is tests instead of test)

z3str commented 8 years ago

Oops. Fixed.