You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2021/09/16 12:54:00 UTC

[jira] [Comment Edited] (PROTON-2433) The work for PROTON-2254 seems to have broken modern use of CMake

    [ https://issues.apache.org/jira/browse/PROTON-2433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17416093#comment-17416093 ] 

Jiri Daněk edited comment on PROTON-2433 at 9/16/21, 12:53 PM:
---------------------------------------------------------------

Works for me. I used CentOS 7 in Docker, [^PROTON-2433_01.zip]

{noformat}
docker build .
{noformat}

in the build output, I see successful compilation, and the proton library is correctly linked

{noformat}
Step 13/15 : RUN cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=/root/Work/qpid-install
 ---> Running in c0a56ccde72d
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /PROTON-2433
Removing intermediate container c0a56ccde72d
 ---> 5b7fb7464f9d
Step 14/15 : RUN ninja
 ---> Running in 9dba124c01ac
ninja: warning: phony target 'main.c' names itself as an input; ignoring [-w phonycycle=warn]
[1/2] Building C object CMakeFiles/amqp-value-test.dir/main.c.o
[2/2] Linking C executable amqp-value-test
Removing intermediate container 9dba124c01ac
 ---> f5510b64856d
Step 15/15 : RUN ldd amqp-value-test
 ---> Running in 30b6ddd5e6c1
        linux-vdso.so.1 =>  (0x00007ffc15dd4000)
        libqpid-proton-core.so.10 => /root/Work/qpid-install/lib64/libqpid-proton-core.so.10 (0x00007f954d16d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f954cd9f000)
        libssl.so.10 => /lib64/libssl.so.10 (0x00007f954cb2d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f954c911000)
        libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f954c6f4000)
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f954c291000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f954d3a8000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f954c044000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f954bd5b000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f954bb57000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f954b924000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f954b720000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f954b50a000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f954b2f0000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f954b0b9000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f954aea9000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f954aca5000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007f954aaa2000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f954a87b000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f954a619000)
Removing intermediate container 30b6ddd5e6c1
 ---> 2c43c7ea3cc2
Successfully built 2c43c7ea3cc2
{noformat}

{quote}
I think because this work has removed this section and hasn't replaced it with anything else that does the same thing.

{noformat}
# Add modular target in a way compatible with cmake 2.8.12
if (NOT TARGET Proton::core)
  add_library(Proton::core UNKNOWN IMPORTED)
  set_target_properties(Proton::core
    PROPERTIES
      IMPORTED_LOCATION "@LIBDIR@/@PROTONCORELIB@"
      IMPORTED_LOCATION_DEBUG "@LIBDIR@/@PROTONCORELIBDEBUG@"
      INTERFACE_INCLUDE_DIRECTORIES "${Proton_Core_INCLUDE_DIRS}")
endif()
{noformat}
{quote}

The replacement for this is

{noformat}
 186 install(EXPORT ProtonCppTargets
 187   FILE ProtonCppTargets.cmake
 188   NAMESPACE Proton::
 189   DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
 190 if (BUILD_STATIC_LIBS)
 191   install(EXPORT ProtonCppStaticTargets
 192     FILE ProtonCppTargets.cmake
 193     NAMESPACE Proton::
 194     DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
 195 endif ()
{noformat}

It generates *Targets.cmake files that define the "modern" CMake targets. That file is then included from *Config.cmake file.


was (Author: jdanek):
Works for me. I used CentOS 7 in Docker, [^PROTON-2433_01.zip]

{noformat}
docker build .
{noformat}

in the build output, I see successful compilation, and the proton library is correctly linked

{noformat}
Step 13/15 : RUN cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=/root/Work/qpid-install
 ---> Running in c0a56ccde72d
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /PROTON-2433
Removing intermediate container c0a56ccde72d
 ---> 5b7fb7464f9d
Step 14/15 : RUN ninja
 ---> Running in 9dba124c01ac
ninja: warning: phony target 'main.c' names itself as an input; ignoring [-w phonycycle=warn]
[1/2] Building C object CMakeFiles/amqp-value-test.dir/main.c.o
[2/2] Linking C executable amqp-value-test
Removing intermediate container 9dba124c01ac
 ---> f5510b64856d
Step 15/15 : RUN ldd amqp-value-test
 ---> Running in 30b6ddd5e6c1
        linux-vdso.so.1 =>  (0x00007ffc15dd4000)
        libqpid-proton-core.so.10 => /root/Work/qpid-install/lib64/libqpid-proton-core.so.10 (0x00007f954d16d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f954cd9f000)
        libssl.so.10 => /lib64/libssl.so.10 (0x00007f954cb2d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f954c911000)
        libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f954c6f4000)
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f954c291000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f954d3a8000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f954c044000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f954bd5b000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f954bb57000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f954b924000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f954b720000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f954b50a000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f954b2f0000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f954b0b9000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f954aea9000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f954aca5000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007f954aaa2000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f954a87b000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f954a619000)
Removing intermediate container 30b6ddd5e6c1
 ---> 2c43c7ea3cc2
Successfully built 2c43c7ea3cc2
{noformat}

{quote}
I think because this work has removed this section and hasn't replaced it with anything else that does the same thing.

{noformat}
# Add modular target in a way compatible with cmake 2.8.12
if (NOT TARGET Proton::core)
  add_library(Proton::core UNKNOWN IMPORTED)
  set_target_properties(Proton::core
    PROPERTIES
      IMPORTED_LOCATION "@LIBDIR@/@PROTONCORELIB@"
      IMPORTED_LOCATION_DEBUG "@LIBDIR@/@PROTONCORELIBDEBUG@"
      INTERFACE_INCLUDE_DIRECTORIES "${Proton_Core_INCLUDE_DIRS}")
endif()
{noformat}
{quote}

The replacement for this is

{noformat}
 186 install(EXPORT ProtonCppTargets
 187   FILE ProtonCppTargets.cmake
 188   NAMESPACE Proton::
 189   DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
 190 if (BUILD_STATIC_LIBS)
 191   install(EXPORT ProtonCppStaticTargets
 192     FILE ProtonCppTargets.cmake
 193     NAMESPACE Proton::
 194     DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
 195 endif ()
{noformat}

It generates *Target.cmake files that define the "modern" CMake targets. That file is then included from *Config.cmake file.

> The work for PROTON-2254 seems to have broken modern use of CMake
> -----------------------------------------------------------------
>
>                 Key: PROTON-2433
>                 URL: https://issues.apache.org/jira/browse/PROTON-2433
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: proton-c-0.36.0
>            Reporter: Andrew Stitcher
>            Assignee: Jiri Daněk
>            Priority: Major
>         Attachments: PROTON-2433_01.zip
>
>
> I build Proton and install it in ~/Work/qpid-install
>  ...
>  {{> ninja install}}
>  ...
>  I create a simple CMakeFiles.txt:
> {noformat}
> cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
> project(amqp-value-parser)
> find_package(Proton 0.28 REQUIRED)
> add_executable (amqp-value-test main.c)
> target_link_libraries (amqp-value-test amqp-value Proton::core)
> {noformat}
> I use cmake like so:
> {{> cmake -G Ninja -D CMAKE_INSTALL_PREFIX=~/Work/qpid-install}}
> Compiles fail to correctly find the include files for proton.
>  I think because this work has removed this section and hasn't replaced it with anything else that does the same thing. 
> {noformat}
> # Add modular target in a way compatible with cmake 2.8.12
> if (NOT TARGET Proton::core)
>   add_library(Proton::core UNKNOWN IMPORTED)
>   set_target_properties(Proton::core
>     PROPERTIES
>       IMPORTED_LOCATION "@LIBDIR@/@PROTONCORELIB@"
>       IMPORTED_LOCATION_DEBUG "@LIBDIR@/@PROTONCORELIBDEBUG@"
>       INTERFACE_INCLUDE_DIRECTORIES "${Proton_Core_INCLUDE_DIRS}")
> endif()
> {noformat}
> As the original work was only an improvement  we either need to fix this very soon or revert the original change.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org