mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	Disable the Python bindings by default which partially fixes issue #404.
To enable the Python bindings use the newly added ``--python`` option.
This commit is contained in:
		
							parent
							
								
									3d01246f71
								
							
						
					
					
						commit
						e9ea687bb9
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
					@ -79,7 +79,7 @@ TRACE = False
 | 
				
			||||||
DOTNET_ENABLED=False
 | 
					DOTNET_ENABLED=False
 | 
				
			||||||
JAVA_ENABLED=False
 | 
					JAVA_ENABLED=False
 | 
				
			||||||
ML_ENABLED=False
 | 
					ML_ENABLED=False
 | 
				
			||||||
PYTHON_INSTALL_ENABLED=True
 | 
					PYTHON_INSTALL_ENABLED=False
 | 
				
			||||||
STATIC_LIB=False
 | 
					STATIC_LIB=False
 | 
				
			||||||
VER_MAJOR=None
 | 
					VER_MAJOR=None
 | 
				
			||||||
VER_MINOR=None
 | 
					VER_MINOR=None
 | 
				
			||||||
| 
						 | 
					@ -612,6 +612,7 @@ def display_help(exit_code):
 | 
				
			||||||
    print("  --dotnet                      generate .NET bindings.")
 | 
					    print("  --dotnet                      generate .NET bindings.")
 | 
				
			||||||
    print("  --java                        generate Java bindings.")
 | 
					    print("  --java                        generate Java bindings.")
 | 
				
			||||||
    print("  --ml                          generate OCaml bindings.")
 | 
					    print("  --ml                          generate OCaml bindings.")
 | 
				
			||||||
 | 
					    print("  --python                      generate Python bindings.")
 | 
				
			||||||
    print("  --staticlib                   build Z3 static library.")
 | 
					    print("  --staticlib                   build Z3 static library.")
 | 
				
			||||||
    if not IS_WINDOWS:
 | 
					    if not IS_WINDOWS:
 | 
				
			||||||
        print("  -g, --gmp                     use GMP.")
 | 
					        print("  -g, --gmp                     use GMP.")
 | 
				
			||||||
| 
						 | 
					@ -642,14 +643,14 @@ def display_help(exit_code):
 | 
				
			||||||
# Parse configuration option for mk_make script
 | 
					# Parse configuration option for mk_make script
 | 
				
			||||||
def parse_options():
 | 
					def parse_options():
 | 
				
			||||||
    global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, VS_PAR, VS_PAR_NUM
 | 
					    global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, VS_PAR, VS_PAR_NUM
 | 
				
			||||||
    global DOTNET_ENABLED, JAVA_ENABLED, ML_ENABLED, STATIC_LIB, PREFIX, GMP, FOCI2, FOCI2LIB, PYTHON_PACKAGE_DIR, GPROF, GIT_HASH
 | 
					    global DOTNET_ENABLED, JAVA_ENABLED, ML_ENABLED, STATIC_LIB, PREFIX, GMP, FOCI2, FOCI2LIB, PYTHON_PACKAGE_DIR, GPROF, GIT_HASH, PYTHON_INSTALL_ENABLED
 | 
				
			||||||
    global LINUX_X64, SLOW_OPTIMIZE, USE_OMP
 | 
					    global LINUX_X64, SLOW_OPTIMIZE, USE_OMP
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        options, remainder = getopt.gnu_getopt(sys.argv[1:],
 | 
					        options, remainder = getopt.gnu_getopt(sys.argv[1:],
 | 
				
			||||||
                                               'b:df:sxhmcvtnp:gj',
 | 
					                                               'b:df:sxhmcvtnp:gj',
 | 
				
			||||||
                                               ['build=', 'debug', 'silent', 'x64', 'help', 'makefiles', 'showcpp', 'vsproj',
 | 
					                                               ['build=', 'debug', 'silent', 'x64', 'help', 'makefiles', 'showcpp', 'vsproj',
 | 
				
			||||||
                                                'trace', 'dotnet', 'staticlib', 'prefix=', 'gmp', 'foci2=', 'java', 'parallel=', 'gprof',
 | 
					                                                'trace', 'dotnet', 'staticlib', 'prefix=', 'gmp', 'foci2=', 'java', 'parallel=', 'gprof',
 | 
				
			||||||
                                                'githash=', 'x86', 'ml', 'optimize', 'noomp', 'pypkgdir='])
 | 
					                                                'githash=', 'x86', 'ml', 'optimize', 'noomp', 'pypkgdir=', 'python'])
 | 
				
			||||||
    except:
 | 
					    except:
 | 
				
			||||||
        print("ERROR: Invalid command line option")
 | 
					        print("ERROR: Invalid command line option")
 | 
				
			||||||
        display_help(1)
 | 
					        display_help(1)
 | 
				
			||||||
| 
						 | 
					@ -708,6 +709,8 @@ def parse_options():
 | 
				
			||||||
            ML_ENABLED = True
 | 
					            ML_ENABLED = True
 | 
				
			||||||
        elif opt in ('', '--noomp'):
 | 
					        elif opt in ('', '--noomp'):
 | 
				
			||||||
            USE_OMP = False
 | 
					            USE_OMP = False
 | 
				
			||||||
 | 
					        elif opt in ('--python'):
 | 
				
			||||||
 | 
					            PYTHON_INSTALL_ENABLED = True
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            print("ERROR: Invalid command line option '%s'" % opt)
 | 
					            print("ERROR: Invalid command line option '%s'" % opt)
 | 
				
			||||||
            display_help(1)
 | 
					            display_help(1)
 | 
				
			||||||
| 
						 | 
					@ -1339,6 +1342,9 @@ class PythonInstallComponent(Component):
 | 
				
			||||||
        self.in_prefix_install = True
 | 
					        self.in_prefix_install = True
 | 
				
			||||||
        self.libz3Component = libz3Component
 | 
					        self.libz3Component = libz3Component
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not PYTHON_INSTALL_ENABLED:
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if IS_WINDOWS:
 | 
					        if IS_WINDOWS:
 | 
				
			||||||
            # Installing under Windows doesn't make sense as the install prefix is used
 | 
					            # Installing under Windows doesn't make sense as the install prefix is used
 | 
				
			||||||
            # but that doesn't make sense under Windows
 | 
					            # but that doesn't make sense under Windows
 | 
				
			||||||
| 
						 | 
					@ -1365,7 +1371,7 @@ class PythonInstallComponent(Component):
 | 
				
			||||||
            assert not os.path.isabs(self.pythonPkgDir)
 | 
					            assert not os.path.isabs(self.pythonPkgDir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def final_info(self):
 | 
					    def final_info(self):
 | 
				
			||||||
        if not PYTHON_PACKAGE_DIR.startswith(PREFIX):
 | 
					        if not PYTHON_PACKAGE_DIR.startswith(PREFIX) and PYTHON_INSTALL_ENABLED:
 | 
				
			||||||
            print("Warning: The detected Python package directory (%s) is not "
 | 
					            print("Warning: The detected Python package directory (%s) is not "
 | 
				
			||||||
                  "in the installation prefix (%s). This can lead to a broken "
 | 
					                  "in the installation prefix (%s). This can lead to a broken "
 | 
				
			||||||
                  "Python API installation. Use --pypkgdir= to change the "
 | 
					                  "Python API installation. Use --pypkgdir= to change the "
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue