chapel-lang/chapel — pull request #573 by thomasvandoren (2014-09-25 14:59:10+00:00)
Title: Check runtime gen path.

**Work in progress.** Adding here to start discussion.

Add a check when building generated C code to ensure the expected runtime
configuration has been compiled. If it has not, warn the user.

I ran into a situation the other day that inspired this. I had compiled a number of
configuration with CHPL_LLVM=llvm and CHPL_GMP=gmp (gmp was not set
explicitly, but was built speculatively). When I ran tests, I set CHPL_GMP=none since
GMP and LLVM do not currently work together. As you might expect, I ended up with
lots of errors of the form:

```
clang: error: no such file or directory: '$CHPL_HOME/lib/cray-xc.cray-prgenv-gnu.arch-sandybridge.loc-flat.comm-none.tasks-qthreads.tmr-generic.mem-cstdlib.atomics-intrinsics.gmp-none.hwloc.re2.wide-struct.fs-none/main.o'
error: Make Binary - Linking
```

This is a legitimate error, but the actual issue is not clear from the message. I think it
would be easier to diagnose if the error said something about not having compiled the
expected configuration, which is what this pull request does.

### Open for Discussion

* What should the warning message say? Right now it says "Expected runtime directory
does not exist. Was it compiled?". If CHPL_DEVELOPER is set, it might be useful to
actually print the expected runtime directory name. If this is running inside the cray module,
(i.e. $CHPL_MODULE_HOME == $CHPL_HOME) the message could say something like,
"This configuration is not compiled for the module. Please send blah blah a message if you
would like it included...".

* Should this be an `$(error)` instead of a `$(warning)`? If the expected directory is missing,
there will be an error eventually.