EnzymeAD / rust

A rust fork to work towards Enzyme integration
https://www.rust-lang.org
Other
72 stars 8 forks source link

Recognize misspelled env vars #100

Closed ZuseZ4 closed 6 months ago

ZuseZ4 commented 8 months ago

Given the amount of ENZYME dbg vars, we should loop through all env vars and check if any unknown ones start with ENZYME, and abort compilation because it probably implies a typo.

jedbrown commented 8 months ago

I agree with the sentiment, though it'll be common enough for people to define ENZYME_DIR or ENZYME_LIB for their build systems.

ZuseZ4 commented 8 months ago

I am not sure how many people will actually develop both rust and enzyme and set those as env vars? Usually you pass them directly to cmake as -D something, right? But I als0 wouldn't mind much adding them to the list of whitelisted flags.

jedbrown commented 8 months ago

Here's an example doing that. The user sets ENZYME_LIB=/path/to/ClangEnzyme-17.so to activate Enzyme, which is otherwise optional. When I merge Rust support to this repository, it will still be able to coexist with the C/Enzyme code. https://gitlab.com/micromorph/ratel/-/blob/main/Makefile?ref_type=heads#L57 https://gitlab.com/micromorph/ratel/-/blob/main/Makefile?ref_type=heads#L204

ZuseZ4 commented 8 months ago

https://xkcd.com/1172/ ? But fair, I just didn't thought about pure makefiles.

jedbrown commented 8 months ago

There's an argument that it was a mistake that make variables set on the command line to be exported by default, but that bird has flown.

ZuseZ4 commented 6 months ago

closing since both t-lang and t-compiler recommended to move this to flags, which IIRC already handle this.