Singularity: Failed to compile v3.5 on Ubuntu

Created on 20 Nov 2019  路  23Comments  路  Source: hpcng/singularity

Version of Singularity:

What version of Singularity are you using? Run:

v3.5.0

mconfig failed:

 ./mconfig

Configuring for project `singularity' with languages: C, Golang
=> running pre-basechecks project specific checks ...
=> running base system checks ...
 checking: host C compiler... cc
 checking: host C++ compiler... c++
 checking: host Go compiler (at least version 1.13)... not found!
mconfig: could not complete configuration
go version
go version go1.13.3 linux/amd64

Most helpful comment

Okay ... Fully remove the /usr/local/go directory, then re-extract downloaded binary. It looks like a newer version was extracted on top of an older version.... Which can have some really weird side effects. :/

All 23 comments

Hello - this has come up in another issue. To allow replication, please could you let us know:

  • What version of Ubuntu are you using?
  • How was go installed (presume apt-get install)?
  • Whether you are running mconfig and go version as root or a normal user.
  • The output of echo $PATH when mconfig fails.

Thanks.

I followed instructions in INSTALL.md file.

What version of Ubuntu are you using?

==> Ubuntu 18.04

How was go installed (presume apt-get install)?

==> Wget to download tar ball and decompress to /usr/local as instructed in INSTALL.md

Whether you are running mconfig and go version as root or a normal user.

==> i was running as normal user

The output of echo $PATH when mconfig fails.

==> Do not have access to the server now, but I checked several time that $PATH contains /usr/local/go/bin:$HOME/go in the front.

same problem here:
Ubuntu 16.04.6 LTS
go version
go version go1.13.3 linux/amd64

What do you get when you run:

env GO111MODULE=off go run mlocal/checks/version.go go1.13

from the top level Singularity source? The above command is the same (similar) that mconfig should try running.

Also, can you add the -v option when you run ./mconfig? I'm not 100% sure if that will change output at this stage, but doesn't hurt to attempt it.

What do you get when you run:

env GO111MODULE=off go run mlocal/checks/version.go go1.13

from the top level Singularity source? The above command is the same (similar) that mconfig should try running.

Also, can you add the -v option when you run ./mconfig?

I was tracing to this problem as well when I realized mconfig failed at this line: https://github.com/sylabs/singularity/blob/fd2967d350d77afbc19d78fab63598fa7f037a7d/mconfig#L555

env GO111MODULE=off go run mlocal/checks/version.go go1.13
# runtime
/usr/local/go/src/runtime/stubs_x86.go:10:6: stackcheck redeclared in this block
        previous declaration at /usr/local/go/src/runtime/stubs_amd64x.go:10:6
/usr/local/go/src/runtime/unaligned1.go:11:6: readUnaligned32 redeclared in this block
        previous declaration at /usr/local/go/src/runtime/alg.go:321:40
/usr/local/go/src/runtime/unaligned1.go:15:6: readUnaligned64 redeclared in this block
        previous declaration at /usr/local/go/src/runtime/alg.go:329:40
./mconfig -v
Configuring for project `singularity' with languages: C, Golang
=> running pre-basechecks project specific checks ...
=> running base system checks ...
 checking: host C compiler... cc
 checking: host C++ compiler... c++
 checking: host Go compiler (at least version 1.13)... not found!
mconfig: could not complete configuration

Okay ... Fully remove the /usr/local/go directory, then re-extract downloaded binary. It looks like a newer version was extracted on top of an older version.... Which can have some really weird side effects. :/

@biocyberman - that looks as though you might have installed a new version of go over the top of an old one? It fits reports on the web for that with for 1.13

edit - @jmstover beat me to it

same for me, mix with old version. It's working now. Thanks.

@jmstover and @dctrud You guys are so fast, I didn't mange to google the error message :)
I suspected the mixing problem yesterday and cleaned up ~/go directory but did not /usr/local/go

same issue in Linux Mint 18.2

same issue in Linux Mint 18.2

Try this: https://github.com/sylabs/singularity/issues/4765#issuecomment-557215786

same issue in Linux Mint 18.2

Try this: #4765 (comment)

thanks, and sorry for the TL;DR! Maybe best to add as hint to the installation instructions...

Same problem found in Debian 9.11 and solved with https://github.com/sylabs/singularity/issues/4765#issuecomment-557215786
I agree that a hint could be added to the installation instructions as it seems to be a common problem.

We already have a note in the INSTALL.md, under the install golang section:

_NOTE: if you are updating Go from a older version, make sure you remove /usr/local/go before reinstalling it._

Afaik, the installation guide does not have this note, but it should.

I have followed all of the instructions on this github issue, as well as the instructions here, and still got the not found! error for golang on Ubuntu 18.04.

@conchoecia
I may have modified it mine, but does your /etc/sudoers file on 18.04 have a secure_path value set?

The other thing is be sure you also run this as the root user if following the INSTALL.md steps:

echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \
echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \
mkdir -m 700 ${HOME}/go

Same problem!

Uninstall go, install it again, and also remove the singularity directory and download it again from scratch.

Oh no, not another Go problem.

Closing this. It is now mentioned in the INSTALL.md and the docs that Go needs to be removed before a new version is extracted.

After I installed go via epel, mconfig still could't find go. After I removed '.cache/go-build' everything is fine. Actually I don't know when and how this link was generated.

$ env GO111MODULE=off go run mlocal/checks/version.go go1.13
failed to initialize build cache at /home/.../.cache/go-build: mkdir /home/.../.cache/go-build: file exists
$ ll /home/../.cache/go-build
lrwxrwxrwx ... /home/.../.cache/go-build -> /tmp/asdfsadf # <- obviously already gone
$ rm ~/.cache/go-build -f
$ env GO111MODULE=off go run mlocal/checks/version.go go1.13
Found Go release tag go1.13.

Just for the record, I had the same error (checking: host Go compiler (at least version 1.13)... not found!) even though go was set up properly. To fix, make sure you have the right permissions on the folder GOCACHE given by go env.

If someone faces this issue, follow this installation guide.

sudo apt-get update && \
sudo apt-get install -y build-essential \
libseccomp-dev pkg-config squashfs-tools cryptsetup

sudo rm -r /usr/local/go

export VERSION=1.13.15 OS=linux ARCH=amd64  # change this as you need

wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz && \
sudo tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz

echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \
echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \
source ~/.bashrc

curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh |
sh -s -- -b $(go env GOPATH)/bin v1.21.0

mkdir -p ${GOPATH}/src/github.com/sylabs && \
cd ${GOPATH}/src/github.com/sylabs && \
git clone https://github.com/sylabs/singularity.git && \
cd singularity

git checkout v3.6.3

cd ${GOPATH}/src/github.com/sylabs/singularity && \
./mconfig && \
cd ./builddir && \
make && \
sudo make install

singularity version
Was this page helpful?
0 / 5 - 0 ratings