zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.53k stars 2.34k forks source link

Link to openpgm when building with cmake #4546

Closed cdepillabout closed 1 year ago

cdepillabout commented 1 year ago

I was noticing a problem where libzmq fails to link to openpgm when building with CMake.

This PR fixes the problem by making sure to link to openpgm when passing the -DWITH_OPENPGM=1 to cmake.

cdepillabout commented 1 year ago

Without this PR, I was seeing errors like the following:

...
[ 55%] Linking CXX executable bin/inproc_lat
/nix/store/fhzz4yrdy17czwc9i4swhlpcp445inzb-binutils-2.40/bin/ld: lib/libzmq.so.5.2.4: undefined reference to `pgm_error_free'
/nix/store/fhzz4yrdy17czwc9i4swhlpcp445inzb-binutils-2.40/bin/ld: lib/libzmq.so.5.2.4: undefined reference to `pgm_send'
/nix/store/fhzz4yrdy17czwc9i4swhlpcp445inzb-binutils-2.40/bin/ld: lib/libzmq.so.5.2.4: undefined reference to `pgm_shutdown'
/nix/store/fhzz4yrdy17czwc9i4swhlpcp445inzb-binutils-2.40/bin/ld: lib/libzmq.so.5.2.4: undefined reference to `pgm_bind3'
/nix/store/fhzz4yrdy17czwc9i4swhlpcp445inzb-binutils-2.40/bin/ld: lib/libzmq.so.5.2.4: undefined reference to 
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/local_lat.dir/build.make:99: bin/local_lat] Error 1
make[1]: *** [CMakeFiles/Makefile2:445: CMakeFiles/local_lat.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...

From the error messages, you can tell I'm building with Nix on Linux, but I expect that this error affects other distros as well.

cdepillabout commented 1 year ago

It looks like the CI job "OBS: libzmq - openSUSE_Leap_15/x86_64" is failing, but the failure doesn't look related to this PR?

https://build.opensuse.org/package/live_build_log/network:messaging:zeromq:ci:zeromq:libzmq:PR-4546/libzmq/openSUSE_Leap_15/x86_64