$CFLAGS not respected when generating the .i file
If CFLAGS="-I <somewhere>", ableC doesn't pick up on that and instead fails the build.
https://github.com/melt-umn/ableC/blob/4bd34c1824d906e5476cfacac7665cfea9f2e34b/edu.umn.cs.melt.ableC/drivers/parseAndPrint/Driver.sv
Can we get environment variables in Silver?
Workaround: call java -jar ableC.jar whatever.c $CFLAGS
I don't believe gcc automatically includes this, either. I don't see a reason why we should do otherwise?
make does, though. Really it's a matter of whether we want to have ableC read the environment variable or if compile.sh should pass it in. (And if compile.sh should, we should modify all the existing compile.sh's to make them actually do this...)
Yes, make has an implicit rule for compiling .c files that uses that make variable (not actually an environment variable, but if it is provided as an environment variable, but make copies the values of environment variable into make variables), which can be overridden. This should definitely not be something that the compiler worries about. Also the CFLAGS passed to ableC are usually completely different than the ones passed to gcc, anyway.
Okay, I'll just change the compile.sh's then. Which CFLAGS would you pass to gcc but not ableC? In my case, it's just -I and -L flags.
In general, gcc shouldn't need any -I flags when compiling ableC-generated code (since it is already preprocessed), and ableC shouldn't need any flags other than -I since it is only running the preprocessor.
Lucas Kramer
On Wed, Jan 25, 2017 at 3:53 PM, Nathaniel Ringo [email protected] wrote:
Okay, I'll just change the compile.sh's then. Which CFLAGS would you pass to gcc but not ableC? In my case, it's just -I and -L flags.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/melt-umn/ableC/issues/20#issuecomment-275244586, or mute the thread https://github.com/notifications/unsubscribe-auth/AIE1inMQmMVnETm-fhXpxLUa_4PdYAJKks5rV8RHgaJpZM4Lt6wJ .
Should I just try to parse out the -I flags then? These are system-wide (eh, user-wide) CFLAGS, not ableC-specific.
If that is what you are trying to do, you should just be able to update the C_INCLUDE_PATH environment variable with those include locations, which should then get read by gcc when it is called by ableC.
Lucas Kramer
On Wed, Jan 25, 2017 at 3:57 PM, Nathaniel Ringo [email protected] wrote:
Should I just try to parse out the -I flags then? These are system-wide (eh, user-wide) CFLAGS, not ableC-specific.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/melt-umn/ableC/issues/20#issuecomment-275245693, or mute the thread https://github.com/notifications/unsubscribe-auth/AIE1iscQ9pKA-fdbQYMauXekkyHmbD2vks5rV8VWgaJpZM4Lt6wJ .
Why is this needed if you can just specify it in compile.sh?
These scripts are meant to demonstrate how one would use the extension in isolation.
We do need some examples that show how to combine multiple extensions and to use them.
"In practice" I do not think it is bad for people write makefiles for all of this. I can see that this can get messy if an extension is going to want to compile the generated C program with some specific libraries, but that can be considered a documentation issue, no?
We can discuss this briefly in tomorrow's meeting.
-Eric
On Wed, Jan 25, 2017 at 4:03 PM, Lucas Kramer [email protected] wrote:
If that is what you are trying to do, you should just be able to update the C_INCLUDE_PATH environment variable with those include locations, which should then get read by gcc when it is called by ableC.
Lucas Kramer
On Wed, Jan 25, 2017 at 3:57 PM, Nathaniel Ringo <[email protected]
wrote:
Should I just try to parse out the -I flags then? These are system-wide (eh, user-wide) CFLAGS, not ableC-specific.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/melt-umn/ableC/issues/20#issuecomment-275245693, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIE1iscQ9pKA- fdbQYMauXekkyHmbD2vks5rV8VWgaJpZM4Lt6wJ> .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/melt-umn/ableC/issues/20#issuecomment-275247140, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOhdzMK35Mv9-pkRBuqSv1Ki39-KApVks5rV8a3gaJpZM4Lt6wJ .