chore(example): add nvvm library path to LD_LIBRARY_PATH and add back the add example in CI#190
Conversation
… the `add` example in CI When linking `libnvvm.so.4` into `librustc_codegen_nvvm.so` shared library via the `cust_raw` package, we specified the following parameters in the `build.rs`: - cargo::rustc-link-search=native=xxx - cargo::rustc-link-lib=dylib=nvvm According to the [Cargo documentation](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-search), the path we added to the `rustc-link-search` parameter is not further populated to the `LD_LIBRARY_PATH` for search by the transitive dependencies. > These paths are also added to the dynamic library search path > environment variable if they are within the OUT_DIR. The behavior is intended to be limited to the OUT_DIR so the `libnvvm.so.4`, which lives as a part of the CUDA SDK, is excluded. Therefore, we must add it to the LD_LIBRARY_PATH manually in our container build stage.
|
@jorge-ortega In addition, should we make the develop container packages public in the rust-gpu org so other people can download and use them if they want? |
|
I think that might be a question for @LegNeato Any idea why setting the LD_LIBRARY_PATH and running |
Linux env must be exported before it can take effect. I did test via export LD_LIBRARY_PATH in container and it did work. ld.conf has a cache as well so it must be updated to take effect too. |
|
I thought I tried |
Yeah, I think that would be better rather than people having to figure out how to cobble together a build env. |
@adamcavendish I flipped these settings, the container packages should now be public. |
When linking
libnvvm.so.4intolibrustc_codegen_nvvm.soshared library via thecust_rawpackage, we specified the following parameters in thebuild.rs:According to the Cargo documentation, the path we added to the
rustc-link-searchparameter is not further populated to theLD_LIBRARY_PATHfor search by the transitive dependencies.The behavior is intended to be limited to the OUT_DIR so the
libnvvm.so.4, which lives as a part of the CUDA SDK, is excluded. Therefore, we must add it to the LD_LIBRARY_PATH manually in our container build stage.Since this PR changes the container, we would need to retrigger a container build manully before we can see correct CI results.
Resolves #129.