On Jul 21, 2009, at 6:34 PM, Jeff Squyres wrote:

I'm quite confused about what this component did to the base functions. I haven't had a chance to digest it properly, but it "feels wrong"... Iain -- can you please explain the workings of this component and its interactions with the base?

The autodetect component gets loaded after the environment component, and before the config component. So environment variables like OPAL_PREFIX will override it.

When it loads, it finds the directory containing libopen-pal.so (assuming that is where the autodetect component actually is) and sets its install_dirs_data.libdir to that. The other fields of install_dirs_data are set to "${infer-libdir}". So when the base component loads autodetect, and no environment variables have set any of the fields, opal_install_dirs.everything_except_libdir is set to "$ {infer-libdir}".

(If the autodetect component is statically linked into an application, then it will set bindir rather than libdir.)

The base component looks for fields set to "${infer-foo}", and calls opal_install_dirs_infer to figure out what the field should be. For example, if opal_install_dirs.prefix is set to "${infer-libdir}", then it calls opal_install_dirs_infer("prefix", "libdir}", 6, &component- >install_dirs_data).

Opal_install_dirs_infer expands everything in component- >install_dirs_data.libdir *except* "${prefix}". Let's say that ompi was configured so that libdir is "${prefix}/lib", and the actual path to libopen-pal.so is /usr/local/lib/libopen-pal.so. The autodetect component will have set opal_install_dirs.libdir to "/usr/local/lib". It matches the tail of "${prefix}/lib" to "/usr/local/lib", and infers that the remainder must be the prefix, so it sets opal_install_dirs.prefix to "/usr/local".

Other directories (e.g., pkgdatadir) presumably cannot be inferred from libdir, and opal_install_dirs_infer will return NULL. The config component will then load some value into that field, and things will work as they did before.

Iain

Reply via email to