Some production servers tend to have really outdated linux versions. This makes the whole business virtual environments rather cloudy when it comes to the competence for compiling binaries. For example, ld
will generally be called from the host system and not the virtual environment.
I found little to no information on how to successfully compile rust projects in CentOS 7. I am posting this question together with the answer since it is a recommended viable option according to stackoverflow) since this might help future users of CentOS.
For a conda
-based installation of rust
and cargo
some compiler linkers are missing.
$ cargo build
Compiling hello_cargo v0.1.0 (/local/users/me/src/rasti/hello_cargo)
error: linker `/full/path/to/conda/env/bin/x86_64-conda-linux-gnu-cc` not found
|
= note: No such file or directory (os error 2)
error: aborting due to previous error
error: could not compile `hello_cargo`.
To learn more, run the command again with --verbose.
System running:
3.10.0-1062.18.1.el7.x86_64
Having installed 'gxx_linux-64' on the conda environment was not enough. Only after including sysroot_linux-64
was then cargo
able to compile.