soedinglab / hh-suite

Remote protein homology detection suite.
https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-019-3019-7
GNU General Public License v3.0
515 stars 128 forks source link

c++: fatal error: Killed signal terminated program cc1plus #280

Closed paulgarias closed 2 years ago

paulgarias commented 2 years ago

I am attempting to build hh-suite from a Dockerfile from alphafold (https://github.com/deepmind/alphafold).

I am unable to get it to build on using the docker command. The output is located there:
https://gist.github.com/paulgarias/9484f0cccb045e8e01a9c148f1b024d1.

9 50.30 [ 64%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhdatabase.cpp.o

9 52.50 [ 65%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhhalfalignment.cpp.o

9 53.76 [ 66%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhviterbirunner.cpp.o

9 55.49 [ 67%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhfunc.cpp.o.

9 78.92 c++: fatal error: Killed signal terminated program cc1plus.

9 78.92 compilation terminated.

9 78.93 make[2]: *** [src/CMakeFiles/HH_OBJECTS.dir/build.make:427: src/CMakeFiles/HH_OBJECTS.dir/hhfunc.cpp.o] Error 1

9 78.94 make[1]: *** [CMakeFiles/Makefile2:814: src/CMakeFiles/HH_OBJECTS.dir/all] Error 2

9 78.95 make: *** [Makefile:152: all] Error 2

The docker file is located here:
https://github.com/deepmind/alphafold/blob/main/docker/Dockerfile

I removed the section where the hhsuite is installed and the Dockerfile is able to complete.

Can I get any guidance on how to proceed?

milot-mirdita commented 2 years ago

That sounds like the compiler is getting killed by the OOM-killer due to using to many resources. You can remove the -j 4 so it compiles with a single cpu core only.

paulgarias commented 2 years ago

Thank you for responding so quickly with the suggestion.

I removed that -j 4, it still suffers from the same problem. Updated output:

50.18 [ 64%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhdatabase.cpp.o 52.39 [ 65%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhhalfalignment.cpp.o 53.62 [ 66%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhviterbirunner.cpp.o 55.27 [ 67%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/hhfunc.cpp.o 79.75 c++: fatal error: Killed signal terminated program cc1plus 79.75 compilation terminated. 79.75 make[2]: [src/CMakeFiles/HH_OBJECTS.dir/build.make:427: src/CMakeFiles/HH_OBJECTS.dir/hhfunc.cpp.o] Error 1 79.77 make[1]: [CMakeFiles/Makefile2:814: src/CMakeFiles/HH_OBJECTS.dir/all] Error 2 79.77 make: *** [Makefile:152: all] Error 2

executor failed running [/bin/bash -c make && make install && ln -s /opt/hhsuite/bin/* /usr/bin && rm -rf /tmp/hh-suite]: exit code: 2

milot-mirdita commented 2 years ago

What hardware specs does the machine running docker have?

paulgarias commented 2 years ago

I'm currently building using docker on a MacOS, but I will eventually need to convert this to a singularity image. Perhaps I should convert the whole process to singularity def file instead and build on the HPC cluster instead (?)

milot-mirdita commented 2 years ago

I am not sure how docker on macos works, but it seems like you can increase the RAM the VM is allowed to use: https://stackoverflow.com/a/39720010

Then it should compile correctly.

paulgarias commented 2 years ago

This is excellent. The default amount of memory available is set to 2GB (!). I have increased it and it was able to run past this issue and on to the next step.

Thanks for your help!

Cyrus008 commented 2 years ago

When compiling C++ in the Linux system, the following error occurs, causing the compilation to abort:

  1. Problem description
  2. Solution - swap partition

[Solution - Swap partition]

After checking the relevant information, it is believed that the virtual machine memory is insufficient. This problem was solved by creating a swap partition, and the compilation was successful.The following summarizes the creation and activation of swap partitions:

  1. sudo mkdir -p /var/cache/swap/
  2. sudo dd if=/dev/zero of=/var/cache/swap/swap0 bs=64M count=64
  3. sudo chmod 0600 /var/cache/swap/swap0
  4. sudo mkswap /var/cache/swap/swap0
  5. sudo swapon /var/cache/swap/swap0
  6. sudo swapon -s

Note: The path of the swap0 file is under /var/cache/swap/. After compiling, if you don't want the swap partition, you can delete it. Command to delete swap partition:

MrMetacomCode commented 5 months ago

What is the command to delete the swap partition? Looks like that one got cut off in the message