Commit 288caa53 authored by sumpfralle's avatar sumpfralle

merged r1099 (multi-CPU issue for Windows standalone executable)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1100 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent a7f3420d
......@@ -96,14 +96,14 @@ if get_platform() == PLATFORM_WINDOWS:
# somehow we need to add glut32.dll manually
def find_glut32(start_dir, filename="glut32.dll"):
for root, dirs, files in os.walk(start_dir):
if filename in files:
return os.path.join(root, filename)
return None
glut32_dll = find_glut32(sys.prefix)
glut32_dll = find_filename_below_dirs([sys.prefix], "glut32.dll")
if glut32_dll:
data.append((os.path.basename(glut32_dll), glut32_dll, "BINARY"))
sys_path_dirs = os.environ["PATH"].split(os.path.pathsep)
gdkglext_dll = find_filename_below_dirs(sys_path_dirs,
"libgdkglext-win32-1.0-0.dll")
if gdkglext_dll:
data.append((os.path.basename(gdkglext_dll), gdkglext_dll, "BINARY"))
def get_pixbuf_loaders_prefix(gtk_loaders_dir):
prefix = []
......
......@@ -98,17 +98,7 @@ def is_multiprocessing_enabled():
def is_server_mode_available():
# the following definition should be kept in sync with the wiki:
# http://sf.net/apps/mediawiki/pycam/?title=Parallel_Processing_on_different_Platforms
if pycam.Utils.get_platform() == pycam.Utils.PLATFORM_WINDOWS:
if hasattr(sys, "frozen") and sys.frozen:
return False
else:
return True
else:
try:
import multiprocessing
return True
except ImportError:
return False
return is_multiprocessing_available()
def get_number_of_processes():
if __num_of_processes is None:
......@@ -195,12 +185,7 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None,
remote = None
run_server = None
server_credentials = ""
try:
import multiprocessing
mp_is_available = True
except ImportError:
mp_is_available = False
if not mp_is_available:
if not is_multiprocessing_available():
__multiprocessing = False
# Maybe a multiprocessing feature was explicitely requested?
# Issue some warnings if necessary.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment