The problem when I install HighFive by cmake #1047
-
|
I follow the steps of "Regular Installation of [HighFive]" on https://bluebrain.github.io/HighFive/ to install HighFive by cmake. I type in the following command: I am in the file "build" under the file "HighFive-src". Could anyone can tell me the reason, please? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
The commands doesn't look wrong; and fortunately, I can't reproduce the issue using the latest version of HighFive and some reasonably modern version of CMake. CMake has a tendency to create certain files/directories that then prevent correct runs later on. Check First we should make sure that it's a clean copy of HighFive. For example run the following in your home directory: Now the exact command you posted, should work, i.e. (I've remove the flag related to Hopefully, using a clean directory fixes the issue, if not, we need to understand why the "installed" copy is involved during configure time: Note that the file it's complaining about is no located in your source or build directory. It's located in the install directory. You could start by checking: |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your reply! And Sorry I forget to mention one thing, that is only when I add the following sentences in the CMakeLists.txt, the problem will occur: If I don't add them, there is no problem. |
Beta Was this translation helpful? Give feedback.
-
|
I think I'll close, because I suspect it's too specific to be useful to others. |
Beta Was this translation helpful? Give feedback.
Are you editing
HighFives CMakeLists.txt? If no, ignore everything that follows.If yes, I could see how that would result in the error you're describing. The problem is that inside
HighFive/CMakeLists.txtwe create the targetsHighFive::HighFiveandHighFive::Include. Thefind_package(HighFive REQUIRED)instructs CMake to go look forHighFive, it finds one in the install directory. It then asks the installed version to create the targets, which already exist. Therefore, it fails.There's two options:
You're developing HighFive. In that case just leave out the
find_package(HighFive REQUIRED).You're developing an independent application, but are reusing the HighFive's CMake for some r…