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

Support for vcpkg on Linux is broken #6087

Closed
hcw70 opened this issue Nov 25, 2022 · 16 comments
Closed

Support for vcpkg on Linux is broken #6087

hcw70 opened this issue Nov 25, 2022 · 16 comments

Comments

@hcw70
Copy link

hcw70 commented Nov 25, 2022

Expected Behavior

I was trying to get started under ubuntu 22.04 with the intro tutorial from:
https://hpx-docs.stellar-group.org/latest/html/quickstart.html

Actual Behavior

I get linker errors:


/usr/bin/ld: /home/hcw/git/vcpkg/installed/x64-linux/debug/lib/libhpx_agas_based.a(primary_namespace.cpp.o): in function `hpx::agas::primary_namespace::route(hpx::parcelset::parcel&&, hpx::function<void (std::error_code const&, hpx::parcelset::parcel const&), false>&&)':
/home/hcw/git/vcpkg/buildtrees/hpx/src/68cfb0bd56-aa215f878e.clean/libs/full/agas_base/src/primary_namespace.cpp:221: undefined reference to `hpx::agas::server::primary_namespace::route(hpx::parcelset::parcel&&)'
/usr/bin/ld: /home/hcw/git/vcpkg/installed/x64-linux/debug/lib/libhpx_agas_based.a(primary_namespace.cpp.o): in function `void hpx::actions::action<void (hpx::agas::server::primary_namespace::*)(hpx::parcelset::parcel&&), &hpx::agas::server::primary_namespace::route, hpx::agas::server::primary_namespace::route_action>::invoke<hpx::parcelset::parcel>(void*, int, hpx::parcelset::parcel&&)':
/home/hcw/git/vcpkg/buildtrees/hpx/src/68cfb0bd56-aa215f878e.clean/libs/full/actions_base/include/hpx/actions_base/component_action.hpp:103: undefined reference to `hpx::agas::server::primary_namespace::route(hpx::parcelset::parcel&&)'
/usr/bin/ld: /home/hcw/git/vcpkg/installed/x64-linux/debug/lib/libhpx_parcelsetd.a(parcelhandler.cpp.o): in function `hpx::parcelset::init_static_parcelport_factories(std::vector<hpx::plugins::parcelport_factory_base*, std::allocator<hpx::plugins::parcelport_factory_base*> >&)':
/home/hcw/git/vcpkg/buildtrees/hpx/x64-linux-dbg/libs/full/parcelset/include/hpx/parcelset/static_parcelports.hpp:25: undefined reference to `parcelport_tcp_factory_init(std::vector<hpx::plugins::parcelport_factory_base*, std::allocator<hpx::plugins::parcelport_factory_base*> >&)'
collect2: error: ld returned 1 exit status

looking for hpx::agas::server::primary_namespace::route(hpx::parcelset::parcel&&) (from hpx::agas::primary_namespace::route(hpx::parcelset::parcel&&, hpx::function<void (std::error_code const&, hpx::parcelset::parcel const&), false>&&)

Steps to Reproduce the Problem

Specifications

  • Compiler: gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
  • OS: Ubuntu 22.04

Setup via

vcpkg install hpx[core,cuda]

and cmake file:


cmake_minimum_required(VERSION 3.18)
project(my_hpx_project LANGUAGES CUDA CXX)

set(OpenCV_DIR "/home/hcw/git/vcpkg/installed/x64-linux/share/opencv4")
find_package(OpenCV REQUIRED)

set(HPX_DIR "/home/hcw/git/vcpkg/installed/x64-linux/share/hpx")
find_package(HPX REQUIRED)


add_executable(my_hpx_program main.cpp)

target_link_libraries(my_hpx_program HPX::hpx HPX::wrap_main HPX::iostreams_component)



@hkaiser
Copy link
Member

hkaiser commented Nov 25, 2022

Frankly, I have never tried using vcpkg on Linux. I will try to reproduce your issue.

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

With vcpkg btw i get 1.8.1, trying now with 1.7.1 of HPX....

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

Ok, with HPX 1.7.1 it works.

It is a pain in the A... to downgrade / select specific lib versions with vcpkg, i used
vcpkg.json:

{
    "name": "fastfocusstacker-hpx",
    "version": "1.0.0",
    "dependencies": [
        {
            "name": "hpx",
            "version>=": "1.7.1"
        },
        {
            "name": "opencv",
            "version>=": "4.6.0",
            "features": [ "cuda" ]
        }
    ],
    "overrides": [{"name":"hpx", "version-semver":"1.7.1"}],
    "builtin-baseline": "62d01b70df227850b728f5050418b917ad6d2b32"
}

Also -DHPX_IGNORE_BOOST_COMPATIBILITY=On is needed with this.
.
Looks however, that cuda seems not to be supported with 1.7.1, but at least i can start learning now.....

@hkaiser
Copy link
Member

hkaiser commented Nov 25, 2022

Have you tried installing HPX as: vcpkg install hpx[cuda] (no core option)? That should be equivalent to what's happing for V1.7.1.

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

At least it compiled / linked with that version. However starting fails with an error:

$ ./my_hpx_program 
terminate called after throwing an instance of 'hpx::detail::exception_with_info<hpx::exception>'
  what():  failed to insert update_agas_cache_action into typename to id registry.: HPX(invalid_status)

So again pointing to agas stuff.... Maybe i am missing some (not documented) setup stuff regarding agas and HPX (and maybe related to CUDA / Linux)?

@hkaiser
Copy link
Member

hkaiser commented Nov 25, 2022

That is a different error that suggests that you now have more than one version of HPX as binaries that are being found/loaded.

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

Have you tried installing HPX as: vcpkg install hpx[cuda] (no core option)? That should be equivalent to what's happing for V1.7.1.

Tried that first. Fails with the same above linker error (it using 1.8.1 version then)

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

That is a different error that suggests that you now have more than one version of HPX as binaries that are being found/loaded.

I threw away my build folder and also the vcpkg folder (where i hope all stuff lives which was built) but the problem reappears....

@hcw70
Copy link
Author

hcw70 commented Nov 25, 2022

Ok, found about ~/.cache/vcpkg/archives, so try again...

@hcw70
Copy link
Author

hcw70 commented Nov 26, 2022

Even with cleaned caches, using v1.7.1 throws exception for me.
So i think i need to investigate other setups.

@hkaiser
Copy link
Member

hkaiser commented Nov 26, 2022

vcpkg copies the binaries to the folder where the application is built. Have you cleaned out those as well?

@hcw70
Copy link
Author

hcw70 commented Nov 26, 2022

I had no luck still with any vcpkg build.

Now did a direct clone, cmake / ninja build, added the search path to my project and now i finally got a "hello world" which does not throw....

@hkaiser hkaiser changed the title Basic setup fails to find AGAS Support for vcpkg on Linux is broken Nov 26, 2022
@hkaiser
Copy link
Member

hkaiser commented Nov 26, 2022

I had no luck still with any vcpkg build.

Now did a direct clone, cmake / ninja build, added the search path to my project and now i finally got a "hello world" which does not throw....

Thanks for investigating. So, it looks like the vcpkg support on Linux is broken :/ I'll leave this ticket open as a reminder for us.

@matrixbot123
Copy link

The same issue also occurred with me. And I used spack to install it worked fine

@hkaiser
Copy link
Member

hkaiser commented Mar 27, 2023

From our conversation on IRC, it seems that vcpkg on Linux builds static libraries (one library per HPX module) and links the application against those.

@hkaiser hkaiser modified the milestones: 1.9.0, 1.10.0 Apr 20, 2023
@hkaiser
Copy link
Member

hkaiser commented Aug 21, 2023

I believe, this was fixed by #6320. Closing this ticket... Please reopen if needed.

@hkaiser hkaiser closed this as completed Aug 21, 2023
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

3 participants