Fcl expansion doesn't handle absolute path includes.
Normally fcl expansion expects to find #included fcl files on $FHICL_FILE_PATH. It should also be possible to #include files using an absolute path, beginning with "/" or "." (like c preprocessor). Absolute path #include's don't work currently. Some might say this is a feature, but I say it is a bug. There are clearly use cases where you want to #include files not on $FHICL_FILE_PATH.
$ ART_DEBUG_CONFIG=1;lar -c subrun_wrapper.fcl Failed to parse the configuration file 'subrun_wrapper.fcl' with exception ---- search_path BEGIN Can't find file "./wrapper.fcl" ---- search_path END Art has completed and will exit with status 7002. $ ls -l wrapper.fcl -rw-r--r-- 1 greenlee microboone 413 Apr 30 16:45 wrapper.fcl $ cat subrun_wrapper.fcl #include "./wrapper.fcl" source.firstSubRun: 3
Above example also fails if normalized path beginning with "/" is used.
#2 Updated by Christopher Green over 6 years ago
- Description updated (diff)
This is neither a bug nor a feature: it is a requirement as specified by the stakeholders whose input was used to create art. We can discuss this at the stakeholders meeting, but the motivation was to prevent non-portable configurations from being checked in and/or being used in production.
As it happens, all you need to do is build your own
lar-like exec that uses a different look-up policy in its
artapp equivalent. See art:art/Framework/Art/art.cc.in and art:art/Framework/Art/artapp.cc.in. For examples of policies, see art:art/Utilities/FirstAbsoluteOrLookupWithDotPolicy.h, artdaq:artdaq/Utilities/SimpleLookupPolicy.h, and cetlib/cetlib/filepath_maker.h.
However, I strongly advise against allowing this modified exec in a production setting, or even making it generally available: experience with data file specifications on NOvA (different, but close enough for this comparison) suggest that you will start to see checked-in FHiCL files very quickly which will prevent use of your software in other environments than the one required by the absolute
PATH. Seriously, you'd be buying yourself more problems than you're solving. We recommend using a suitable base path to
FHICL_FILE_PATH and use a relative path instead.