Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake can't find HPXCacheVariables.cmake #5774

Closed
karlfroldan opened this issue Feb 9, 2022 · 6 comments
Closed

CMake can't find HPXCacheVariables.cmake #5774

karlfroldan opened this issue Feb 9, 2022 · 6 comments

Comments

@karlfroldan
Copy link

Expected Behavior

CMake should be able to find HPXCacheVariables.cmake as listed in HPXConfig.cmake.

Actual Behavior

Error during generating Makefile with cmake with the following message:

Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE=/home/karl/.local/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/bin/clang-12 -DCMAKE_CXX_COMPILER:FILEPATH=/bin/clang++-12 -H/home/karl/dev/cpp/hpx -B/home/karl/dev/cpp/hpx/build -G "Unix Makefiles"
CMake Error at /home/karl/.local/vcpkg/installed/x64-linux/share/hpx/HPXConfig.cmake:13 (include):
  include could not find requested file:
 
     /home/karl/.local/vcpkg/installed/x64-linux/share/hpx/HPXCacheVariables.cmake
 Call Stack (most recent call first):
   /home/karl/.local/vcpkg/scripts/buildsystems/vcpkg.cmake:793 (_find_package)
   CMakeLists.txt:10 (find_package)
 
 
 Not searching for unused variables given on the command line.
 -- Using  allocator.
 -- Configuring incomplete, errors occurred!
 See also "/home/karl/dev/cpp/hpx/build/CMakeFiles/CMakeOutput.log".
 CMake Error at /home/karl/.local/vcpkg/installed/x64-linux/share/hpx/HPX_SetupAllocator.cmake:150 (if):
   if given arguments:
 
     "STREQUAL" "jemalloc"
 
   Unknown arguments specified
 Call Stack (most recent call first):
   /home/karl/.local/vcpkg/installed/x64-linux/share/hpx/HPXConfig.cmake:83 (include)
   /home/karl/.local/vcpkg/scripts/buildsystems/vcpkg.cmake:793 (_find_package)
   CMakeLists.txt:10 (find_package)

Furthermore, HPXCacheVariables.cmake is not located in /path/to/vcpkg/installed/x64-linux/share/hpx which I believe is the root of the problem.

Steps to Reproduce the Problem

Installed HPX Using VCPKG and created a blank C++ project with a blank Main.cpp and a CMakeLists.txt containing

cmake_minimum_required(VERSION 3.17.0)

project(HPXTUT)

find_package(HPX CONFIG REQUIRED)

Run with cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/toolchain ..

Specifications

... Please describe your environment

  • HPX Version: 1.7.1 (vcpkg version as of February 10, 2022)
  • Platform (compiler, OS): clang++-12, Ubuntu 20.04 (WSL)
  • Cmake version: 3.21.0
@hkaiser
Copy link
Member

hkaiser commented Feb 9, 2022

@karlfroldan thanks for reporting! We'll have a look as quickly as possible.

@gonidelis
Copy link
Contributor

@karlfroldan Thanks for the notice! Seems like a bug and we will take actions to fix it ASAP. For the moment could you please try deleting #L96 from this file: <path_to_vcpkg>/vcpkg/ports/hpx/portfile.cmake ?

The line is: file(REMOVE "${CURRENT_PACKAGES_DIR}/share/hpx/HPXCacheVariables.cmake").

You will need to remove HPX and reinstall it with vcpkg after that. Please tell us how it went.

@karlfroldan
Copy link
Author

@gonidelis Hi, this resolved the issue and CMake generated the Makefile correctly. Thank you!

@hkaiser
Copy link
Member

hkaiser commented Feb 11, 2022

@gonidelis Hi, this resolved the issue and CMake generated the Makefile correctly. Thank you!

FWIW, we're working on getting this resolved here: microsoft/vcpkg#23042

@autoantwort
Copy link
Contributor

The file was removed because it contained absolute paths and absolute paths are forbidden because ports must be relocatable because of binary caching. The following absolute paths are in the file:

set(HPX_BINARY_DIR C:/Users/LeanderSchulten/git_projects/vcpkg/buildtrees/hpx/x64-windows-rel)
set(HPX_SOURCE_DIR C:/Users/LeanderSchulten/git_projects/vcpkg/buildtrees/hpx/src/1.7.1-1f0e7f19f4.clean)

@hkaiser
Copy link
Member

hkaiser commented Mar 11, 2022

This issue has been resolved. The fix will be merged to the vcpkg repository (see microsoft/vcpkg#23042).

@hkaiser hkaiser closed this as completed Mar 11, 2022
@hkaiser hkaiser added this to the 1.8.0 milestone Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants