| 1 |
Known issues |
| 2 |
============ |
| 3 |
|
| 4 |
In addition to the issues noted below, you can refer to our |
| 5 |
`bug tracker on GitHub <https://github.com/brian-team/brian2/issues?q=is%3Aopen+is%3Aissue+label%3Abug>`__. |
| 6 |
|
| 7 |
.. contents:: List of known issues |
| 8 |
:local: |
| 9 |
|
| 10 |
Cannot find msvcr90d.dll |
| 11 |
------------------------ |
| 12 |
|
| 13 |
If you see this message coming up, find the file |
| 14 |
``PythonDir\Lib\site-packages\numpy\distutils\mingw32ccompiler.py`` |
| 15 |
and modify the line ``msvcr_dbg_success = build_msvcr_library(debug=True)`` to read |
| 16 |
``msvcr_dbg_success = False`` (you can comment out the existing line and add the new line |
| 17 |
immediately after). |
| 18 |
|
| 19 |
"AttributeError: MSVCCompiler instance has no attribute 'compiler_cxx'" |
| 20 |
----------------------------------------------------------------------- |
| 21 |
|
| 22 |
This is caused by a bug in some versions of numpy on Windows. The easiest solution is to |
| 23 |
update to the latest version of numpy. |
| 24 |
|
| 25 |
If that isn't possible, a hacky solution is to modify the numpy code directly to fix the |
| 26 |
problem. The following change may work. |
| 27 |
Modify line 388 of ``numpy/distutils/ccompiler.py`` from ``elif not self.compiler_cxx:`` to |
| 28 |
``elif not hasattr(self, 'compiler_cxx') or not self.compiler_cxx:``. If the line |
| 29 |
number is different, it should be nearby. Search for ``elif not self.compiler_cxx`` in |
| 30 |
that file. |
| 31 |
|
| 32 |
"Missing compiler_cxx fix for MSVCCompiler" |
| 33 |
------------------------------------------- |
| 34 |
|
| 35 |
If you keep seeing this message, do not worry. It's not possible for us to |
| 36 |
hide it, but doesn't indicate any problems. |
| 37 |
|
| 38 |
Problems with numerical integration |
| 39 |
----------------------------------- |
| 40 |
|
| 41 |
In some cases, the automatic choice of numerical integration method will not be |
| 42 |
appropriate, because of a choice of parameters that couldn't be determined in |
| 43 |
advance. In this case, typically you will get nan (not a number) values in the |
| 44 |
results, or large oscillations. In this case, Brian will generate a warning to |
| 45 |
let you know, but will not raise an error. |
| 46 |
|
| 47 |
Jupyter notebooks and C++ standalone mode progress reporting |
| 48 |
------------------------------------------------------------ |
| 49 |
|
| 50 |
When you run simulations in C++ standalone mode and enable progress reporting |
| 51 |
(e.g. by using ``report='text'`` as a keyword argument), the progress will not |
| 52 |
be displayed in the jupyter notebook. If you started the notebook from a |
| 53 |
terminal, you will find the output there. Unfortunately, this is a tricky |
| 54 |
problem to solve at the moment, due to the details of how the jupyter notebook |
| 55 |
handles output. |
| 56 |
|
| 57 |
Parallel Brian simulations with C++ standalone |
| 58 |
---------------------------------------------- |
| 59 |
|
| 60 |
Simulations using the C++ standalone device will create code and store results |
| 61 |
in a dedicated directory (``output``, by default). If you run multiple |
| 62 |
simulations in parallel, you have to take care that these simulations do not |
| 63 |
use the same directory – otherwise, everything from compilation errors to |
| 64 |
incorrect results can happen. Either chose a different directory name for each |
| 65 |
simulation and provide it as the ``directory`` argument to the |
| 66 |
`.set_device` or `~.Device.build` call, or use ``directory=None`` which |
| 67 |
will use a randomly chosen unique temporary directory (in ``/tmp`` on |
| 68 |
Unix-based systems) for each simulation. If you need to know the directory name, |
| 69 |
you can access it after the simulation run via ``device.project_dir``. |
| 70 |
|
| 71 |
.. _parallel_cython: |
| 72 |
|
| 73 |
Parallel Brian simulations with Cython on machines with NFS (e.g. a computing cluster) |
| 74 |
-------------------------------------------------------------------------------------- |
| 75 |
|
| 76 |
Generated Cython code is stored in a cache directory on disk so that it can be reused |
| 77 |
when it is needed again, without recompiling it. Multiple simulations running in |
| 78 |
parallel could interfere during the compilation process by trying to generate the same |
| 79 |
file at the same time. To avoid this, Brian uses a file locking mechanism that ensures |
| 80 |
that only a process at a time can access these files. Unfortunately, this file locking |
| 81 |
mechanism is very slow on machines using the Network File System |
| 82 |
(`NFS <https://en.wikipedia.org/wiki/Network_File_System>`_), which is often the case on |
| 83 |
computing clusters. On such machines, it is recommend to use an independent cache |
| 84 |
directory per process, and to disable the file locking mechanism. This can be done with |
| 85 |
the following code that has to be run at the beginning of each process:: |
| 86 |
|
| 87 |
from brian2 import * |
| 88 |
import os |
| 89 |
cache_dir = os.path.expanduser(f'~/.cython/brian-pid-{os.getpid()}') |
| 90 |
prefs.codegen.runtime.cython.cache_dir = cache_dir |
| 91 |
prefs.codegen.runtime.cython.multiprocess_safe = False |
| 92 |
|
| 93 |
|
| 94 |
Slow C++ standalone simulations |
| 95 |
------------------------------- |
| 96 |
|
| 97 |
Some versions of the GNU standard library (in particular those used by recent |
| 98 |
Ubuntu versions) have a bug that can dramatically slow down simulations in |
| 99 |
C++ standalone mode on modern hardware (see :issue:`803`). As a workaround, Brian will |
| 100 |
set an environment variable ``LD_BIND_NOW`` during the execution of standalone |
| 101 |
simulations which changes the way the library is linked so that it does not |
| 102 |
suffer from this problem. If this environment variable leads to unwanted |
| 103 |
behaviour on your machine, change the |
| 104 |
`prefs.devices.cpp_standalone.run_environment_variables` preference. |
| 105 |
|
| 106 |
Cython fails with compilation error on OS X: ``error: use of undeclared identifier 'isinf'`` |
| 107 |
-------------------------------------------------------------------------------------------- |
| 108 |
|
| 109 |
Try setting the environment variable ``MACOSX_DEPLOYMENT_TARGET=10.9``. |
| 110 |
|
| 111 |
CMD windows open when running Brian on Windows with the Spyder 3 IDE |
| 112 |
-------------------------------------------------------------------- |
| 113 |
|
| 114 |
This is due to the interaction with the integrated ipython terminal. Either change the |
| 115 |
run configuration to "Execute in an external system terminal" or patch the internal |
| 116 |
Python function used to spawn processes as described in github issue :issue:`1140`. |