Skip to content

Commit 8f8789b

Browse files
authored
Merge pull request #3258 from suku248/iaf_bw_2001_boost_dependency
Add Boost dependency for iaf_bw_2001
2 parents 0d0b0a8 + 7758d57 commit 8f8789b

File tree

6 files changed

+23
-0
lines changed

6 files changed

+23
-0
lines changed

lib/sli/sli-init.sli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,7 @@ special prerequisites.
22392239
SeeAlso: exit_test_gracefully
22402240
*/
22412241

2242+
/skip_if_without_boost { statusdict/have_boost :: not { /skipped_no_boost exit_test_gracefully } if } def
22422243
/skip_if_no_mpi { statusdict/is_mpi :: not { /skipped_no_mpi exit_test_gracefully } if } def
22432244
/skip_if_have_mpi { statusdict/is_mpi :: { /skipped_have_mpi exit_test_gracefully } if } def
22442245
/skip_if_not_threaded { is_threaded not { /skipped_no_threading exit_test_gracefully } if } def

models/iaf_bw_2001.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "iaf_bw_2001.h"
2424

2525
#ifdef HAVE_GSL
26+
#ifdef HAVE_BOOST
2627

2728
// Includes from libnestutil:
2829
#include "dict_util.h"
@@ -521,4 +522,5 @@ nest::iaf_bw_2001::handle( CurrentEvent& e )
521522
e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), e.get_weight() * e.get_current() );
522523
}
523524

525+
#endif // HAVE_BOOST
524526
#endif // HAVE_GSL

models/iaf_bw_2001.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "config.h"
2828

2929
#ifdef HAVE_GSL
30+
#ifdef HAVE_BOOST
3031

3132
// C includes:
3233
#include <gsl/gsl_errno.h>
@@ -516,5 +517,6 @@ iaf_bw_2001::set_status( const DictionaryDatum& d )
516517
};
517518
} // namespace
518519

520+
#endif // HAVE_BOOST
519521
#endif // HAVE_GSL
520522
#endif // IAF_BW_2001

sli/slistartup.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ SLIStartup::SLIStartup( int argc, char** argv )
173173
, ismpi_name( "is_mpi" )
174174
, have_gsl_name( "have_gsl" )
175175
, have_music_name( "have_music" )
176+
, have_boost_name( "have_boost" )
176177
, have_libneurosim_name( "have_libneurosim" )
177178
, have_sionlib_name( "have_sionlib" )
178179
, have_hdf5_name( "have_hdf5" )
@@ -190,6 +191,7 @@ SLIStartup::SLIStartup( int argc, char** argv )
190191
, exitcode_skipped_no_threading_name( "skipped_no_threading" )
191192
, exitcode_skipped_no_gsl_name( "skipped_no_gsl" )
192193
, exitcode_skipped_no_music_name( "skipped_no_music" )
194+
, exitcode_skipped_no_boost_name( "skipped_no_boost" )
193195
, exitcode_scripterror_name( "scripterror" )
194196
, exitcode_abort_name( "abort" )
195197
, exitcode_userabort_name( "userabort" )
@@ -330,6 +332,12 @@ SLIStartup::init( SLIInterpreter* i )
330332
statusdict->insert( have_music_name, Token( new BoolDatum( false ) ) );
331333
#endif
332334

335+
#ifdef HAVE_BOOST
336+
statusdict->insert( have_boost_name, Token( new BoolDatum( true ) ) );
337+
#else
338+
statusdict->insert( have_boost_name, Token( new BoolDatum( false ) ) );
339+
#endif
340+
333341
#ifdef HAVE_LIBNEUROSIM
334342
statusdict->insert( have_libneurosim_name, Token( new BoolDatum( true ) ) );
335343
#else
@@ -382,6 +390,7 @@ SLIStartup::init( SLIInterpreter* i )
382390
exitcodes->insert( exitcode_skipped_no_threading_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_THREADING ) ) );
383391
exitcodes->insert( exitcode_skipped_no_gsl_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_GSL ) ) );
384392
exitcodes->insert( exitcode_skipped_no_music_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_MUSIC ) ) );
393+
exitcodes->insert( exitcode_skipped_no_boost_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_BOOST ) ) );
385394
exitcodes->insert( exitcode_scripterror_name, Token( new IntegerDatum( EXITCODE_SCRIPTERROR ) ) );
386395
exitcodes->insert( exitcode_abort_name, Token( new IntegerDatum( NEST_EXITCODE_ABORT ) ) );
387396
exitcodes->insert( exitcode_userabort_name, Token( new IntegerDatum( EXITCODE_USERABORT ) ) );

sli/slistartup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#define EXITCODE_SKIPPED_NO_THREADING 203
5656
#define EXITCODE_SKIPPED_NO_GSL 204
5757
#define EXITCODE_SKIPPED_NO_MUSIC 205
58+
#define EXITCODE_SKIPPED_NO_BOOST 206
5859

5960

6061
class SLIStartup : public SLIModule
@@ -108,6 +109,7 @@ class SLIStartup : public SLIModule
108109
Name ismpi_name;
109110
Name have_gsl_name;
110111
Name have_music_name;
112+
Name have_boost_name;
111113
Name have_libneurosim_name;
112114
Name have_sionlib_name;
113115
Name have_hdf5_name;
@@ -127,6 +129,7 @@ class SLIStartup : public SLIModule
127129
Name exitcode_skipped_no_threading_name;
128130
Name exitcode_skipped_no_gsl_name;
129131
Name exitcode_skipped_no_music_name;
132+
Name exitcode_skipped_no_boost_name;
130133
Name exitcode_scripterror_name;
131134
Name exitcode_abort_name;
132135
Name exitcode_userabort_name;

testsuite/pytests/test_iaf_bw_2001.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
import numpy.testing as nptest
3838
import pytest
3939

40+
HAVE_BOOST = nest.ll_api.sli_func("statusdict/have_boost ::")
41+
42+
4043
w_ex = 40.0
4144
w_in = 15.0
4245

@@ -64,6 +67,7 @@ def spiketrain_response(t, tau, spiketrain, w):
6467
return response
6568

6669

70+
@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available")
6771
def test_iaf_bw_2001():
6872
"""
6973
Creates 4 neurons.
@@ -162,6 +166,7 @@ def test_iaf_bw_2001():
162166
nptest.assert_array_almost_equal(gaba_soln, mm_bw1.events["s_GABA"])
163167

164168

169+
@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available")
165170
def test_approximation_I_NMDA_V_m():
166171
"""
167172
Creates 3 neurons.
@@ -221,6 +226,7 @@ def test_approximation_I_NMDA_V_m():
221226
assert np.max(np.abs(mm_approx.events["V_m"] - mm_exact.events["V_m"])) < 0.25
222227

223228

229+
@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available")
224230
def test_illegal_connection_error():
225231
"""
226232
Test that connecting with NMDA synapses from iaf_cond_exp throws error.

0 commit comments

Comments
 (0)