Description of problem
My cpp_standalone compilation capabilities broke. Not sure what I did to break it. Maybe it was the Windows11 update? I get the error RuntimeError: Project compilation failed (error code: 2), consider having a look at 'winmake.log'.
Brian2 version is 2.9.0
Python is 3.11.14
Minimal code to reproduce problem
import brian2 as b2
b2.set_device('cpp_standalone', build_on_run=False)
net = b2.Network()
tau = 10*b2.ms
G = b2.NeuronGroup(2, "dv/dt = (1-v)/tau : 1")
net.add(G)
net.run(1*b2.second)
b2.device.build(run=False, directory=None, clean=True)
The complete output:
INFO No numerical integration method specified for group 'neurongroup', using method 'exact' (took 0.03s). [brian2.stateupdaters.base.method_choice]
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[1], line 8
6 net.add(G)
7 net.run(1*b2.second)
----> 8 b2.device.build(run=False, directory=None, clean=True)
File ~\miniforge3\envs\sbilab\Lib\site-packages\brian2\devices\cpp_standalone\device.py:1630, in CPPStandaloneDevice.build(self, directory, results_directory, compile, run, debug, clean, with_output, additional_source_files, run_args, direct_call, **kwds)
1620 self.generate_makefile(
1621 self.writer,
1622 compiler,
(...) 1626 debug=debug,
1627 )
1629 if compile:
-> 1630 self.compile_source(directory, compiler, debug, clean)
1631 if run:
1632 self.run(directory, results_directory, with_output, run_args)
File ~\miniforge3\envs\sbilab\Lib\site-packages\brian2\devices\cpp_standalone\device.py:1162, in CPPStandaloneDevice.compile_source(self, directory, compiler, debug, clean)
1156 if not clean:
1157 error_message += (
1158 " Consider running with "
1159 '"clean=True" to force a complete '
1160 "rebuild."
1161 )
-> 1162 raise RuntimeError(error_message)
1163 else:
1164 with std_silent(debug):
RuntimeError: Project compilation failed (error code: 2), consider having a look at 'winmake.log'.
The winmake.log ends on
synapses_classes.cpp
NMAKE : fatal error U1073: don't know how to make 'sourcefiles.txt'
Stop.
I can provide the full winmake.txt if that helps.
What you have aready tried
I created a new environment but it did not help.
I checked my Visual Studio Build Tools. I have Visual Studio Build Tools 2022. I have installed:
- C++ Build Tools core features
- MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
- Windows 10 SDK
- Windows 11 SDK
- C++ CMake tools for Windows
- C++ core features
- Windows Universal CRT SDK
And a bunch of other stuff that I think is irrelevant to Brian2.