OpenChemistry / avogadroapp

Avogadro is an advanced molecular editor designed for cross-platform use in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
https://two.avogadro.cc/
BSD 3-Clause "New" or "Revised" License
184 stars 69 forks source link

Trouble with Cross-compiling: Library Issues #484

Open ylxclimax opened 6 months ago

ylxclimax commented 6 months ago

I encountered some issues while compiling the source code. When I downloaded the source code and compiled it in a Linux environment, I was able to generate an executable file that runs on Linux. Then, I tried to use cross-compilation to generate an executable file that can run on Windows. However, I encountered library issues during the cross-compilation process. I have already installed the Qt5 library on Linux and there were no errors during the Linux compilation. But when I cross-compile, it seems to be trying to find components related to Windows in the Qt library (I’m not entirely sure, but if that’s not the case, I can’t explain why the same library doesn’t cause errors when compiled on Linux but does when cross-compiled). Now, please tell me how to proceed.

welcome[bot] commented 6 months ago

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

ghutchis commented 6 months ago

We've never attempted Linux to Windows cross-compilation. I suspect you need to cross-compile the Qt libraries before you can proceed.

If you post actual error messages, we might be able to help, but I'm not going to invest much time into support for cross-compile - you can use GitHub actions, for example to build the Windows version on Windows with Visual Studio.

ylxclimax commented 6 months ago

I have encountered various issues compiling the Avogadro project on Windows with CMake GUI and Visual Studio, such as failure to compile certain packages like spglib, libarchive, and libmsym. After addressing these issues, I have successfully deployed and enhanced Avogadro on Linux, but now I need to compile it into an executable for Windows. My attempts at cross-compiling have failed. The primary issue encountered is library-related compilation errors on Windows, notably messages like "LIBARCHIVE_INCLUDE_DIR NOT FOUND," even after correctly installing and setting up the library's location. I am inquiring if it's feasible to transfer my Windows environment over to me using Docker to assist in resolving this matter.

ghutchis commented 6 months ago

We have detailed instructions on compiling (including for Windows) on the website: https://two.avogadro.cc/install/build.html

If you are having problems with libarchive, I suspect you have not started from the openchemistry repository.