spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

How to build #578

Closed code-whale closed 3 years ago

code-whale commented 3 years ago

Hello, I want to learn how to use spirit, but I don't know how to build this software. I hope to simulate directly in GUI. I try to build software in OSX according to your tutorial, but the following error occurred. Can you help me?

截屏2020-11-04 上午11 42 49
MSallermann commented 3 years ago

Hi,

it looks like you either have no installation of cmake or it is not in your shell path. If you fix that, the error should disappear. You can download cmake binaries here https://cmake.org/download/ or install it via homebrew.

Best, Moritz

code-whale commented 3 years ago

@MSallermann ,Thank you for your reply! I successfully installed cmake using brew Install cmake, but when I continued the build, the error as shown in the figure below occurred. Is this because I did not have read permissions and did not install QT5? Please tell me how to solve this error. Thanks again for your help! image

MSallermann commented 3 years ago

The first issue seems to be connected to write permissions. I have not seen this before, make sure you have write and read permissions for these files (or try to run cmake as sudo).

The second error is due to cmake not finding QT. If you want to use the GUI, you need to install QT first. And if the error persists, you can uncomment this line in the CMakeLists file# set( USER_PATH_QT "~/QT/5.7" ) and edit the path so that it points to your QT install location. If you want to just test the rest of the compilation you can run cmake with the additonal argument -DSPIRIT_UI_CXX_USE_QT=OFF. This will compile spirit without the GUI and does not not require QT.

code-whale commented 3 years ago

@MSallermann ,I would like to ask you how to install Qt. I am now downloading from https://www.qt.io/download. Is that right? image

code-whale commented 3 years ago

@MSallermann ,I am very sorry to bother you. After I tried to install QT5, I reported an error as shown in the figure below. I have little knowledge of building code, I don't know what caused the error, I really hope to use GUI for simulation image

MSallermann commented 3 years ago

Hmm seems like you are missing libicui. You could try to install it with brew install icu4c.

code-whale commented 3 years ago

@MSallermann ,I ran brew install icu4c, but the same error occurred in the last problem. I would like to ask how you installed Qt. I think my Qt installation is wrong, thank you for your patient help!

code-whale commented 3 years ago

@MSallermann ,I seem to have successfully compiled Spirit after changing path again, as shown in the figure below. Is this successful? (I'm not sure), I would like to ask you how to launch the GUI interface? No ICONS are generated after compilation... image

code-whale commented 3 years ago

Sorry for my own negligence, I saw that the Spirit executable has been generated! I will start learning Spirit! Thank you for your patient help!

MSallermann commented 3 years ago

Nice that it works for you now!