There are some code changes and compile settings required to compile z3 in AIX. Below are the steps. A patch (z3-aix.patch) containing the changes is attached in this thread.,
# Clone z3 4.15.4 (latest version) and apply the patch.
git clone https://github.com/Z3Prover/z3 --branch z3-4.15.4 --single-branch
cd z3
# get the patch here and apply it.
patch -p1 < z3-aix.patch
# Set compile parameters
export CXX="g++"
export CXXFLAGS="-pthread -maix64”
export CPPFLAGS="-D_H_VAR"
export LDFLAGS="-pthread -maix64”
export OBJECT_MODE=64
# Compile
python3 scripts/mk_make.py --prefix=/z3_install_dir
cd build
gmake -j8
# Compile and run the tests
gmake test
./test-z3 /a
#Install the files to /z3_install_dir
gmake install
# The shared library has .so extension. In AIX , better we archive it so that application can link to it using -lz3
cd /z3_install_dir/lib
ar -x64 -q libz3.a libz3.so