ANNarchy 4.8.2
  • ANNarchy
  • Installation
  • Tutorial
  • Manual
  • Notebooks
  • Reference

  • Reference
  • Core components
    • Population
    • Projection
    • Neuron
    • Synapse
    • Monitor
    • PopulationView
    • Dendrite
    • Network
  • Configuration
    • setup
    • compile
    • clear
    • reset
    • set_seed
    • get_population
    • get_projection
    • populations
    • projections
    • monitors
  • Simulation
    • simulate
    • simulate_until
    • step
    • parallel_run
    • enable_learning
    • disable_learning
    • get_time
    • set_time
    • get_current_step
    • set_current_step
    • dt
  • Neuron models
    • LeakyIntegrator
    • Izhikevich
    • IF_curr_exp
    • IF_cond_exp
    • IF_curr_alpha
    • IF_cond_alpha
    • HH_cond_exp
    • EIF_cond_alpha_isfa_ista
    • EIF_cond_exp_isfa_ista
  • Synapse models
    • STP
    • STDP
    • Hebb
    • Oja
    • IBCM
  • Inputs
    • InputArray
    • TimedArray
    • PoissonPopulation
    • TimedPoissonPopulation
    • SpikeSourceArray
    • HomogeneousCorrelatedSpikeTrains
    • CurrentInjection
    • DecodingProjection
    • ImagePopulation
    • VideoPopulation
  • IO
    • save
    • load
    • save_parameters
    • load_parameters
  • Utilities
    • report
  • Random Distributions
    • Uniform
    • DiscreteUniform
    • Normal
    • LogNormal
    • Exponential
    • Gamma
    • Binomial
  • Functions and Constants
    • add_function
    • functions
    • Constant
    • get_constant
  • Plotting
    • raster_plot
    • histogram
    • inter_spike_interval
    • coefficient_of_variation
    • population_rate
    • smoothed_rate
  • Callbacks
    • every
    • callbacks_enabled
    • disable_callbacks
    • enable_callbacks
    • clear_all_callbacks
  • Convolution
    • Convolution
    • Pooling
    • Transpose
    • Copy
  • BOLD monitoring
    • BoldMonitor
    • BoldModel
    • balloon_RN
    • balloon_RL
    • balloon_CN
    • balloon_CL
    • balloon_maith2021
    • balloon_two_inputs
  • Tensorboard logging
    • Logger
  • ANN-to-SNN conversion
    • ANNtoSNNConverter

On this page

  • compile
    • Parameters

compile

generator.compile(
    directory='annarchy',
    clean=False,
    populations=None,
    projections=None,
    compiler='default',
    compiler_flags='default',
    add_sources='',
    extra_libs='',
    cuda_config={'device': 0},
    annarchy_json='',
    silent=False,
    debug_build=False,
    profile_enabled=False,
    net_id=0,
)

This method uses the network architecture to generate optimized C++ code and compile a shared library that will perform the simulation.

The compiler, compiler_flags and part of cuda_config take their default value from the configuration file ~/.config/ANNarchy/annarchy.json.

The following arguments are for internal development use only:

  • debug_build: creates a debug version of ANNarchy, which logs the creation of objects and some other data (default: False).
  • profile_enabled: creates a profilable version of ANNarchy, which logs several computation timings (default: False).

Parameters

Name Type Description Default
directory name of the subdirectory where the code will be generated and compiled. Must be a relative path. Default: “annarchy/”. 'annarchy'
clean boolean to specifying if the library should be recompiled entirely or only the changes since last compilation (default: False). False
populations list of populations which should be compiled. If set to None, all available populations will be used. None
projections list of projection which should be compiled. If set to None, all available projections will be used. None
compiler C++ compiler to use. Default: g++ on GNU/Linux, clang++ on OS X. Valid compilers are [g++, clang++]. 'default'
compiler_flags platform-specific flags to pass to the compiler. Default: “-march=native -O2”. Warning: -O3 often generates slower code and can cause linking problems, so it is not recommended. 'default'
cuda_config dictionary defining the CUDA configuration for each population and projection. {'device': 0}
annarchy_json compiler flags etc can be stored in a .json file normally placed in the home directory (see comment below). With this flag one can directly assign a file location. ''
silent defines if status message like “Compiling… OK” should be printed. False
setup
clear
 

Copyright Julien Vitay, Helge Ülo Dinkelbach, Fred Hamker