Commit 8d05f052 authored by Ingo Meyer's avatar Ingo Meyer

Merge branch 'develop'

parents bf81bb38 81bdf267
......@@ -10,7 +10,7 @@ app:
shallow-app:
mkdir shallow-app
PATH=/usr/local/bin:${PATH} gr shallow-appify/shallow-appify.py -d ../../src/ -i ../../src/icon.png -e PATH PYTHONPATH DYLD_LIBRARY_PATH -o shallow-app/pyMolDyn.app ../../src/startGUI.py
PATH="/usr/local/bin:/usr/bin:/bin" PYTHONPATH="/usr/local/gr/lib/python" gr shallow-appify/shallow-appify.py -d ../../src/ -i ../../src/icon.png -e PATH PYTHONPATH -o shallow-app/pyMolDyn.app ../../src/startGUI.py
clean:
@for subdir in ${SUBDIRS}; do \
......
......@@ -2,8 +2,9 @@
SUBDIRS = computation gui util visualization config core statistics
all:
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) all; done
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) EXTRA_LD_FLAGS=$(EXTRA_LD_FLAGS) all; done
EXTRA_LD_FLAGS = -Wl,-rpath,/usr/local/gr/lib
app_extension_modules: clean all
clean:
......
__version_info__ = (0, 9, 5)
__version_info__ = (0, 9, 6)
__version__ = '.'.join(map(str, __version_info__))
......@@ -2,7 +2,7 @@
SUBDIRS = calculation
all:
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) all; done
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) EXTRA_LD_FLAGS=$(EXTRA_LD_FLAGS) all; done
clean:
rm -f *.pyc *.pyo
......
......@@ -2,7 +2,7 @@
SUBDIRS = extension
all:
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) all; done
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) EXTRA_LD_FLAGS=$(EXTRA_LD_FLAGS) all; done
clean:
rm -f *.pyc *.pyo
......
......@@ -11,7 +11,7 @@ import core.file
from core.file import File
from algorithm import CavityCalculation, DomainCalculation, FakeDomainCalculation
from discretization import DiscretizationCache, AtomDiscretization
import util.message as message
from util import message
from hashlib import sha256
from config.configuration import config
from util.logger import Logger
......
CFLAGS = -O3
INCLUDES := $(shell ./build-flags --include-flags gr)
ifeq ($(PYLIBPATH),)
LDFLAGS := $(shell ./build-flags --lib-flags gr)
LDFLAGS := $(shell ./build-flags --lib-flags gr) $(EXTRA_LD_FLAGS)
else
LDFLAGS := -L$(PYLIBPATH)/python2.7/site-packages/gr3/ -lGR3
LDFLAGS := -L$(PYLIBPATH)/python2.7/site-packages/gr3/ -lGR3 $(EXTRA_LD_FLAGS)
endif
SUBDIRS=
......
# -*- coding: utf-8 -*-
import sys
from util import message
from util.logger import Logger
__all__ = ["atomstogrid",
"mark_cavities",
......@@ -7,6 +10,9 @@ __all__ = ["atomstogrid",
"cavity_intersections",
"mark_translation_vectors"]
logger = Logger("core.calculation")
logger.setstream("default", sys.stdout, Logger.WARNING)
try:
from extension_ctypes import atomstogrid, \
mark_cavities, \
......@@ -14,8 +20,9 @@ try:
cavity_intersections, \
mark_translation_vectors
except OSError as e:
print e.__repr__()
print "Falling back to Python functions"
logger.warn(e.__repr__())
logger.warn("Falling back to Python functions")
message.log("C extensions could not be loaded, falling back to Python functions. Calculations may be very slow!")
from extension_python import atomstogrid, \
mark_cavities, \
cavity_triangles, \
......
......@@ -14,6 +14,9 @@ _finish = None
_error = None
_log = None
# Buffer log messages if no valid log callback is set
_log_buffer = []
def print_message(*args):
if callable(_print_message):
......@@ -38,6 +41,8 @@ def error(*args):
def log(*args):
if callable(_log):
return _log(*args)
else:
_log_buffer.append(args)
def set_output_callbacks(progress_func, print_func, finished_func, error_func, log_func):
......@@ -48,3 +53,8 @@ def set_output_callbacks(progress_func, print_func, finished_func, error_func, l
_finish = finished_func
_error = error_func
_log = log_func
if _log_buffer and _log:
for log_args in _log_buffer:
_log(*log_args)
del _log_buffer[:]
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