Git Cloning Problems

I am trying to clone the OpenChemistry libraries to work on Avogadro 2 stuff, and I am getting a problem when trying the command

git clone --recursive https://github.com/OpenChemistry/openchemistry.git

Most of the git clone goes okay, however I receive this error message that shuts down the whole process:

Cloning into 'C:/Users/brock/openchemistry/avogadro-i18n'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
fatal: clone of 'git@github.com:OpenChemistry/avogadro-i18n.git' into submodule path 'C:/Users/brock/openchemistry/avogadro-i18n' failed Failed to clone 'avogadro-i18n'. Retry scheduled

After some more processing, the retry also fails. I am not quite sure how to move on with this, and any of my searching has lead to basically no real answers. Any tips?

The key problem is here:

Host key verification failed

The submodules use SSH for Git, which means it’s very picky about fingerprints for servers.

For example, see: ssh - Git error: "Host Key Verification Failed" when connecting to remote repository - Stack Overflow

I’ll have to see if there’s some way to do submodules that “know” whether you clone from https or ssh.

Funny enough just a few minutes I fixed the problem. The issue is that running git in command prompt doesn’t pop up any option to allow GitHub.com to be a known host, to fix that I used git-bash and then that sort of asked me if I would allow it to be trusted. I think that perhaps in the git page you can change any of the links that are git@github.com/* to https://github.com/* and that should fix things. I am not sure if that is correct at all since I am not a developer, but the only modules that had that problem were ones that weren’t directed to the https:// form. Thanks for the reply!

I don’t think this is going very well…

Could you share more details about the issues you’re currently experiencing? Were you able to successfully clone all the submodules? If so, what exactly is the image displaying? And when you are getting these errors?

I was able to clone all the modules, however when I try to use cmake I had encountered a lot of errors. I fixed all of that by getting my Qt install path set correctly, however now I tried to run cmake --build . --config Release and that threw out a lot of warnings and errors. I am not at all sure where I went wrong, or what to do next. I have been trying to follow the openchemistry build wiki page, but that is a bit old (last updated in 2018) and doesn’t have nearly enough information for me to continue.

Can you please let us know the error messages?

If you’re using Visual C++ it throws a lot of warnings (e.g., converting between float and double gets a warning) but obviously errors are a roadblock. It helps to know the exact errors.

(I found one yesterday in gcc-14 when updating an Ubuntu system.)

The errors were I think for the wrong reasons. I don’t think when I ran it in Visual Studio I did certain things correctly. When I run cmake --build . --config Release in my command line there are different errors I think. I am not even sure what to make of all of them since it spits out so much text that I can’t even really parse through all of it. I am going to rerun that and pipe the output to a text file which I should hopefully be able to upload here. In the meantime, I will provide the output from running the previous cmake command in the openchemistry cloned repositories.

C:\Users\brock\Desktop\build>cmake ../openchemistry -DQt6_DIR=~/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6 -DCMAKE_TOOLCHAIN_FILE=C:\Qt\6.7.2\msvc2019_64\lib\cmake\Qt6\qt.toolchain.cmake

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The CXX compiler identification is MSVC 19.40.33813.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Configuring done (4.6s)
-- Generating done (0.2s)
-- Build files have been written to: C:/Users/brock/Desktop/build

I reran cmake --build . --config Release, and searched through the output for error in any form. There were several instances, some were just file names that had error in them, some seemed to be syntax errors from cmake, which complained about how the Qt directory path was specified (damn single backslashes). That sort of error looked like this:

CMake Warning (dev) at C:/Users/brock/Desktop/build/thirdparty/eigen-prefix/tmp/eigen-cache-Release.cmake:6 (set):
  Syntax error in cmake code at

    C:/Users/brock/Desktop/build/thirdparty/eigen-prefix/tmp/eigen-cache-Release.cmake:6

  when parsing string

    C:\Qt\6.7.2\msvc2019_64\lib\cmake\Qt6

  Invalid escape sequence \Q

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

There were errors like that one in the following files:

  1. /build/thirdparty/eigen-prefix/tmp/eigen-cache-Release.cmake:6
  2. /build/thirdparty/libmsym-prefix/tmp/libmsym-cache-Release.cmake:6
  3. /build/thirdparty/mmtfcpp-prefix/tmp/mmtfcpp-cache-Release.cmake:6
  4. /build/avogadrolibs-prefix/tmp/avogadrolibs-cache-Release.cmake:6
  5. /build/avogadroapp-prefix/tmp/avogadroapp-cache-Release.cmake:7
  6. /build/thirdparty/libxml2_config.cmake:2
  7. /build/thirdparty/openbabel-prefix/tmp/openbabel-cache-Release.cmake:6

There were two other errors that I can tell, one was a CMake error that had trouble referencing Qt:

CMake Error at C:/Users/brock/Desktop/build/prefix/lib/cmake/avogadrolibs/AvogadroLibsTargets.cmake:226 (set_target_properties):
   The link interface of target "Avogadro::QtOpenGL" contains:
      Qt::OpenGLWidgets

   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.

Call Stack (most recent call first):
   C:/Users/brock/Desktop/build/prefix/lib/cmake/avogadrolibs/AvogadroLibsConfig.cmake:23 (include)
   avogadro/CMakeLists.txt:3 (find_package)

This error was followed by this line, which may be relevant (I have no clue, I am not familiar with any of this)

CMake Generate step failed.  Build files cannot be regenerated correctly.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-mkdir.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-download.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-update.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-patch.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-configure.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-build.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-install.rule;C:\Users\brock\Desktop\build\CMakeFiles\b61f6b94023f6c3299b669dd584c6964\avogadroapp-complete.rule;C:\Users\brock\Desktop\build\CMakeFiles\fc3f1b373d8ff2908aa78a02853be6f7\avogadroapp.rule;C:\Users\brock\Desktop\openchemistry\CMakeLists.txt' exited with code 1. [C:\Users\brock\Desktop\build\avogadroapp.vcxproj]

Last error finally. This one seemed to be CMake not being able to find a Perl executable, which seems wild but c’est la vie.

CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find Perl (missing: PERL_EXECUTABLE)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.30/Modules/FindPerl.cmake:89 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
data/CMakeLists.txt:81 (find_package)

-- Configuring incomplete, errors occurred!
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-mkdir.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-download.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-update.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-patch.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-configure.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-build.rule;C:\Users\brock\Desktop\build\CMakeFiles\09b1905917f4216fcba0f30503205626\openbabel-install.rule;C:\Users\brock\Desktop\build\CMakeFiles\dd4efee7a2c1252d693a71a63f997c48\openbabel-complete.rule;C:\Users\brock\Desktop\build\CMakeFiles\e0100fc2f499a56b8975690945508d5b\openbabel.rule;C:\Users\brock\Desktop\openchemistry\thirdparty\CMakeLists.txt' exited with code 1. [C:\Users\brock\Desktop\build\thirdparty\openbabel.vcxproj]

I am also going to attach the output.txt file here in case you’d like to read through the whole thing. I have to say with the sheer magnitude of errors here I am feeling very much out of my depth, so if your advice ends up being “Go take a CS course” I would definitely understand that!

output.txt (2.5 MB)

If you can upload the text file here or Pastebin, it would be very helpful.

One word of advice - at the moment, updating to Qt6 isn’t finished (because it changed a few things).

Did the text file I put in the last reply not upload? The link seems to be there for me?

Also, do you suggest that I just downgrade to Qt5 and see if that fixes anything?

Looks like part of the problem is that you set your Qt6 path as:

C:\Qt\6.7.2\msvc2019_64\lib\cmake\Qt6

But cmake doesn’t like that… it’s considering \Q as some sort of escape sequence.

Try setting your Qt path as:

C:/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6

We have GitHub set to build both Qt5 and Qt6 … it’s just that a variety of features haven’t been updated to Qt6 yet. (In particular, they changed how regular expressions are handled and I haven’t had the time to fix them all yet.)

I manually changed the files that had the backslashes since cmake seemed intent to write only backslashes there (I think that is a quirk of me being on Windows). Those errors have disappeared, however I have new errors now!

The first error is the same as this one from above:

CMake Error at C:/Users/brock/Desktop/build/prefix/lib/cmake/avogadrolibs/AvogadroLibsTargets.cmake:226 (set_target_properties):
    The link interface of target "Avogadro::QtOpenGL" contains:
        Qt::OpenGLWidgets

    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.

Call Stack (most recent call first):
    C:/Users/brock/Desktop/build/prefix/lib/cmake/avogadrolibs/AvogadroLibsConfig.cmake:23 (include)
    avogadro/CMakeLists.txt:3 (find_package)

-- Generating done (0.2s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-mkdir.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-download.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-update.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-patch.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-configure.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-build.rule;C:\Users\brock\Desktop\build\CMakeFiles\04876b10da493335b99605622b267563\avogadroapp-install.rule;C:\Users\brock\Desktop\build\CMakeFiles\b61f6b94023f6c3299b669dd584c6964\avogadroapp-complete.rule;C:\Users\brock\Desktop\build\CMakeFiles\fc3f1b373d8ff2908aa78a02853be6f7\avogadroapp.rule;C:\Users\brock\Desktop\openchemistry\CMakeLists.txt' exited with code 1. [C:\Users\brock\Desktop\build\avogadroapp.vcxproj]

The next error is one I don’t recall seeing before. It seems to be that somewhere there is a command that is trying to create a file and for some unknown reason the command switches from forward slashes to back slashes.

NMAKE : fatal error U1077: 'if not exist C:/Users/brock/Desktop/build/prefix\include\libxml2 mkdir C:/Users/brock/Desktop/build/prefix\include\libxml2' : return code '0x1' [C:\Users\brock\Desktop\build\thirdparty\libxml2.vcxproj]
Stop.
Completed 'libxml2'
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-mkdir.rule;C\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-download.rule;C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-update.rule;C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-patch.rule;C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-configure.rule;C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-build.rule;C:\Users\brock\Desktop\build\CMakeFiles\76b8ef12fe52f2d1f770894aaddb585a\libxml2-install.rule;C:\Users\brock\Desktop\build\CMakeFiles\dd4efee7a2c1252d693a71a63f997c48\libxml2-complete.rule;C:\Users\brock\Desktop\build\CMakeFiles\e0100fc2f499a56b8975690945508d5b\libxml2.rule;C:\Users\brock\Desktop\openchemistry\thirdparty\CMakeLists.txt' exited with code -1. [C:\Users\brock\Desktop\build\thirdparty\libxml2.vcxproj]

I finally got avogadro 2 to compile and build successfully! I honestly have no clue what I did that finally got it to go, but one of the things I changed in my most recent attempt was turning off molequeue building. Not sure if that was the fix, but I can load up the app now! The only problem remaining is that when I run the build that I made myself it seems to run very slowly, like instead of a forcefield optimizing in less than a second it is super stuttery and takes while. I am not sure how important that is to my development attempts but I am sure that it’ll be fine!

1 Like

Check to see if you have set the cmake build to Debug instead of RelWithDeb (i.e., release with debugging symbols) or Release.

If it’s set to Debug, it will usually be very slow.

I ran cmake --build . --config Release so I believe it is a “release” version. Not sure if there is some other setting to change or not, or perhaps I am just building things incorrectly

For running in relese mode you have to update CMakeLists.txt file and then you should try to build the project. For eg. The following change in CMakeLists.txt

if(CMAKE_BUILD_TYPE)
  list(APPEND OpenChemistry_DEFAULT_ARGS
    "-DCMAKE_BUILD_TYPE:STRING=Release") // set default to release
endif()

This modifications in the codebase help you to run your project in release mode.

When you are writing cmake --build . --config Release it’s the cmake task to run it on relese mode but it’s not working due to some reasons. So you can try modifying the codebase.

Sorry for the long response time, got busy.

I tried the method you suggested, and it still runs slow. I used the same command as before, cmake --build . --config Release, and I was wondering if perhaps when I build with the Release setting in CMakeLists.txt I should omit the --config Release part of the build command?