PDB-REDO / alphafill

AlphaFill is an algorithm based on sequence and structure similarity that “transplants” missing compounds to the AlphaFold models. By adding the molecular context to the protein structures, the models can be more easily appreciated in terms of function and structure integrity.
https://alphafill.eu
BSD 2-Clause "Simplified" License
89 stars 16 forks source link

Cannot link libraries to target (alphafill executable) #36

Closed sadiogo closed 12 months ago

sadiogo commented 12 months ago
          I have installed libcifpp 5.1.2 and still get this error when trying to install alphafill/2.0.0
CMake Error at /home/sadiogo/libzeep/build/zeep/zeepConfig.cmake:32 (include):
  include could not find requested file:

    /home/sadiogo/libzeep/build/zeep/zeepTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)

CMake Error at /home/sadiogo/libcifpp/build/cifpp/cifppConfig.cmake:27 (include):
  include could not find requested file:

    /home/sadiogo/libcifpp/build/cifpp/cifppTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:105 (find_package)

CMake Error at /home/sadiogo/libcifpp/build/cifpp/cifppConfig.cmake:11 (message):
  File or directory /home/sadiogo/share/libcifpp referenced by variable
  CIFPP_SHARE_DIR does not exist !
Call Stack (most recent call first):
  /home/sadiogo/libcifpp/build/cifpp/cifppConfig.cmake:32 (set_and_check)
  CMakeLists.txt:105 (find_package)

I managed to overcome the error by creating the share and libcifpp folders. Now I am getting the following error:

CMake Error at /home/sadiogo/libzeep/build/zeep/zeepConfig.cmake:32 (include):
  include could not find requested file:

    /home/sadiogo/libzeep/build/zeep/zeepTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)

CMake Error at /home/sadiogo/libcifpp/build/cifpp/cifppConfig.cmake:27 (include):
  include could not find requested file:

    /home/sadiogo/libcifpp/build/cifpp/cifppTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:105 (find_package)

I overcame this error by creating the cifppTargets.cmake file (left the content in blank). Now i get:

CMake Error at CMakeLists.txt:176 (target_link_libraries):
  Target "alphafill" links to:

    cifpp::cifpp

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

It should be noted that I had to add the following lines in the CMAKELists.txt files to get the build to this stage:

set(zeep_DIR "/home/sadiogo/libzeep/build/zeep")
set(date_DIR "/home/sadiogo/vcpkg/packages/date_x64-linux/share/date")
set(cifpp_DIR "/home/sadiogo/libcifpp/build/cifpp")

Any suggestions on how to proceed?

Originally posted by @sadiogo in https://github.com/PDB-REDO/alphafill/issues/35#issuecomment-1733730810

mhekkel commented 12 months ago

Did you install libzeep and libcifpp? If so, cmake should pick up the library automatically. If you only built it, well, then you are out of luck.

Setting variables is not the way to go.

You can opt to install all of these in some other location than /usr/local. E.g. I use $HOME/.local

Then, when configuring alphafill, you may have to specify where to look for these if it doesn't find the libraries itself. You can do that by using the CMAKE_PREFIX_PATH variable.

sadiogo commented 12 months ago

I am pretty sure I installed both. I looked at the history and found I installed libcifpp in $HOME/.local but can't figure out libzeep (I think I was using a secondary terminal). I didn't find it in usr/local nor $HOME/.local, so maybe I didn't install it. Where would I look in the cmake files to find the installation folder that was defined by default?

mhekkel commented 12 months ago

The default for an installation of user software in Un*x (and thus linux) is /usr/local. But if you installed libzeep there, cmake should have found it.

You can reinstall libzeep in $HOME/.local. But then you need to configure tools using it with:

cmake -S . -B build -DCMAKE_PREFIX_PATH=$HOME/.local

Which should not be needed when you install the tool itself there as well, like in:

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local
cmake --build build
cmake --install build
sadiogo commented 12 months ago

Found it! I checked the cmake_install.cmake file in the build folder and found set(CMAKE_INSTALL_PREFIX "/usr/local") for libzeep. Since I didn't find libzeep in usr/local/lib/, I can conclude I didn't install it afterall. I will fix this and retry installin alphafill.

sadiogo commented 12 months ago

I installed libzeep with cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local and then built alphafill with cmake -S . -B build --DCMAKE_PREFIX_PATH=$HOME/.local\;$HOME/vcpkg/packages/date_x64-linux/share/date to allow finding the libzeep and libcifpp libraries in $HOME/.local and the date library in the vcpkg package folder.

Alphafill is now working and the real work begins! Thank you very much for helping. You can close this issue.