mirror of
https://github.com/Z3Prover/z3
synced 2025-06-09 23:53:25 +00:00
Add a hacky patch so that Z3 on M1 hardware can link to libs properly (#5974)
* Add a hacky patch so that Z3 on M1 hardware can link to libs properly * Update setup.py Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ddbe17d581
commit
7d47e45c6b
1 changed files with 16 additions and 3 deletions
|
@ -178,6 +178,20 @@ def _copy_bins():
|
||||||
continue
|
continue
|
||||||
shutil.copy(os.path.join(header_dir, fname), os.path.join(HEADERS_DIR, fname))
|
shutil.copy(os.path.join(header_dir, fname), os.path.join(HEADERS_DIR, fname))
|
||||||
|
|
||||||
|
# This hack lets z3 installed libs link on M1 macs; it is a hack, not a proper fix
|
||||||
|
# @TODO: Linked issue: https://github.com/Z3Prover/z3/issues/5926
|
||||||
|
major_minor = '.'.join(_z3_version().split('.')[:2])
|
||||||
|
link_name = None
|
||||||
|
if BUILD_PLATFORM in ('win32', 'cygwin', 'win'):
|
||||||
|
pass # TODO: When windows VMs work on M1, fill this in
|
||||||
|
elif BUILD_PLATFORM in ('darwin', 'osx'):
|
||||||
|
split = LIBRARY_FILE.split('.')
|
||||||
|
link_name = split[0] + '.' + major_minor + '.' + split[1]
|
||||||
|
else:
|
||||||
|
link_name = LIBRARY_FILE + '.' + major_minor
|
||||||
|
if link_name:
|
||||||
|
os.symlink(LIBRARY_FILE, os.path.join(LIBS_DIR, link_name), True)
|
||||||
|
|
||||||
def _copy_sources():
|
def _copy_sources():
|
||||||
"""
|
"""
|
||||||
Prepare for a source distribution by assembling a minimal set of source files needed
|
Prepare for a source distribution by assembling a minimal set of source files needed
|
||||||
|
@ -273,10 +287,10 @@ if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
|
||||||
osver = RELEASE_METADATA[3]
|
osver = RELEASE_METADATA[3]
|
||||||
if osver.count('.') > 1:
|
if osver.count('.') > 1:
|
||||||
osver = '.'.join(osver.split('.')[:2])
|
osver = '.'.join(osver.split('.')[:2])
|
||||||
if arch == 'x64':
|
if arch == 'x64':
|
||||||
plat_name ='macosx_%s_x86_64' % osver.replace('.', '_')
|
plat_name ='macosx_%s_x86_64' % osver.replace('.', '_')
|
||||||
elif arch == 'arm64':
|
elif arch == 'arm64':
|
||||||
plat_name ='macosx_%s_arm64' % osver.replace('.', '_')
|
plat_name ='macosx_%s_arm64' % osver.replace('.', '_')
|
||||||
else:
|
else:
|
||||||
raise Exception(f"idk how os {distos} {osver} works. what goes here?")
|
raise Exception(f"idk how os {distos} {osver} works. what goes here?")
|
||||||
else:
|
else:
|
||||||
|
@ -287,7 +301,6 @@ if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
|
||||||
sys.argv.insert(idx + 1, plat_name)
|
sys.argv.insert(idx + 1, plat_name)
|
||||||
sys.argv.insert(idx + 2, '--universal') # supports py2+py3. if --plat-name is not specified this will also mean that the package can be installed on any machine regardless of architecture, so watch out!
|
sys.argv.insert(idx + 2, '--universal') # supports py2+py3. if --plat-name is not specified this will also mean that the package can be installed on any machine regardless of architecture, so watch out!
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='z3-solver',
|
name='z3-solver',
|
||||||
version=_z3_version(),
|
version=_z3_version(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue