diff --git a/lib/sli/sli-init.sli b/lib/sli/sli-init.sli index 9e19f4b81c..72f9b32758 100644 --- a/lib/sli/sli-init.sli +++ b/lib/sli/sli-init.sli @@ -2239,6 +2239,7 @@ special prerequisites. SeeAlso: exit_test_gracefully */ +/skip_if_without_boost { statusdict/have_boost :: not { /skipped_no_boost exit_test_gracefully } if } def /skip_if_no_mpi { statusdict/is_mpi :: not { /skipped_no_mpi exit_test_gracefully } if } def /skip_if_have_mpi { statusdict/is_mpi :: { /skipped_have_mpi exit_test_gracefully } if } def /skip_if_not_threaded { is_threaded not { /skipped_no_threading exit_test_gracefully } if } def diff --git a/models/iaf_bw_2001.cpp b/models/iaf_bw_2001.cpp index 51e0d8341b..e030579183 100644 --- a/models/iaf_bw_2001.cpp +++ b/models/iaf_bw_2001.cpp @@ -23,6 +23,7 @@ #include "iaf_bw_2001.h" #ifdef HAVE_GSL +#ifdef HAVE_BOOST // Includes from libnestutil: #include "dict_util.h" @@ -521,4 +522,5 @@ nest::iaf_bw_2001::handle( CurrentEvent& e ) e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ), e.get_weight() * e.get_current() ); } +#endif // HAVE_BOOST #endif // HAVE_GSL diff --git a/models/iaf_bw_2001.h b/models/iaf_bw_2001.h index b334cd581f..f28ce10610 100644 --- a/models/iaf_bw_2001.h +++ b/models/iaf_bw_2001.h @@ -27,6 +27,7 @@ #include "config.h" #ifdef HAVE_GSL +#ifdef HAVE_BOOST // C includes: #include @@ -516,5 +517,6 @@ iaf_bw_2001::set_status( const DictionaryDatum& d ) }; } // namespace +#endif // HAVE_BOOST #endif // HAVE_GSL #endif // IAF_BW_2001 diff --git a/sli/slistartup.cc b/sli/slistartup.cc index 210676e390..61dcd706cb 100644 --- a/sli/slistartup.cc +++ b/sli/slistartup.cc @@ -173,6 +173,7 @@ SLIStartup::SLIStartup( int argc, char** argv ) , ismpi_name( "is_mpi" ) , have_gsl_name( "have_gsl" ) , have_music_name( "have_music" ) + , have_boost_name( "have_boost" ) , have_libneurosim_name( "have_libneurosim" ) , have_sionlib_name( "have_sionlib" ) , have_hdf5_name( "have_hdf5" ) @@ -190,6 +191,7 @@ SLIStartup::SLIStartup( int argc, char** argv ) , exitcode_skipped_no_threading_name( "skipped_no_threading" ) , exitcode_skipped_no_gsl_name( "skipped_no_gsl" ) , exitcode_skipped_no_music_name( "skipped_no_music" ) + , exitcode_skipped_no_boost_name( "skipped_no_boost" ) , exitcode_scripterror_name( "scripterror" ) , exitcode_abort_name( "abort" ) , exitcode_userabort_name( "userabort" ) @@ -330,6 +332,12 @@ SLIStartup::init( SLIInterpreter* i ) statusdict->insert( have_music_name, Token( new BoolDatum( false ) ) ); #endif +#ifdef HAVE_BOOST + statusdict->insert( have_boost_name, Token( new BoolDatum( true ) ) ); +#else + statusdict->insert( have_boost_name, Token( new BoolDatum( false ) ) ); +#endif + #ifdef HAVE_LIBNEUROSIM statusdict->insert( have_libneurosim_name, Token( new BoolDatum( true ) ) ); #else @@ -382,6 +390,7 @@ SLIStartup::init( SLIInterpreter* i ) exitcodes->insert( exitcode_skipped_no_threading_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_THREADING ) ) ); exitcodes->insert( exitcode_skipped_no_gsl_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_GSL ) ) ); exitcodes->insert( exitcode_skipped_no_music_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_MUSIC ) ) ); + exitcodes->insert( exitcode_skipped_no_boost_name, Token( new IntegerDatum( EXITCODE_SKIPPED_NO_BOOST ) ) ); exitcodes->insert( exitcode_scripterror_name, Token( new IntegerDatum( EXITCODE_SCRIPTERROR ) ) ); exitcodes->insert( exitcode_abort_name, Token( new IntegerDatum( NEST_EXITCODE_ABORT ) ) ); exitcodes->insert( exitcode_userabort_name, Token( new IntegerDatum( EXITCODE_USERABORT ) ) ); diff --git a/sli/slistartup.h b/sli/slistartup.h index 0e53878043..a9edb14312 100644 --- a/sli/slistartup.h +++ b/sli/slistartup.h @@ -55,6 +55,7 @@ #define EXITCODE_SKIPPED_NO_THREADING 203 #define EXITCODE_SKIPPED_NO_GSL 204 #define EXITCODE_SKIPPED_NO_MUSIC 205 +#define EXITCODE_SKIPPED_NO_BOOST 206 class SLIStartup : public SLIModule @@ -108,6 +109,7 @@ class SLIStartup : public SLIModule Name ismpi_name; Name have_gsl_name; Name have_music_name; + Name have_boost_name; Name have_libneurosim_name; Name have_sionlib_name; Name have_hdf5_name; @@ -127,6 +129,7 @@ class SLIStartup : public SLIModule Name exitcode_skipped_no_threading_name; Name exitcode_skipped_no_gsl_name; Name exitcode_skipped_no_music_name; + Name exitcode_skipped_no_boost_name; Name exitcode_scripterror_name; Name exitcode_abort_name; Name exitcode_userabort_name; diff --git a/testsuite/pytests/test_iaf_bw_2001.py b/testsuite/pytests/test_iaf_bw_2001.py index 257b8d0db2..ac47ce7d99 100644 --- a/testsuite/pytests/test_iaf_bw_2001.py +++ b/testsuite/pytests/test_iaf_bw_2001.py @@ -37,6 +37,9 @@ import numpy.testing as nptest import pytest +HAVE_BOOST = nest.ll_api.sli_func("statusdict/have_boost ::") + + w_ex = 40.0 w_in = 15.0 @@ -64,6 +67,7 @@ def spiketrain_response(t, tau, spiketrain, w): return response +@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available") def test_iaf_bw_2001(): """ Creates 4 neurons. @@ -162,6 +166,7 @@ def test_iaf_bw_2001(): nptest.assert_array_almost_equal(gaba_soln, mm_bw1.events["s_GABA"]) +@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available") def test_approximation_I_NMDA_V_m(): """ Creates 3 neurons. @@ -221,6 +226,7 @@ def test_approximation_I_NMDA_V_m(): assert np.max(np.abs(mm_approx.events["V_m"] - mm_exact.events["V_m"])) < 0.25 +@pytest.mark.skipif(not HAVE_BOOST, reason="Boost is not available") def test_illegal_connection_error(): """ Test that connecting with NMDA synapses from iaf_cond_exp throws error.