Augustus icon indicating copy to clipboard operation
Augustus copied to clipboard

"Fatal error: can't create gtest-all.o: Read-only file system" while building the Singularity container

Open ttys42 opened this issue 2 years ago • 2 comments

Hi I'm using singularity version 3.8.7-1.el8 and creating the Singularity container fails with

INFO:    Adding help info
INFO:    Adding environment to container
INFO:    Adding testscript
INFO:    Running testscript
cd src && make unittest
make[1]: Entering directory '/opt/augustus/src'
cd googletest && make
make[2]: Entering directory '/opt/augustus/src/googletest'
g++ -isystem ./include -I. -g -Wall -Wextra -pthread -std=c++11 -c \
            ./src/gtest-all.cc
Assembler messages:
Fatal error: can't create gtest-all.o: Read-only file system
make[2]: *** [Makefile:45: gtest-all.o] Error 1
make[2]: Leaving directory '/opt/augustus/src/googletest'
make[1]: *** [Makefile:140: googletest] Error 2
make[1]: Leaving directory '/opt/augustus/src'
make: *** [Makefile:80: unit_test] Error 2

As everything happens inside the container I assume this is not a local issue?

ttys42 avatar May 11 '22 12:05 ttys42

I've observed the same issue with Singularity 3.8.3. The issue appears to be that the %test section of the Singularity definition file assumes /opt/augustus is writable in the container:

%test
        # Test AUGUSTUS
        cd /opt/augustus
        make unit_test

My understanding is that the commands in the "%test" section are run after the (read-only) container file system has been built.

For systems with Singularity >= 3.9.0, it appears the singularity build --writable-tmpfs option could be used in this case:

  • --writable-tmpfs can be used with singularity build to run the %test section of the build with a ephemeral tmpfs overlay, permitting tests that write to the container filesystem.

For Singularity < 3.9.0, I've verified that the singularity build --notest option (which as the name implied omits the %test section) allows the Singularity image to build successfully:

sudo singularity build --notest augustus.sif Singularity.def

nathanweeks avatar May 19 '22 13:05 nathanweeks

I have the same issue that first floor mentioned. And --notest works for me. Appreciate that nathanweeks share his experience. I am not a root user, So my command is **singularity --fakeroot --notest <>.sif <>.def

DongyaoLiu avatar Nov 02 '22 14:11 DongyaoLiu