Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OnSignal work on windows #35

Closed
bayerj opened this issue Sep 23, 2015 · 1 comment
Closed

Make OnSignal work on windows #35

bayerj opened this issue Sep 23, 2015 · 1 comment

Comments

@bayerj
Copy link
Contributor

bayerj commented Sep 23, 2015

There is an issue with FORTAN libraries replacing signal handlers and not being able to recover them:

http://stackoverflow.com/questions/15457786/ctrl-c-crashes-python-after-importing-scipy-stats

The solution is to

Add to climin/__init__.py:

if sys.platform == 'win32':
  basepath = imp.find_module('numpy')[1]
  ctypes.CDLL(os.path.join(basepath, 'core', 'libmmd.dll'))
  ctypes.CDLL(os.path.join(basepath, 'core', 'libifcoremd.dll'))

And then extend OnSignal with

import win32api
win32api.SetConsoleCtrlHandler(self._console_ctrl_handler, 1)

in the windows case.

After that, climin has to be imported before scipy by the user.

@msoelch
Copy link
Contributor

msoelch commented Jul 12, 2016

Has been added to init.py.

@msoelch msoelch closed this as completed Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants