sst-macro icon indicating copy to clipboard operation
sst-macro copied to clipboard

sst++ does not pass flags correctly

Open burlen opened this issue 2 years ago • 1 comments

sst++ in a standalone build of v13.1.0_Final of does not pass flags such as -DFOO through.

to reproduce:

test.cc

#if defined(FOO)
foo // this should error out
#else
int foo(int f) { return f + 1; };
#endif

This code should not compile if -DFOO is passed to the compiler. for example using g++

 g++ test.cc -c  -DFOO
test.cc:2:1: error: 'foo' does not name a type
    2 | foo // this should error out
      | ^~~

This is the expected and correct result. However, with sst++ the define is not propagated

sst++ test.cc -c  -DFOO

a .o file is produced, but this command should fail to compile.

burlen avatar Dec 14 '23 18:12 burlen

https://github.com/sstsimulator/sst-macro/blob/master/bin/sstcompile.py#L246 Missing args.D collection The following line shoud be added:

ppArgs.extend(map(lambda x: "-D%s" % x, args.D))

shady831213 avatar Sep 25 '24 10:09 shady831213