singularityhub / singularity-hpc

Local filesystem registry for containers (intended for HPC) using Lmod or Environment Modules. Works for users and admins.
https://singularity-hpc.readthedocs.io
Mozilla Public License 2.0
111 stars 26 forks source link

linker `cc` not found when compiling rust program #441

Closed DevinBayly closed 3 years ago

DevinBayly commented 3 years ago

Describe the bug I'm currently unable to compile my rust code using this container ghcr.io/autamus/rust:1.50.0 from https://singularityhub.github.io/singularity-hpc/r/ghcr.io-autamus-rust/ and the repository https://github.com/DevinBayly/boids_recreated To Reproduce

(base) [baylyd@r5u09n1 ~]$ cd Documents/
(base) [baylyd@r5u09n1 Documents]$ git clone https://github.com/DevinBayly/boids_recreated.git
Cloning into 'boids_recreated'...
remote: Enumerating objects: 96, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 96 (delta 56), reused 84 (delta 47), pack-reused 0
Unpacking objects: 100% (96/96), done.
(base) [baylyd@r5u09n1 Documents]$ cd singularity-hpc/
(base) [baylyd@r5u09n1 singularity-hpc]$ module use ./modules
(base) [baylyd@r5u09n1 singularity-hpc]$ module load ghcr.io/autamus/rust/1.50.0
(base) [baylyd@r5u09n1 singularity-hpc]$ cd ..
(base) [baylyd@r5u09n1 Documents]$ cd boids_recreated/
(base) [baylyd@r5u09n1 boids_recreated]$ cargo check
   Compiling libc v0.2.90
   Compiling autocfg v1.0.1
    Checking cfg-if v1.0.0
   Compiling bitflags v1.2.1
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.64
    Checking lazy_static v1.4.0
    Checking byteorder v1.4.3
   Compiling log v0.4.14
    Checking scopeguard v1.1.0
   Compiling proc-macro2 v0.4.30
    Checking cfg-if v0.1.10
    Checking ahash v0.4.7
   Compiling unicode-xid v0.1.0
   Compiling autocfg v0.1.7
    Checking rand_core v0.4.2
    Checking slab v0.4.2
    Checking bit-vec v0.6.3
    Checking fixedbitset v0.2.0
    Checking smallvec v1.6.1
   Compiling xml-rs v0.8.3
   Compiling nix v0.14.1
   Compiling memchr v2.3.4
    Checking pin-project-lite v0.2.6
    Checking void v1.0.2
   Compiling rayon-core v1.9.0
   Compiling proc-macro-hack v0.5.19
    Checking lazycell v1.3.0
   Compiling getrandom v0.2.2
   Compiling khronos-egl v3.0.2
   Compiling proc-macro-nested v0.1.7
    Checking arrayvec v0.5.2
    Checking same-file v1.0.6
    Checking futures-core v0.3.13
    Checking adler32 v1.2.0
   Compiling cfg_aliases v0.1.1
   Compiling maybe-uninit v2.0.0
   Compiling crc32fast v1.2.1
    Checking either v1.6.1
    Checking downcast-rs v1.2.0
    Checking futures-sink v0.3.13
   Compiling pkg-config v0.3.19
    Checking pin-utils v0.1.0
    Checking futures-io v0.3.13
    Checking weezl v0.1.4
    Checking glow v0.7.2
    Checking inplace_it v0.3.3
    Checking xdg v2.2.0
    Checking adler v1.0.2
    Checking futures-task v0.3.13
    Checking quick-error v1.2.3
   Compiling cgmath v0.17.0
    Checking color_quant v1.1.0
    Checking copyless v0.1.5
    Checking ppv-lite86 v0.2.10
    Checking regex-syntax v0.6.23
   Compiling anyhow v1.0.39
    Checking percent-encoding v2.1.0
    Checking termcolor v1.1.2
    Checking scoped_threadpool v0.1.9
    Checking libloading v0.6.7
    Checking instant v0.1.9
    Checking lock_api v0.4.2
    Checking lock_api v0.3.4
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

    Checking tracing-core v0.1.17
error: aborting due to previous error

error: aborting due to previous error

error: aborting due to previous error

error: could not compile `rayon-core`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: aborting due to previous error

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: build failed
(base) [baylyd@r5u09n1 boids_recreated]$

Expected behavior

The cargo check should compile without errors

Version of Singularity and Singularity Registry HPC Client

singularity version 3.8.0-1.el7

shpc version 0.0.31

vsoch commented 3 years ago

So I think this is about the autamus container, which means it's about the spack install, and not shpc directly. SHPC just provides these containers, but is not responsible for the executables functionality. For example, I can reproduce your error just putting the container with singularity, and doing the same:

cd /tmp
git clone https://github.com/DevinBayly/boids_recreated
singularity  pull docker://ghcr.io/autamus/rust:1.50.0
$ singularity shell rust_1.50.0.sif 

# double check version
Singularity> which cargo
/opt/view/bin/cargo
Singularity> cargo --version
cargo 1.50.0

# There is no cc
Singularity> which cc

Singularity> cd boids_recreated/
Singularity> cargo check
# the same error reproduces

So if you believe rust is missing a dependency, you should open this issue in spack. If this isn't technically a dependency and you need the executable cc, then you can add a container to autamus. Let me know if you have any questions.

DevinBayly commented 3 years ago

Yea I posted here because I really didn't know where else made sense. I'll go ahead and close this one.

Would you also suggest that I move the issue here https://github.com/autamus/registry/issues because the rust spack python recipe (if it's even called that? totally out of my depth) https://github.com/autamus/registry/blob/main/spack/r/rust/package.py is in this repo https://github.com/autamus/registry?

Or when you say open the issue in spack, like post it here https://github.com/spack/spack/issues?

vsoch commented 3 years ago

I think it depends if we think this is a package bug (eg cc is a Dependency of rust) and thus is a spack issue, or “would be nice to have” in which case we could add in autamus. Ping @alecbcs for his thoughts!

DevinBayly commented 3 years ago

Will do! Thanks @vsoch =D