nestml icon indicating copy to clipboard operation
nestml copied to clipboard

NESTML on MacOS

Open tfardet opened this issue 4 years ago • 5 comments

It seems that on Mac (at least for BigSur) using Homebrew to install NEST gives a code that has been compiled via a clang located in /usr/local/bin/clang++. However, on that system, clang is located in /usr/bin/clang++.

The problem comes from the fact that the generated CMakeLists.txt uses set( CMAKE_CXX_COMPILER "${NEST_COMPILER}" ) and so it all crashes and burns. I guess it's important to compile with the same tool, but I'd think it would be better to let cmake autodetect CXX and just check that it is compatible with NEST_COMPILER rather than hardcoding it.

Thoughts?

In terms of consequences, right now this means that one must manually edit the file, then run cmake and make install, which is probably beyond the ability of what I think would be the typical NESTML target audience on that platform.

tfardet avatar Oct 16 '21 07:10 tfardet

Isn't this an issue with NEST Simulator, namely that nest-config is not returning the right path?

clinssen avatar Oct 17 '21 11:10 clinssen

I don't think so: NEST is telling about the path of the compiler that compiled it... using precompiled images, there's no reason it's valid anymore... and there's definitely no way for NEST to solve this since, by definition, it cannot know in advance about the system it'll be installed on later. I think NESTML should not assume that the path is valid but just autodetect or use the CXX variable and check that the compilers are compatible

tfardet avatar Oct 17 '21 12:10 tfardet

See https://github.com/nest/nest-simulator/pull/2543.

Todo: replace https://github.com/nest/nestml/blob/d37cf6720a308acfd2a5b02b9b2bdc2102cd62eb/pynestml/codegeneration/resources_nest/point_neuron/setup/CMakeLists.txt.jinja2#L110 with a check that compiler ID matches. Should there be a check on compiler versions as well? (Equality would not be adequate as a slightly-newer compiler for NESTML than NEST would be fine.)

clinssen avatar Nov 30 '22 12:11 clinssen

I think we can probably just check that it's the same major version and hope for the best (or don't even check any version number and just cross our fingers ^^)

tfardet avatar Nov 30 '22 12:11 tfardet

This issue needs to be fixed in case the conda-forge distributed version of NEST is used, cf. https://github.com/nest/nestml/issues/689

espenhgn avatar Dec 22 '22 15:12 espenhgn