It seems that Boost might have been installed to a non-default location (/opt?)

For example, for me, it is installed in /usr/include:

$ find / -name spreadsort.hpp
/usr/include/boost/sort/spreadsort/spreadsort.hpp

And this is on the default search path for g++:

$ g++ -E -v -
include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/10/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.

If it is not on the default search path, then we should check if it's the case that NEST finds it, but NESTML does not. Could you check if, during the build of NEST Simulator, at the first step when you run "cmake", there is a line in the output that says "Use Boost : Yes"?

I just want to mention the possibility of running NESTML via the Docker image. There is a convenient Jupyterhub interface via your browser, and practically zero installation effort (other than Docker itself). But I'll happily debug this issue further, perhaps we have the opportunity here to improve something in NESTML.

On Tue, Mar 1, 2022, at 12:47, Salvo T wrote:
> Dear NESTML Users, 
> when I try the NESTML Izhikevich tutorial, I have a problem in the 
> generate_nest_target function. The output in the terminal is the 
> following:
>
> ***
>               -- N E S T --
>   Copyright (C) 2004 The NEST Initiative
>
>  Version: UNKNOWN
>  Built: Jan 18 2022 13:53:41
>
>  This program is provided AS IS and comes with
>  NO WARRANTY. See the file LICENSE for details.
>
>  Problems or suggestions?
>    Visit https://www.nest-simulator.org
>
>  Type 'nest.help()' to find out more about NEST.
>
> -- The CXX compiler identification is GNU 9.3.0
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++ - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
>
> -------------------------------------------------------
> nestml_izhikevich_module Configuration Summary
> -------------------------------------------------------
>
> C++ compiler         : /usr/bin/c++
> Build static libs    : OFF
> C++ compiler flags   : 
> NEST compiler flags  :  -std=c++11 -O2 -Wall -fopenmp -pthread 
> -fdiagnostics-color=auto
> NEST include dirs    :  -I/opt/nest/include/nest -I/usr/include 
> -I/usr/include -I/usr/include -I/opt/music-install/include 
> -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi 
> -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include
> NEST libraries flags : -L/opt/nest/lib/nest -lnestutil -lnest -lsli 
> -lnestkernel -fopenmp /usr/lib/x86_64-linux-gnu/libltdl.so 
> /usr/lib/x86_64-linux-gnu/libreadline.so 
> /usr/lib/x86_64-linux-gnu/libncurses.so 
> /usr/lib/x86_64-linux-gnu/libgsl.so 
> /usr/lib/x86_64-linux-gnu/libgslcblas.so  
> /opt/music-install/lib/libmusic.so 
> /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so 
> /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so
>
> -------------------------------------------------------
>
> You can now build and install 'nestml_izhikevich_module' using
>   make
>   make install
>
> The library file libnestml_izhikevich_module.so will be installed to
>   /opt/nest/lib/nest
> The module can be loaded into NEST using
>   (nestml_izhikevich_module) Install       (in SLI)
>   nest.Install(nestml_izhikevich_module)   (in PyNEST)
>
> CMake Warning (dev) in CMakeLists.txt:
>   No cmake_minimum_required command is present.  A line of code such as
>
>     cmake_minimum_required(VERSION 3.22)
>
>   should be added at the top of the file.  The version specified may be lower
>   if you wish to support older CMake versions for this project.  For more
>   information run "cmake --help-policy CMP0000".
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /tmp/nestml-component
> [ 16%] Building CXX object 
> CMakeFiles/nestml_izhikevich_module_module.dir/nestml_izhikevich_module.o
> In file included from /opt/nest/include/nest/connector_base.h:35,
>                  from /opt/nest/include/nest/connection_manager.h:36,
>                  from 
> /opt/nest/include/nest/connection_manager_impl.h:26,
>                  from 
> /tmp/nestml-component/nestml_izhikevich_module.cpp:26:
> /opt/nest/include/nest/sort.h:36:10: fatal error: 
> boost/sort/spreadsort/spreadsort.hpp: No such file or directory
>    36 | #include <boost/sort/spreadsort/spreadsort.hpp>
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[2]: *** 
> [CMakeFiles/nestml_izhikevich_module_module.dir/build.make:76: 
> CMakeFiles/nestml_izhikevich_module_module.dir/nestml_izhikevich_module.o] 
> Error 1
> make[1]: *** [CMakeFiles/Makefile2:112: 
> CMakeFiles/nestml_izhikevich_module_module.dir/all] Error 2
> make: *** [Makefile:156: all] Error 2
> ***
>
> While the Jupyter notebook output is the following:
>
> ***
> Warning: PyGSL is not available. The stiffness test will be skipped.
> Warning: No module named 'pygsl'
>
>
> Option "nest_path" does not exist in builder
> ---------------------------------------------------------------------------
> CalledProcessError                        Traceback (most recent call 
> last)
> /opt/data/nestml/pynestml/codegeneration/nest_builder.py in build(self)
>     149         try:
> --> 150             subprocess.check_call(make_all_cmd, 
> stderr=subprocess.STDOUT, shell=shell,
>     151                                   
> cwd=str(os.path.join(target_path)))
>
> /usr/lib/python3.8/subprocess.py in check_call(*popenargs, **kwargs)
>     363             cmd = popenargs[0]
> --> 364         raise CalledProcessError(retcode, cmd)
>     365     return 0
>
> CalledProcessError: Command '['make', 'all']' returned non-zero exit status 2.
>
> During handling of the above exception, another exception occurred:
>
> GeneratedCodeBuildException               Traceback (most recent call last)
> <ipython-input-2-f7696df63255> in <module>
> ----> 1 generate_nest_target(input_path="izhikevich_solution.nestml",
>       2                      target_path="/tmp/nestml-component",
>       3                      module_name="nestml_izhikevich_module",
>       4                      suffix="_nestml",
>       5                      logging_level="ERROR",
>
> /opt/data/nestml/pynestml/frontend/pynestml_frontend.py in 
> generate_nest_target(input_path, target_path, install_path, 
> logging_level, module_name, store_log, suffix, dev, codegen_opts)
>     181         A dictionary containing additional options for the 
> target code generator.
>     182     """
> --> 183     generate_target(input_path, target_platform="NEST", 
> target_path=target_path, logging_level=logging_level,
>     184                     module_name=module_name, 
> store_log=store_log, suffix=suffix, install_path=install_path,
>     185                     dev=dev, codegen_opts=codegen_opts)
>
> /opt/data/nestml/pynestml/frontend/pynestml_frontend.py in 
> generate_target(input_path, target_platform, target_path, install_path, 
> logging_level, module_name, store_log, suffix, dev, codegen_opts)
>     150         FrontendConfiguration.set_codegen_opts(codegen_opts)
>     151 
> --> 152     if not process() == 0:
>     153         raise Exception("Error(s) occurred while processing the 
> model")
>     154 
>
> /opt/data/nestml/pynestml/frontend/pynestml_frontend.py in process()
>     278                                             
> options=FrontendConfiguration.get_codegen_opts())
>     279         if _builder is not None:
> --> 280             _builder.build()
>     281 
>     282     if FrontendConfiguration.store_log:
>
> /opt/data/nestml/pynestml/codegeneration/nest_builder.py in build(self)
>     151                                   
> cwd=str(os.path.join(target_path)))
>     152         except subprocess.CalledProcessError as e:
> --> 153             raise GeneratedCodeBuildException('Error occurred 
> during \'make all\'! More detailed error messages can be found in 
> stdout.')
>     154 
>     155         # finally execute make install
>
> GeneratedCodeBuildException: Error occurred during 'make all'! More 
> detailed error messages can be found in stdout.
> ***
> I installed Boost with 'sudo apt-get install libboost-all-dev' from the 
> terminal.
>
> Can you help me?
>
> Best,
>
> Salvo
> _______________________________________________
> NEST Users mailing list -- users@nest-simulator.org
> To unsubscribe send an email to users-leave@nest-simulator.org