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: ...@@ -96,14 +96,14 @@ if get_platform() == PLATFORM_WINDOWS:
# somehow we need to add glut32.dll manually # somehow we need to add glut32.dll manually
def find_glut32(start_dir, filename="glut32.dll"): glut32_dll = find_filename_below_dirs([sys.prefix], "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)
if glut32_dll: if glut32_dll:
data.append((os.path.basename(glut32_dll), glut32_dll, "BINARY")) 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): def get_pixbuf_loaders_prefix(gtk_loaders_dir):
prefix = [] prefix = []
......
...@@ -98,17 +98,7 @@ def is_multiprocessing_enabled(): ...@@ -98,17 +98,7 @@ def is_multiprocessing_enabled():
def is_server_mode_available(): def is_server_mode_available():
# the following definition should be kept in sync with the wiki: # the following definition should be kept in sync with the wiki:
# http://sf.net/apps/mediawiki/pycam/?title=Parallel_Processing_on_different_Platforms # http://sf.net/apps/mediawiki/pycam/?title=Parallel_Processing_on_different_Platforms
if pycam.Utils.get_platform() == pycam.Utils.PLATFORM_WINDOWS: return is_multiprocessing_available()
if hasattr(sys, "frozen") and sys.frozen:
return False
else:
return True
else:
try:
import multiprocessing
return True
except ImportError:
return False
def get_number_of_processes(): def get_number_of_processes():
if __num_of_processes is None: if __num_of_processes is None:
...@@ -195,12 +185,7 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None, ...@@ -195,12 +185,7 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None,
remote = None remote = None
run_server = None run_server = None
server_credentials = "" server_credentials = ""
try: if not is_multiprocessing_available():
import multiprocessing
mp_is_available = True
except ImportError:
mp_is_available = False
if not mp_is_available:
__multiprocessing = False __multiprocessing = False
# Maybe a multiprocessing feature was explicitely requested? # Maybe a multiprocessing feature was explicitely requested?
# Issue some warnings if necessary. # 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