Compilation error - fatal error: gemmi/cif.hpp: No such file or directory
Hello, I am trying to compile Rosetta in an HPC cluster, but I get the following error:
$ git clone https://github.com/RosettaCommons/rosetta
$ cd rosetta/source
$ ./scons.py -j20 mode=release bin
.
.
.
src/core/import_pose/import_pose.cc:88:10: fatal error: gemmi/cif.hpp: No such file or directory
88 | #include <gemmi/cif.hpp>
| ^~~~~~~~~~~~~~~
compilation terminated.
scons: *** [build/src/release/linux/5.14/64/x86/gcc/11/default/core/import_pose/import_pose.os] Error 1
scons: building terminated because of errors.
I am using GCC 11.5.0 20240719 (Red Hat 11.5.0-5).
Any help will be appreciated.
Due to its size, Rosetta uses submodules for various things, most importantly dependencies. Gemmi is one of those. By default, Git does not pull down submodules when cloning a repository, and a separate command must be used. For convenience, this command should be included in the Rosetta Scons build process. My initial guess is that something happened with that command, and that's why you're having issues. -- However, looking at the log I do see the "Updating submodules needed for compilation." line, but no error lines.
From the rosetta/source directory, what do you get when you run ls -l external/include/gemmi (no trailing slash)? If working properly, you should get something which ends with external/include/gemmi -> ../gemmi_repo/include/gemmi/. Then if you do a ls external/gemmi_repo/include/gemmi, you should get a number of files listed as an output, which should include the cif.hpp file (and no error message).
At any rate, you should also be able to run ./update_submodules.sh in the rosetta/source directory. Hopefully that should fix things. If not, you can try running git submodule update --init in the base rosetta/ directory and see if that changes things.
If the submodule update commands don't change things, and the source/external/include/gemmi is a proper symlink, and the source/external/gemmi_repo/include/gemmi/ directory contains cif.hpp, there's something else quite strange going on. More details about your operating system, file system and compiler will likely be needed -- particularly if there's anything special about how it's treating symlinks.
I had the same problem just now. You need to have an SSH key in your GitHub account for gemmi to be downloaded. It is required for authentication, otherwise you will not have permissions to download it. Once I did that, it was fixed:
ls external/gemmi_repo/include/gemmi/cif.hpp
external/gemmi_repo/include/gemmi/cif.hpp
Thanks for the clarification @cesarramirez -- PR #500 should fix this in the future.
For existing clones, I think you can do a git submodule set-url -- source/external/gemmi_repo https://github.com/project-gemmi/gemmi.git (assuming you've already tried to update the submodule and failed) to do what the PR changes.