apptainer / singularity

Singularity has been renamed to Apptainer as part of us moving the project to the Linux Foundation. This repo has been persisted as a snapshot right before the changes.
https://github.com/apptainer/apptainer
Other
2.52k stars 424 forks source link

No package 'libseccomp' found error when trying to build #5242

Closed terrycojones closed 4 years ago

terrycojones commented 4 years ago

I am trying to install singularity following the instructions at https://sylabs.io/guides/3.5/user-guide/quick_start.html#compile-the-singularity-source-code having downloaded and extracted the 3.5.3 tarball running on Ubuntu 19.10.

The mconfig step runs fine and includes "checking: libseccomp+headers... yes" in its output.

The make in builddir gives the following error, though:

builddir $ make
 GO singularity
    [+] GO_TAGS "containers_image_openpgp sylog imgbuild_engine oci_engine singularity_engine fakeroot_engine apparmor selinux seccomp"
# pkg-config --cflags  -- libseccomp libseccomp
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
make: *** [Makefile:162: singularity] Error 2

Suprisingly, I don't find an easy solution to this online. I already have libseccomp2, libseccomp-dev and seccomp all installed via apt get and all with up-to-date versions:

builddir $ sudo apt install libseccomp2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libseccomp2 is already the newest version (2.4.1-0ubuntu0.19.10.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

builddir $ sudo apt install libseccomp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libseccomp-dev is already the newest version (2.4.1-0ubuntu0.19.10.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

builddir $ sudo apt install seccomp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
seccomp is already the newest version (2.4.1-0ubuntu0.19.10.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

When I install seccomp manually, from a git clone following https://github.com/seccomp/libseccomp I end up with the same error as above.

Maybe related to #3874 ?

Thanks!

dtrudg commented 4 years ago

Hi Terry - This isn't likely related to #3874 - in that one once the correct package is installed from the right repo on RHEL8 all works as expected. If there is a difference between mconfig finding things and make not then it might be something in your environment.

Have you set any *_PATH variables in your environment - or do you have anything like a conda environment loaded?

Output of env | grep PATH would be useful here, thanks.

terrycojones commented 4 years ago

Thanks @dctrud

I use Python virtual envs and conda (occasionally) but this happens when I don't have them activated. I also normally use fish, but it also happens in bash (as in the following):

$ env | grep PATH
MANDATORY_PATH=/usr/share/gconf/pop.mandatory.path
WINDOWPATH=2
DEFAULTS_PATH=/usr/share/gconf/pop.default.path
PATH=/home/terry/miniconda3/condabin:.:/home/terry/bin:/home/terry/bin/x86_64:/opt/EMBOSS/bin:/home/linuxbrew/.linuxbrew/opt/python/libexec/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/terry/miniconda3/bin:/usr/local/go/bin:/home/terry/dark-matter/hbv/bin:/home/terry/dark-matter/dark-matter/bin:/home/terry/charite/voldemort/bin:/home/terry/charite/diagnostics/bih-pipeline/bin:/home/terry/charite/diagnostics/csd3-pipeline/bin:/home/terry/charite/2019-nCoV-sequences/bin:/home/terry/dark-matter/midtools/bin:/opt/gatk:/usr/local/sbin:/usr/local/bin:/usr/local/acl80:/bin:/usr/bin:/usr/sbin:/sbin:/home/terry/s/net/bwa:/home/terry/s/net/bowtie2:/opt/SPAdes/bin:/home/terry/.cargo/bin:/home/terry/s/net/edirect/edirect:/home/linuxbrew/.linuxbrew/opt/fzf/bin
x1 ~/s/net/singularity/builddir $ make
 GO singularity
    [+] GO_TAGS "containers_image_openpgp sylog imgbuild_engine oci_engine singularity_engine fakeroot_engine apparmor selinux seccomp"
# pkg-config --cflags  -- libseccomp libseccomp
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
make: *** [Makefile:162: singularity] Error 2
dtrudg commented 4 years ago

Hi @terrycojones - your PATH here is quite complex. Can you see what you get when you do a

dave@piran~> which pkg-config
/bin/pkg-config

You'll need to have the distribution one come up /bin or /usr/bin - if you get something else it's coming from something conda or linuxbrew related in your PATH (they can provide their own pkg-config for their provided libraries) and that's not where you have libseccomp installed. The make process will need to see the distro pkg-config so you'd want a PATH that doesn't include anywhere else that pkg-config is being provided.

terrycojones commented 4 years ago

@dctrud Aha.... thank you! I got those things out of my PATH, then uninstalled the manually installed libseccomp (mentioned above) and the build runs cleanly.

Closing this - thanks a lot for the help!