SpiNNakerManchester / sPyNNaker8

The PyNN 0.8 interface to sPyNNaker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does pyNN-SpiNNaker support Python 3?

lungsi opened this issue · comments

In my Python 3 (3.7) environment I can successfully run pip install sPyNNaker8 but it fails for python -m spynnaker8.setup-pynn

PS: this is not an issue in my Python 2 (2.7) environment.

Hi,

Are you sure that "pip" and "python" are using python 3 and not python 2? You may find that depending upon how your machine / virtual environment is set up that you need to use "pip3" and "python3" instead.

The pip version doesn't support python3. If you want python3 support, you need to use the git version.

@andrewgait Yes I am sure both pip and python commands use python 3.

@rowleya Thanks! I just cloned https://github.com/SpiNNakerManchester/sPyNNaker8.git and then did pip install ./sPyNNaker8 which resulted in

Processing ./sPyNNaker8
Collecting SpiNNUtilities<1!5.0.0,>=1!4.0.1 (from sPyNNaker8==1!4.1.0)
  ERROR: Could not find a version that satisfies the requirement SpiNNUtilities<1!5.0.0,>=1!4.0.1 (from sPyNNaker8==1!4.1.0) (from versions: 4.0.0a1, 1!4.0.0a1, 1!4.0.0)
ERROR: No matching distribution found for SpiNNUtilities<1!5.0.0,>=1!4.0.1 (from sPyNNaker8==1!4.1.0)

I looked for SpiNNUtilies in https://github.com/SpiNNakerManchester but could not find it.

Thanks @andrewgait

I cloned the following

git clone https://github.com/SpiNNakerManchester/SpiNNUtils.git
git clone https://github.com/SpiNNakerManchester/SpiNNStorageHandlers.git
git clone https://github.com/SpiNNakerManchester/SpiNNMachine.git
git clone https://github.com/SpiNNakerManchester/PACMAN.git
git clone https://github.com/SpiNNakerManchester/DataSpecification.git
git clone https://github.com/SpiNNakerManchester/spalloc.git
git clone https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git
git clone https://github.com/SpiNNakerManchester/sPyNNaker.git
git clone https://github.com/SpiNNakerManchester/sPyNNaker8.git

then

pip install ./SpiNNUtils ./SpiNNStorageHandlers ./SpiNNMachine ./PACMAN ./DataSpecification ./spalloc ./SpiNNFrontEndCommon ./sPyNNaker ./sPyNNaker8

But when I did python -m spynnaker8.setup-pynn I got TypeError: unsupported operand type(s) for <<: 'float' and 'int'

Below is the resulting Traceback

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/__init__.py", line 23, in <module>
    from spynnaker8.models.connectors.all_to_all_connector import \
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/__init__.py", line 1, in <module>
    from .projection import Projection
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/projection.py", line 10, in <module>
    from spynnaker8.models.connectors import FromListConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/connectors/__init__.py", line 1, in <module>
    from .all_to_all_connector import AllToAllConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/connectors/all_to_all_connector.py", line 3, in <module>
    from spynnaker.pyNN.models.neural_projections.connectors import (
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/__init__.py", line 3, in <module>
    from .delayed_application_edge import DelayedApplicationEdge
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py", line 3, in <module>
    from .delayed_machine_edge import DelayedMachineEdge
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/delayed_machine_edge.py", line 3, in <module>
    from spynnaker.pyNN.models.neural_projections.connectors import (
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/connectors/__init__.py", line 1, in <module>
    from .abstract_connector import AbstractConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py", line 8, in <module>
    from spinn_front_end_common.utilities.utility_objs import ProvenanceDataItem
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/utilities/utility_objs/__init__.py", line 4, in <module>
    from .executable_targets import ExecutableTargets
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/utilities/utility_objs/executable_targets.py", line 4, in <module>
    from spinnman.model import ExecutableTargets as SuperExecTargets
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/model/__init__.py", line 3, in <module>
    from .chip_info import ChipInfo
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/model/chip_info.py", line 1, in <module>
    from spinnman.messages.spinnaker_boot import SystemVariableDefinition
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/messages/spinnaker_boot/__init__.py", line 2, in <module>
    from .spinnaker_boot_messages import SpinnakerBootMessages
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/messages/spinnaker_boot/spinnaker_boot_messages.py", line 26, in <module>
    _BOOT_DATA_OPERAND_1 = ((_BOOT_MESSAGE_DATA_BYTES / 4) - 1) << 8
TypeError: unsupported operand type(s) for <<: 'float' and 'int'

I think the problem there is that you've missed a repository, you also need SpiNNMan:

git clone https://github.com/SpiNNakerManchester/SpiNNMan.git

(and install as with the others).

Thanks. I did that and now have SpiNNMan installed but now I am getting

>>> python -m spynnaker8.setup-pynn
Detected PyNN version 0.9.4 and Neo version 0.6.1
/envs/py3-spinnaker/bin/python: No module named spynnaker8.setup-pynn

Is it because its PyNN 0.9.4 and not PyNN 0.8?

No, the script has been renamed in the git version to "spynnaker8.setup_pynn" (note the underscore).

@rowleya Thanks so much.
I can now successfully import pyNN-SpiNNaker

>>> import pyNN.spiNNaker as sim
Detected PyNN version 0.9.4 and Neo version 0.6.1

PS:
I did however notice that the output for sim.setup() is slightly different from that in python2.7. But I guess its just instructing me to create a .spynnaker.cfg (in python 2.7, by default a few .spynnaker.cfg were already created)

>>> sim.setup()
Unable to find config file in any of the following locations: 
['/etc/xdg/.spynnaker.cfg', '/root/.config/.spynnaker.cfg', '/root/.spynnaker.cfg', './spynnaker.cfg']
********************************************************
/root/.spynnaker.cfg has been created. 
Please edit this file and change "None" after "machineName" to the hostname or IP address of your SpiNNaker board, and change "None" after "version" to the version of SpiNNaker hardware you are running on:
[Machine]
machineName = None
version = None
***********************************************************

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/__init__.py", line 315, in setup
    n_chips_required=n_chips_required)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/spinnaker.py", line 94, in __init__
    front_end_versions=front_end_versions)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/abstract_spinnaker_common.py", line 99, in __init__
    front_end_versions=versions)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 335, in __init__
    self, configfile, default_config_paths, validation_cfg)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/config_handler.py", line 66, in __init__
    validation_cfg=validation_cfg)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_utilities/conf_loader.py", line 315, in load_config
    raise install_cfg_and_IOError(filename, defaults, config_locations)
spinn_utilities.configs.no_config_found_exception.NoConfigFoundException: Unable to find config file in any of the following locations: 
['/etc/xdg/.spynnaker.cfg', '/root/.config/.spynnaker.cfg', '/root/.spynnaker.cfg', './spynnaker.cfg']
********************************************************
/root/.spynnaker.cfg has been created. 
Please edit this file and change "None" after "machineName" to the hostname or IP address of your SpiNNaker board, and change "None" after "version" to the version of SpiNNaker hardware you are running on:
[Machine]
machineName = None
version = None
***********************************************************

>>> sim.end()
Ignoring call to stop/end as no simulator running
>>> 

Also, before closing this issue I am curious about two questions;

  1. Could you please confirm that the python3 compatible sPyNNaker8 (i.e. github version/non-pip version) works with PyNN > 0.8 and "We recommend using PyNN 0.8 for new work." applies only for the pip installable version?
  2. Since the command python -m spynnaker8.setup_pynn (or python -m spynnaker8.setup-pynn for the pip installable version) installs pyNN-SpiNNaker, i.e. installs pyNN, would the recommendation be not to install pyNN separately (or may be even have it already installed) from git clone https://github.com/NeuralEnsemble/PyNN.git?
  1. We recommend using PyNN >= 0.9 with the git release - PyNN 0.8 was the version at the last release.
  2. The setup_pynn script doesn't install pyNN - this is done when you do python setup.py install in sPyNNaker8, so it should install the latest pyNN version at that point.

@rowleya Thank you.

I am reopening this issue because although I have managed to install it I am not able to run the quick start example in the guidebook

After setting up the simulation

import numpy as np
import pyNN.spiNNaker as sim

sim.setup(timestep=1.0, min_delay=1.0)

# create cells
cell_params = {
    'cm': 0.25, 'tau_m': 10.0, 'tau_refrac': 2.0,
    'tau_syn_E': 2.5, 'tau_syn_I': 2.5,
    'v_reset': -70.0, 'v_rest': -65.0, 'v_thresh': -55.0}

neurons = sim.Population(100, sim.IF_cond_exp(**cell_params))
inputs = sim.Population(100, sim.SpikeSourcePoisson(rate=0.0))

# set input firing rates as a linear function of cell index
input_firing_rates = np.linspace(0.0, 1000.0, num=inputs.size)
inputs.set(rate=input_firing_rates)

# create one-to-one connections
wiring =  sim.OneToOneConnector()
static_synapse = sim.StaticSynapse(weight=0.1, delay=2.0)
connections = sim.Projection(inputs, neurons, wiring, static_synapse)

# configure recording
neurons.record('spikes')

and then invoking

# run simulation
sim_duration = 10.0 # seconds
sim.run(sim_duration * 1000.0)

It fails, returning ExecutableNotFoundException: IF_cond_exp.aplx

Below is the full output from invoking sim.run()

2019-06-18 14:59:24 INFO: Simulating for 10 1000ms timesteps using a hardware timestep of 1000000us
2019-06-18 14:59:24 INFO: Starting execution process
2019-06-18 14:59:26 INFO: Creating transceiver for 192.168.240.39
2019-06-18 14:59:26 INFO: Working out if machine is booted
2019-06-18 14:59:30 INFO: Attempting to boot machine
2019-06-18 14:59:35 INFO: Found board with version [Version: SC&MP 3.2.4 at SpiNNaker:0:0:0 (built Wed Apr 10 16:46:16 2019)]
2019-06-18 14:59:35 INFO: Machine communication successful
2019-06-18 14:59:35 INFO: Detected a machine on IP address 192.168.240.39 which has 72 cores and 8.0 links
2019-06-18 14:59:35 INFO: Time 0:00:09.166482 taken by MachineGenerator
Pre allocating resources for Extra Monitor support vertices
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.026848 taken by PreAllocateResourcesForExtraMonitorSupport
2019-06-18 14:59:35 INFO: Time 0:00:00.000538 taken by NetworkSpecificationReport
Partitioning graph vertices
|0%                          50%                         100%|
 ============================================================
Partitioning graph edges
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.025879 taken by PartitionAndPlacePartitioner
Generating partitioner report
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.027332 taken by PartitionerReport
Allocating virtual identifiers
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.024631 taken by MallocBasedChipIDAllocator
Inserting extra monitors into graphs
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.027330 taken by InsertExtraMonitorVerticesToGraphs
Writing the board chip report
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.019300 taken by BoardChipReport
Filtering edges
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:35 INFO: Time 0:00:00.023252 taken by GraphEdgeFilter
Placing graph vertices
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.032191 taken by OneToOnePlacer
Inserting edges between vertices which require FR speed up functionality.
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.031744 taken by InsertEdgesToExtraMonitorFunctionality
Generating routing tables for data in system processes
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.018024 taken by DataInMulticastRoutingGenerator
Generating fixed router routes
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.014604 taken by FixedRouteRouter
Generating placement report
|0%                          50%                         100%|
 ============================================================
Generating placement by core report
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.045278 taken by PlacerReportWithApplicationGraph
Routing
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.028373 taken by RigMCRoute
Discovering tags
|0%                          50%                         100%|
 ============================================================
Allocating tags
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.039928 taken by BasicTagAllocator
Reporting Tags
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.017559 taken by TagReport
Getting number of keys required by each edge using application graph
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.025865 taken by EdgeToNKeysMapper
Getting constraints for application graph
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.023351 taken by ProcessPartitionConstraints
Allocating routing keys
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.015410 taken by MallocBasedRoutingInfoAllocator
Generating Routing info report
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.035156 taken by routingInfoReports
Generating routing tables
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.024041 taken by BasicRoutingTableGenerator
Finding executable start types
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.032645 taken by LocateExecutableStartType
Initialising buffers
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.030497 taken by BufferManagerCreator
Generating data specifications
|0%                          50%                         100%|
 ==========================================/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py:373: RuntimeWarning: divide by zero encountered in true_divide
  1.0 - (1.0 / self.__rate), self.__rate))
==================
2019-06-18 14:59:36 INFO: Time 0:00:00.075610 taken by SpynnakerDataSpecificationWriter
Preparing Routing Tables
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 INFO: Time 0:00:00.019275 taken by RoutingSetup
Finding binaries
|0%                          50%                         100%|
 ============================================================
2019-06-18 14:59:36 ERROR: Error when calling spinn_front_end_common.interface.interface_functions.GraphBinaryGatherer.__call__ with inputs dict_keys(['placements', 'executable_finder', 'graph', 'graph_mapper'])

---------------------------------------------------------------------------
ExecutableNotFoundException               Traceback (most recent call last)
<ipython-input-7-25178f0aca15> in <module>
      1 # run simulation
      2 sim_duration = 10.0 # seconds
----> 3 sim.run(sim_duration * 1000.0)

/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/__init__.py in run(simtime, callbacks)
    622     if not globals_variables.has_simulator():
    623         raise ConfigurationException(FAILED_STATE_MSG)
--> 624     return __pynn["run"](simtime, callbacks=callbacks)
    625 
    626 

/envs/py3-spinnaker/lib/python3.7/site-packages/pyNN/common/control.py in run(simtime, callbacks)
    109         the initial conditions (time ``t = 0``), use the ``reset()`` function.
    110         """
--> 111         return run_until(simulator.state.t + simtime, callbacks)
    112     return run, run_until
    113 

/envs/py3-spinnaker/lib/python3.7/site-packages/pyNN/common/control.py in run_until(time_point, callbacks)
     91                         for callback in active_callbacks)
     92         else:
---> 93             simulator.state.run_until(time_point)
     94         return simulator.state.t
     95 

/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/spinnaker.py in run_until(self, tstop)
    109         """
    110         # Build data
--> 111         self._run_wait(tstop - self.t)
    112 
    113     def clear(self):

/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/spinnaker.py in _run_wait(self, duration_ms)
    152             "of {}us", duration_timesteps, self.dt, hardware_timestep_us)
    153 
--> 154         super(SpiNNaker, self).run(duration_ms)
    155 
    156     @property

/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/abstract_spinnaker_common.py in run(self, run_time)
    314         for projection in self._projections:
    315             projection._clear_cache()
--> 316         super(AbstractSpiNNakerCommon, self).run(run_time)
    317 
    318     @property

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py in run(self, run_time)
    672         :param run_time: the run duration in milliseconds.
    673         """
--> 674         self._run(run_time)
    675 
    676     def _build_graphs_for_usege(self):

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py in _run(self, run_time, run_until_complete)
    847             # If we are using a virtual board, don't load
    848             if not self._use_virtual_board:
--> 849                 self._do_load(application_graph_changed)
    850                 loading_done = True
    851 

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py in _do_load(self, application_graph_changed)
   1706         executor = self._run_algorithms(
   1707             inputs, algorithms, [], tokens, required_tokens, "loading",
-> 1708             optional_algorithms)
   1709         self._load_outputs = executor.get_items()
   1710         self._load_tokens = executor.get_completed_tokens()

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py in _run_algorithms(self, inputs, algorithms, outputs, tokens, required_tokens, provenance_name, optional_algorithms)
   1043             except Exception:
   1044                 logger.warning("problem when shutting down", exc_info=True)
-> 1045             reraise(*exc_info)
   1046 
   1047     def _get_machine(self, total_run_time=0.0, n_machine_time_steps=None):

/envs/py3-spinnaker/lib/python3.7/site-packages/six.py in reraise(tp, value, tb)
    691             if value.__traceback__ is not tb:
    692                 raise value.with_traceback(tb)
--> 693             raise value
    694         finally:
    695             value = None

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/abstract_spinnaker_base.py in _run_algorithms(self, inputs, algorithms, outputs, tokens, required_tokens, provenance_name, optional_algorithms)
   1030 
   1031         try:
-> 1032             executor.execute_mapping()
   1033             self._pacman_provenance.extract_provenance(executor)
   1034             return executor

/envs/py3-spinnaker/lib/python3.7/site-packages/pacman/executor/pacman_algorithm_executor.py in execute_mapping(self)
    624         if self._do_direct_injection:
    625             with injection_context(self._internal_type_mapping):
--> 626                 self._execute_mapping()
    627         else:
    628             self._execute_mapping()

/envs/py3-spinnaker/lib/python3.7/site-packages/pacman/executor/pacman_algorithm_executor.py in _execute_mapping(self)
    640 
    641             # Execute the algorithm
--> 642             results = algorithm.call(self._internal_type_mapping)
    643 
    644             if self._provenance_path:

/envs/py3-spinnaker/lib/python3.7/site-packages/pacman/executor/algorithm_classes/abstract_python_algorithm.py in call(self, inputs)
     43 
     44         # Run the algorithm and get the results
---> 45         results = self.call_python(method_inputs)
     46 
     47         if results is not None and not isinstance(results, tuple):

/envs/py3-spinnaker/lib/python3.7/site-packages/pacman/executor/algorithm_classes/python_class_algorithm.py in call_python(self, inputs)
     54             method = getattr(instance, self._python_method)
     55         try:
---> 56             return method(**inputs)
     57         except Exception:
     58             method = "__call__"

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/interface_functions/graph_binary_gatherer.py in __call__(self, placements, graph, executable_finder, graph_mapper)
     26             if graph_mapper is not None:
     27                 self.__get_binary(placement,
---> 28                                   graph_mapper.get_application_vertex(vertex))
     29 
     30         return self._exe_targets

/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/interface/interface_functions/graph_binary_gatherer.py in __get_binary(self, placement, vertex)
     45         binary_path = self._exe_finder.get_executable_path(binary_name)
     46         if binary_path is None:
---> 47             raise ExecutableNotFoundException(binary_name)
     48 
     49         self._exe_targets.add_processor(

ExecutableNotFoundException: IF_cond_exp.aplx

I should also point out that I also get ExecutableNotFoundException: IF_curr_exp.aplx when I changed the cell type to IF_curr_exp.

It runs successfully in my python2.7 environment. Although, I get

>>> spike_counts = neurons.get_spike_counts()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Population' object has no attribute 'get_spike_counts'

Ah - the ExecutableNotFound exception here is because you've downloaded the up-to-date version from github, which by default doesn't contain the aplx binaries (they only get included automatically in a release version). You'll need to download a C compiler for your system and build the aplx files yourself: see http://spinnakermanchester.github.io/common_pages/4.0.0/Compiler.html for links to download a compiler; once you've done this, then you'll need to follow the instructions at http://spinnakermanchester.github.io/development/devenv.html#cenvironment to build the aplx files. Let us know if you have any problems with this.

Thanks @andrewgait
After setting up the C environment variable and at the stage of building the C-code, after make in ~/spinnaker_tools/ and make && make install clean in ~/spinn_common when I run the command make in ~/SpiNNFrontEndCommon/c_common I get

make[1]: Entering directory '/repos/SpiNNFrontEndCommon/c_common/front_end_common_lib'
arm-none-eabi-gcc -c -mthumb-interwork -march=armv5te -std=gnu99 -ffreestanding -I /repos/spinnaker_tools/include -fdata-sections -ffunction-sections -g -Os -I include -DPRODUCTION_CODE -o build/data_specification.o modified_src//data_specification.c
In file included from include/data_specification.h:15,
                 from modified_src//data_specification.c:3:
include/common-typedefs.h:44:10: fatal error: stdfix-full-iso.h: No such file or directory
 #include "stdfix-full-iso.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:56: build/data_specification.o] Error 1
make[1]: Leaving directory '/repos/SpiNNFrontEndCommon/c_common/front_end_common_lib'
make: *** [Makefile:10: install] Error 2

I also noticed that in the automatic_make.sh the make command is invoked in ~/SpiNNFrontEndCommon/c_common/front_end_common_lib. So I ran make inside the subfolder ~/front_end_common_lib and it pretty much returned the same error

arm-none-eabi-gcc -c -mthumb-interwork -march=armv5te -std=gnu99 -ffreestanding -I /repos/spinnaker_tools/include -fdata-sections -ffunction-sections -g -Os -I include -DPRODUCTION_CODE -o build/data_specification.o modified_src//data_specification.c
In file included from include/data_specification.h:15,
                 from modified_src//data_specification.c:3:
include/common-typedefs.h:44:10: fatal error: stdfix-full-iso.h: No such file or directory
 #include "stdfix-full-iso.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:56: build/data_specification.o] Error 1

Am I missing a dependency?

I don't think so - it looks like you have run "make clean" after running "make" in spinn_common. The order should be (if you check in automatic_make.sh):

In spinn_common/
make clean
make install-clean
make
make install

If you then follow what the automatic_make.sh script does in SpiNNFrontEndCommon then it should work.

Based on automatic_make.sh I invoked make install and I got a different error

make[1]: Entering directory '/repos/SpiNNFrontEndCommon/c_common/front_end_common_lib'
arm-none-eabi-gcc -c -mthumb-interwork -march=armv5te -std=gnu99 -ffreestanding -I /repos/spinnaker_tools/include -fdata-sections -ffunction-sections -g -Os -I include -DPRODUCTION_CODE -o build/data_specification.o modified_src//data_specification.c
make[1]: arm-none-eabi-gcc: Command not found
make[1]: *** [Makefile:56: build/data_specification.o] Error 127
make[1]: Leaving directory '/repos/SpiNNFrontEndCommon/c_common/front_end_common_lib'
make: *** [Makefile:10: install] Error 2

So I went back and tried to follow each step from the beginning of automatic_make.sh
In the first step I cd to ~/spinnaker_tools, then source $PWD/setup and make clean but now when I call make I get

make[1]: Entering directory '/repos/spinnaker_tools/sark'
mkdir -p ../build/gnu
/repos/spinnaker_tools/tools/arm2gas sark_alib.s > ../build/gnu/sark_alib.gas
mkdir -p ../build/gnu
/repos/spinnaker_tools/tools/h2asm /repos/spinnaker_tools/include/spinnaker.h | /repos/spinnaker_tools/tools/arm2gas > ../build/gnu/spinnaker.gas
mkdir -p ../build/gnu
/repos/spinnaker_tools/tools/h2asm /repos/spinnaker_tools/include/sark.h | /repos/spinnaker_tools/tools/arm2gas > ../build/gnu/sark.gas
mkdir -p ../build/gnu
arm-none-eabi-as --defsym GNU=1 -mthumb-interwork -march=armv5te -I ../build/gnu -o ../build/gnu/sark_alib.o ../build/gnu/sark_alib.gas
make[1]: arm-none-eabi-as: Command not found
make[1]: *** [Makefile:63: ../build/gnu/sark_alib.o] Error 127
make[1]: Leaving directory '/repos/spinnaker_tools/sark'
make: *** [Makefile:6: all] Error 2

Ok so I went back and downloaded gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 (I was using Version 8-2018-q4-major Linux 64-bit toolchain) and set the PATH environment.

And following all the steps in automatic_make.sh did not appear to return an error.

However when I tried to run the simulation I am still getting

spinn_front_end_common.utilities.exceptions.ExecutableNotFoundException: IF_cond_exp.aplx

You definitely followed all the steps in automatic_make.sh? (It might be easiest for you just to run automatic_make.sh from the directory containing all the repositories...)

If you have followed all the steps, what's in the directory spynnaker/pyNN/model_binaries?

I tried running the script automatic_make.sh and I think my .bashrc has been corrupted because even ls, apt-get, vi ~/.bashrc etc. commands are no longer found. I could therefore not see what's in spynnaker/pyNN/model_binaries. I will fix this and get back to you.

Hi @lungsi, I got your latest problem in an email but can't see it here on github. I'm going to reply to what that said anyway - if you're still having that problem then I don't think it's an issue with your C environment variables, it's that python can't find spinn_utilities.make_tools (which is used during the C build process), and this is probably because you haven't setup/installed the python modules correctly. See https://spinnakermanchester.github.io/development/devenv.html#install for how to do this. (You can check which versions of our python modules you have installed by running "pip list" from the command line - if you've done the setup correctly then it should tell you the directory that python module is in).

Thanks @andrewgait Yes I deleted the previous post because I figured out that I was getting the error because the make command was running outside the virtual enviroment (the virtual enviroment has the SpiNNUtils installed).

I have therefore succeeded (no errors) in compiling the C codes. However now I am not able to python -c "import pyNN.spiNNaker.

I had installed sPyNNaker8 and pyNN-spiNNaker (python -m spynnaker8.setup_pynn) without incident, but before the C-compilation step.

However, when I try to re-install them (post C-compilation) running python -m spynnaker8.setup_pynn returns

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/__init__.py", line 23, in <module>
    from spynnaker8.models.connectors.all_to_all_connector import \
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/__init__.py", line 1, in <module>
    from .projection import Projection
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/projection.py", line 10, in <module>
    from spynnaker8.models.connectors import FromListConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/connectors/__init__.py", line 1, in <module>
    from .all_to_all_connector import AllToAllConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker8/models/connectors/all_to_all_connector.py", line 3, in <module>
    from spynnaker.pyNN.models.neural_projections.connectors import (
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/__init__.py", line 3, in <module>
    from .delayed_application_edge import DelayedApplicationEdge
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py", line 3, in <module>
    from .delayed_machine_edge import DelayedMachineEdge
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/delayed_machine_edge.py", line 3, in <module>
    from spynnaker.pyNN.models.neural_projections.connectors import (
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/connectors/__init__.py", line 1, in <module>
    from .abstract_connector import AbstractConnector
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py", line 8, in <module>
    from spinn_front_end_common.utilities.utility_objs import ProvenanceDataItem
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/utilities/utility_objs/__init__.py", line 4, in <module>
    from .executable_targets import ExecutableTargets
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinn_front_end_common/utilities/utility_objs/executable_targets.py", line 4, in <module>
    from spinnman.model import ExecutableTargets as SuperExecTargets
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/model/__init__.py", line 3, in <module>
    from .chip_info import ChipInfo
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/model/chip_info.py", line 1, in <module>
    from spinnman.messages.spinnaker_boot import SystemVariableDefinition
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/messages/spinnaker_boot/__init__.py", line 2, in <module>
    from .spinnaker_boot_messages import SpinnakerBootMessages
  File "/envs/py3-spinnaker/lib/python3.7/site-packages/spinnman/messages/spinnaker_boot/spinnaker_boot_messages.py", line 26, in <module>
    _BOOT_DATA_OPERAND_1 = ((_BOOT_MESSAGE_DATA_BYTES / 4) - 1) << 8
TypeError: unsupported operand type(s) for <<: 'float' and 'int'

PS: I just ran setup.sh without errors but again running python -m spynnaker8.setup_pynn returns the same output as above.

That line in SpiNNMan that's causing your error was changed in master over a year ago, so I don't know what you've managed to install here. I thought you were trying to get an up-to-date master version? When/how did you clone the git repositories? I'd suggest that you at least need to do "git pull" in every repository, then run automatic_make.sh, and then try these scripts again.

This week was the first time I ever cloned/installed SpiNNMan and as suggested above I did it as

git clone https://github.com/SpiNNakerManchester/SpiNNMan.git

Do you have the up-to-date version in another branch?

I will try as you suggested but I am doubtful because everything (except for the GCC compiler 2017) is directly from the repository.

PS:

SpiNNMan# git pull
Already up to date.

No, the correct line is on master - I think instead that the version of SpiNNMan you are pointing at inside your environment is incorrect. You should be pointing at (I think) /repos/SpiNNMan (which is where you installed it, I think?), not /envs/y3-spinnaker/lib/python3.7/site-packages/spinnman (which I think is the release version) as is suggested by your error trace.

What output do you get from the command "pip list"?

Here's the snippet of the pip list output

spalloc                     1.0.1             /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNaker-DataSpecification 1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNaker-PACMAN            1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNFrontEndCommon         1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNMachine                1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNMan                    1!4.0.2           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNStorageHandlers        1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
SpiNNUtilities              1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
sPyNNaker                   1!4.0.1           /envs/py3-spinnaker/lib/python3.7/site-packages
sPyNNaker8                  1!4.1.0           /envs/py3-spinnaker/lib/python3.7/site-packages

Ok - so those are pointing at the wrong locations. The easiest way to fix this, I think, is to do "pip uninstall" for each of those repositories, and then rerun the python module setup script (i.e. do "python setup.py develop --no-deps" in each of the repositories). Then if you do "pip list" again it should show you (e.g.)

sPyNNaker 1!4.0.1 /repos/sPyNNaker

(Updated to remove incorrect assumptions about displays which was true in earlier versions of pip but not the current one).

Thank you so much @andrewgait I finally managed to successfully run quick start example in the guidebook.

I did the following:

I pip uninstall -y spalloc SpiNNaker-DataSpecification SpiNNaker-PACMAN SpiNNFrontEndCommon SpiNNMachine SpiNNMan SpiNNStorageHandlers SpiNNUtilities sPyNNaker sPyNNaker8
and then ran the setup.sh
Now pip list shows

spalloc                     1.0.1             /repos/spalloc             
SpiNNaker-DataSpecification 1!4.0.1           /repos/DataSpecification   
SpiNNaker-PACMAN            1!4.0.1           /repos/PACMAN              
SpiNNFrontEndCommon         1!4.0.1           /repos/SpiNNFrontEndCommon 
SpiNNMachine                1!4.0.1           /repos/SpiNNMachine        
SpiNNMan                    1!4.0.1           /repos/SpiNNMan            
SpiNNStorageHandlers        1!4.0.1           /repos/SpiNNStorageHandlers
SpiNNUtilities              1!4.0.1           /repos/SpiNNUtils          
sPyNNaker                   1!4.0.1           /repos/sPyNNaker           
sPyNNaker8                  1!4.1.0           /repos/sPyNNaker8

Then

# python -m spynnaker8.setup_pynn
Detected PyNN version 0.9.4 and Neo version 0.6.1
Created /envs/py3-spinnaker/lib/python3.7/site-packages/pyNN/spiNNaker/__init__.py

and

# python -c "import pyNN.spiNNaker"
Detected PyNN version 0.9.4 and Neo version 0.6.1