Compiling a Debug build on Windows fails to create Avogadro executable

I’m finally free of finals, so I am trying to get deeper into Avogadro 2 development, which led me to an interesting discovery. It seems that when I go to compile and build Av2 from source using the following commands

cmake -DBUILD_MOLEQUEUE=OFF ../openchemistry -DQt5_DIR=~/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5 -DCMAKE_TOOLCHAIN_FILE=C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5/Qt5Config.cmake
cmake --build . --config Debug

that Av2 doesn’t actually get built. Below is all of the files that get created from running these commands in a fresh directory, with no pre-existing build data in the folder.

I’ve also included a file with stdout and stderr from running the build command. (as a tar file since I’m about 100 kB over the file size limit)

output.tar.gz (187.3 KB)

Interestingly enough, when I remove -DBUILD_MOLEQUEUE=OFF from the first line, it will build molequeue, but not Av2. Also, running with --config Release builds both molequeue and Av2 perfectly fine.

Looks like there’s an issue with zlib, but it’s a little hard to tell - are you doing a parallel build?

Error copying file "C:/Users/Brock/Desktop/avogadro_debug/prefix/lib/zlib.lib" to "C:/Users/Brock/Desktop/avogadro_debug/prefix/lib/zlib1.lib".

I was doing a parallel build, however I just checked and the same thing happens with a serial build.

1 Like

I got it to successfully build with --config RelWithDebInfo, and it did build Av2 successfully, however there were no PDB files associated with it that I could use for debug purposes. Not sure what that means, but hopefully that provides some more info.

1 Like

It seems like there’s something weird with the compile / copy and zlib. Out of curiosity, did that file exist? C:/Users/Brock/Desktop/avogadro_debug/prefix/lib/zlib.lib - I wonder if it had an error because zlib didn’t compile under debugging. On Mac and Linux, we use the system libz so that particular part of the build doesn’t get tested.

BTW, I would love to get parallel builds working on Windows (e.g., Ninja?) because the GitHub builds on Windows take ~90 minutes each.

At that location I see only a few files:

I would also love to get a parallel build working. Granted, my builds don’t take too long since my CPU runs pretty fast, but using 12 cores instead of 1 would be awesome.

Well, that explains it - zlib didn’t build under the Debug configuration. We’ll have to see what can fix that – or if we should switch to GitHub - zlib-ng/zlib-ng: zlib replacement with optimizations for "next generation" systems. - evidently that has support from Microsoft engineers too:

./vcpkg install zlib-ng

I know zlib-ng has a compatibility layer, but don’t know much more yet. Something for next week.

Good to know that the bug (hopefully not plural) has been located! I am excited to hear what you have planned for getting a debug version to successfully compile on windows. Until then I’m going to try and work on getting a Release build with Qt 6 since I know things are moving rapidly in that direction.

1 Like