You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Shearer, Davin" <ds...@novetta.com> on 2014/01/14 21:56:01 UTC

How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Want to create all libraries statically and boost statically, so updated
the CMakeLists.txt to make that happen (I'm not an expert on cmake, so let
me know if this is the wrong way to build static libraries):

-----
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index c77b753..22f72f0 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -306,7 +306,7 @@ endif (BUILD_TESTING)
 # Boost on Windows can use automatic linking to pick up the correct
 # Boost libs based on compile-time touching of the headers. Since we don't
 # really need to add them to the link lines, set the names to blanks.
-option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
static)" ON)
+option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
static)" OFF)
 mark_as_advanced(QPID_LINK_BOOST_DYNAMIC)

 if (MSVC)
@@ -912,7 +912,7 @@ set (qpidcommon_SOURCES
 )
 add_msvc_version (qpidcommon library dll)

-add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
+add_library (qpidcommon STATIC ${qpidcommon_SOURCES})

 target_link_libraries (qpidcommon qpidtypes
                        ${qpidcommon_platform_LIBS}
@@ -943,7 +943,7 @@ set_source_files_properties(
      COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")

 add_msvc_version (qpidtypes library dll)
-add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
+add_library(qpidtypes STATIC ${qpidtypes_SOURCES})
 target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
 set_target_properties (qpidtypes PROPERTIES
                        LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
${LINK_VERSION_SCRIPT_FLAG}"
@@ -999,7 +999,7 @@ set (qpidclient_SOURCES
 )
 add_msvc_version (qpidclient library dll)

-add_library (qpidclient SHARED ${qpidclient_SOURCES})
+add_library (qpidclient STATIC ${qpidclient_SOURCES})

 target_link_libraries (qpidclient qpidcommon
                        ${Boost_PROGRAM_OPTIONS_LIBRARY}
@@ -1070,7 +1070,7 @@ set (qpidmessaging_SOURCES

 add_msvc_version (qpidmessaging library dll)

-add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
+add_library (qpidmessaging STATIC ${qpidmessaging_SOURCES})
 target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon
"${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIB
 set_target_properties (qpidmessaging PROPERTIES
                        LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
${LINK_VERSION_SCRIPT_FLAG}"
@@ -1092,7 +1092,7 @@ if (MSVC)
     set(qpidxarm_SOURCES
${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
     if (EXISTS ${qpidxarm_SOURCES})
         add_msvc_version (qpidxarm library dll)
-        add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
+        add_library (qpidxarm STATIC ${qpidxarm_SOURCES})
         target_link_libraries (qpidxarm qpidclient qpidcommon)
         install (TARGETS qpidxarm
                  RUNTIME DESTINATION ${QPID_INSTALL_BINDIR}
@@ -1203,7 +1203,7 @@ set (qpidbroker_SOURCES
      qpid/sys/TCPIOPlugin.cpp
 )
 add_msvc_version (qpidbroker library dll)
-add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
+add_library (qpidbroker STATIC ${qpidbroker_SOURCES})

 target_link_libraries (qpidbroker qpidcommon qpidtypes
                        "${Boost_PROGRAM_OPTIONS_LIBRARY}"
@@ -1322,7 +1322,7 @@ endif (NOT WIN32)
         )

     add_msvc_version (qmf2 library dll)
-    add_library (qmf2 SHARED ${qmf2_SOURCES})
+    add_library (qmf2 STATIC ${qmf2_SOURCES})
     target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient
qpidcommon)
     set_target_properties (qmf2 PROPERTIES
                            VERSION ${qmf2_version}
-----

Want to link proton 0.50 static library
(/home/davin/external/proton-0.5/lib64/libqpid-proton.a):

$ export
PKG_CONFIG_PATH=$HOME/external/proton-0.5/lib64/pkgconfig:$PKG_CONFIG_PATH
$ pkg-config --cflags libqpid-proton
-I/home/davin/external/proton-0.5/include -I/usr/include/uuid
$ pkg-config --libs libqpid-proton
-L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl -lcrypto -luuid

Want to link PIC, link boost v1.55.0 static libraries and enable AMQP 1.0
(via proton):

$ rm -rf build-cpp
$ mkdir build-cpp
$ cd build-cpp
$ cmake \
  -DBoost_LIBRARY_DIR:PATH="/home/davin/external/boost-1.55.0/boost/lib" \

-DBoost_INCLUDE_DIR:PATH="/home/davin/external/boost-1.55.0/boost/include" \
  -DCMAKE_CXX_FLAGS:STRING="-Wno-unused-local-typedefs
-Wno-ignored-qualifiers -fPIC -DPIC -DQMF_USE_DEPRECATED_API" \
  -DBUILD_AMQP:BOOL="1" ../qpid/cpp

$ make all && make DESTDIR=$(readlink -e ..)/qpid-install install

OS is fedora19, compiler is gcc 4.8.2.  qpid is from SCM (git-svn-id:
https://svn.apache.org/repos/asf/qpid/trunk@1558037).  The static boost and
proton libraries are all built with -fPIC -DPIC.  gcc 4.8 and boost 1.55.0
generate many unused local typedef warnings with are suppressed with
-Wno-unused-local-typedefs and there is a warning about a qualifier being
ignored in boost, so we suppress that also with -Wno-ignored-qualifiers.
The QMF build is warning about using a deprecated API, so we suppress that
with -DPIC -DQMF_USE_DEPRECATED_API.

I get this far:

[ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/types.cpp.o
[ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
Linking CXX shared module ha.so
/usr/bin/ld: cannot find -lqpid-proton
collect2: error: ld returned 1 exit status
make[2]: *** [src/ha.so] Error 1
make[1]: *** [src/CMakeFiles/ha.dir/all] Error 2
make: *** [all] Error 2

The build of ha.so should be using the LDFLAGS from pkg-config --libs (in
this case -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl
-lcrypto -luuid), but obviously it is not working correctly.

$ ls -l /home/davin/external/proton-0.5/lib64/libqpid-proton.a
-rw-r--r-- 1 davin davin 553474 Dec 30 16:47
/home/davin/external/proton-0.5/lib64/libqpid-proton.a

Are the build scripts not using pkg-config correctly or am I not using
cmake correctly?

-- 
Davin Shearer

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
$make VERBOSE=1 all
...
Linking CXX shared module ha.so
cd /home/davin/git/qpid/build-cpp/src && /usr/bin/cmake -E
cmake_link_script CMakeFiles/ha.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC -Wno-unused-local-typedefs -Wno-ignored-qualifiers
-fPIC -DPIC -DQMF_USE_DEPRECATED_API -fvisibility-inlines-hidden -Werror
-pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual
-Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch
-Wno-system-headers -Woverloaded-virtual -Wl,--no-undefined   -pthread
-shared -Wl,-soname,ha.so -o ha.so CMakeFiles/ha.dir/qpid/ha/Backup.cpp.o
CMakeFiles/ha.dir/qpid/ha/BrokerInfo.cpp.o
CMakeFiles/ha.dir/qpid/ha/BrokerReplicator.cpp.o
CMakeFiles/ha.dir/qpid/ha/ConnectionObserver.cpp.o
CMakeFiles/ha.dir/qpid/ha/Event.cpp.o
CMakeFiles/ha.dir/qpid/ha/FailoverExchange.cpp.o
CMakeFiles/ha.dir/qpid/ha/HaBroker.cpp.o
CMakeFiles/ha.dir/qpid/ha/HaPlugin.cpp.o
CMakeFiles/ha.dir/qpid/ha/Membership.cpp.o
CMakeFiles/ha.dir/qpid/ha/Primary.cpp.o
CMakeFiles/ha.dir/qpid/ha/QueueGuard.cpp.o
CMakeFiles/ha.dir/qpid/ha/QueueReplicator.cpp.o
CMakeFiles/ha.dir/qpid/ha/RemoteBackup.cpp.o
CMakeFiles/ha.dir/qpid/ha/ReplicatingSubscription.cpp.o
CMakeFiles/ha.dir/qpid/ha/ReplicationTest.cpp.o
CMakeFiles/ha.dir/qpid/ha/StatusCheck.cpp.o
CMakeFiles/ha.dir/qpid/ha/TxReplicatingSubscription.cpp.o
CMakeFiles/ha.dir/qpid/ha/PrimaryTxObserver.cpp.o
CMakeFiles/ha.dir/qpid/ha/types.cpp.o
CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
-L/home/davin/external/boost-1.55.0/lib libqpidtypes.a libqpidcommon.a
libqpidbroker.a libqpidmessaging.a
/home/davin/external/boost-1.55.0/lib/libboost_program_options.a
libqpidclient.a libqpidcommon.a libqpidtypes.a -lsasl2
/home/davin/external/boost/boost-1.55.0/lib/libboost_program_options.a
-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-lqpid-proton -lssl -lcrypto -luuid
-Wl,-rpath,/home/davin/stash/exit2xx/external/boost/boost/lib:::::::::::::::::

/usr/bin/ld: cannot find -lqpid-proton
collect2: error: ld returned 1 exit status

This confirms that the linker invocation is missing the
-L/home/davin/external/proton-0.5/lib64 argument that is emitted via
pkg-config --libs libqpid-proton.


On Tue, Jan 14, 2014 at 3:56 PM, Shearer, Davin <ds...@novetta.com>wrote:

> Want to create all libraries statically and boost statically, so updated
> the CMakeLists.txt to make that happen (I'm not an expert on cmake, so let
> me know if this is the wrong way to build static libraries):
>
> -----
> diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
> index c77b753..22f72f0 100644
> --- a/qpid/cpp/src/CMakeLists.txt
> +++ b/qpid/cpp/src/CMakeLists.txt
> @@ -306,7 +306,7 @@ endif (BUILD_TESTING)
>  # Boost on Windows can use automatic linking to pick up the correct
>  # Boost libs based on compile-time touching of the headers. Since we don't
>  # really need to add them to the link lines, set the names to blanks.
> -option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
> static)" ON)
> +option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
> static)" OFF)
>  mark_as_advanced(QPID_LINK_BOOST_DYNAMIC)
>
>  if (MSVC)
> @@ -912,7 +912,7 @@ set (qpidcommon_SOURCES
>  )
>  add_msvc_version (qpidcommon library dll)
>
> -add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
> +add_library (qpidcommon STATIC ${qpidcommon_SOURCES})
>
>  target_link_libraries (qpidcommon qpidtypes
>                         ${qpidcommon_platform_LIBS}
> @@ -943,7 +943,7 @@ set_source_files_properties(
>       COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
>
>  add_msvc_version (qpidtypes library dll)
> -add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
> +add_library(qpidtypes STATIC ${qpidtypes_SOURCES})
>  target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
>  set_target_properties (qpidtypes PROPERTIES
>                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> ${LINK_VERSION_SCRIPT_FLAG}"
> @@ -999,7 +999,7 @@ set (qpidclient_SOURCES
>  )
>  add_msvc_version (qpidclient library dll)
>
> -add_library (qpidclient SHARED ${qpidclient_SOURCES})
> +add_library (qpidclient STATIC ${qpidclient_SOURCES})
>
>  target_link_libraries (qpidclient qpidcommon
>                         ${Boost_PROGRAM_OPTIONS_LIBRARY}
> @@ -1070,7 +1070,7 @@ set (qpidmessaging_SOURCES
>
>  add_msvc_version (qpidmessaging library dll)
>
> -add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
> +add_library (qpidmessaging STATIC ${qpidmessaging_SOURCES})
>  target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon
> "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIB
>  set_target_properties (qpidmessaging PROPERTIES
>                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> ${LINK_VERSION_SCRIPT_FLAG}"
> @@ -1092,7 +1092,7 @@ if (MSVC)
>      set(qpidxarm_SOURCES
> ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
>      if (EXISTS ${qpidxarm_SOURCES})
>          add_msvc_version (qpidxarm library dll)
> -        add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
> +        add_library (qpidxarm STATIC ${qpidxarm_SOURCES})
>          target_link_libraries (qpidxarm qpidclient qpidcommon)
>          install (TARGETS qpidxarm
>                   RUNTIME DESTINATION ${QPID_INSTALL_BINDIR}
> @@ -1203,7 +1203,7 @@ set (qpidbroker_SOURCES
>       qpid/sys/TCPIOPlugin.cpp
>  )
>  add_msvc_version (qpidbroker library dll)
> -add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
> +add_library (qpidbroker STATIC ${qpidbroker_SOURCES})
>
>  target_link_libraries (qpidbroker qpidcommon qpidtypes
>                         "${Boost_PROGRAM_OPTIONS_LIBRARY}"
> @@ -1322,7 +1322,7 @@ endif (NOT WIN32)
>          )
>
>      add_msvc_version (qmf2 library dll)
> -    add_library (qmf2 SHARED ${qmf2_SOURCES})
> +    add_library (qmf2 STATIC ${qmf2_SOURCES})
>      target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient
> qpidcommon)
>      set_target_properties (qmf2 PROPERTIES
>                             VERSION ${qmf2_version}
> -----
>
> Want to link proton 0.50 static library
> (/home/davin/external/proton-0.5/lib64/libqpid-proton.a):
>
> $ export
> PKG_CONFIG_PATH=$HOME/external/proton-0.5/lib64/pkgconfig:$PKG_CONFIG_PATH
> $ pkg-config --cflags libqpid-proton
> -I/home/davin/external/proton-0.5/include -I/usr/include/uuid
> $ pkg-config --libs libqpid-proton
> -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl -lcrypto
> -luuid
>
> Want to link PIC, link boost v1.55.0 static libraries and enable AMQP 1.0
> (via proton):
>
> $ rm -rf build-cpp
> $ mkdir build-cpp
> $ cd build-cpp
> $ cmake \
>   -DBoost_LIBRARY_DIR:PATH="/home/davin/external/boost-1.55.0/boost/lib" \
>
> -DBoost_INCLUDE_DIR:PATH="/home/davin/external/boost-1.55.0/boost/include" \
>   -DCMAKE_CXX_FLAGS:STRING="-Wno-unused-local-typedefs
> -Wno-ignored-qualifiers -fPIC -DPIC -DQMF_USE_DEPRECATED_API" \
>   -DBUILD_AMQP:BOOL="1" ../qpid/cpp
>
> $ make all && make DESTDIR=$(readlink -e ..)/qpid-install install
>
> OS is fedora19, compiler is gcc 4.8.2.  qpid is from SCM (git-svn-id:
> https://svn.apache.org/repos/asf/qpid/trunk@1558037).  The static boost
> and proton libraries are all built with -fPIC -DPIC.  gcc 4.8 and boost
> 1.55.0 generate many unused local typedef warnings with are suppressed with
> -Wno-unused-local-typedefs and there is a warning about a qualifier being
> ignored in boost, so we suppress that also with -Wno-ignored-qualifiers.
> The QMF build is warning about using a deprecated API, so we suppress that
> with -DPIC -DQMF_USE_DEPRECATED_API.
>
> I get this far:
>
> [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/types.cpp.o
> [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
> Linking CXX shared module ha.so
> /usr/bin/ld: cannot find -lqpid-proton
> collect2: error: ld returned 1 exit status
> make[2]: *** [src/ha.so] Error 1
> make[1]: *** [src/CMakeFiles/ha.dir/all] Error 2
> make: *** [all] Error 2
>
> The build of ha.so should be using the LDFLAGS from pkg-config --libs (in
> this case -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl
> -lcrypto -luuid), but obviously it is not working correctly.
>
> $ ls -l /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> -rw-r--r-- 1 davin davin 553474 Dec 30 16:47
> /home/davin/external/proton-0.5/lib64/libqpid-proton.a
>
> Are the build scripts not using pkg-config correctly or am I not using
> cmake correctly?
>
> --
> Davin Shearer
>
>

-- 
Davin Shearer

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by Robbie Gemmell <ro...@gmail.com>.
On 14 January 2014 21:48, Shearer, Davin <ds...@novetta.com> wrote:

> Hi Robbie,
>
> Thanks for the quick response (I love the responsiveness of this group).
> AFAIK, proton is good to go.


Oops, I had obviously sufficiently glossed over by that point that I missed
the swap back to talking about the qpid build, sorry :)


> This appears to be a problem with the qpid
> build scripts not using pkg-config correctly (or my insufficient
> cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
> which does indeed emit:
>
> $ pkg-config --libs-only-l libqpid-proton
> -lqpid-proton -lssl -lcrypto -luuid
>
> Which is what we see in the linker invocation, when it should be using:
>
> $ pkg-config --libs libqpid-proton
> -L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto -luuid
>
> Hope it helps.
>
> On Tue, Jan 14, 2014 at 4:30 PM, Robbie Gemmell <robbie.gemmell@gmail.com
> >wrote:
>
> > Hi Davin,
> >
> > I am completely the wrong person to answer your actual question I'm
> afraid,
> > but just to say...
> >
> > The vote to release RC3 as Proton 0.6 passed earlier today, so if you
> > wanted to try with that before it is properly distributed you can
> currently
> > find it here: http://people.apache.org/~rhs/qpid-proton-0.6rc3/
> >
> > Hopefully someone who can actually help will be along next...
> >
> > Robbie
> >
> > On 14 January 2014 20:56, Shearer, Davin <ds...@novetta.com> wrote:
> >
> > > Want to create all libraries statically and boost statically, so
> updated
> > > the CMakeLists.txt to make that happen (I'm not an expert on cmake, so
> > let
> > > me know if this is the wrong way to build static libraries):
> > >
> > > -----
> > > diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
> > > index c77b753..22f72f0 100644
> > > --- a/qpid/cpp/src/CMakeLists.txt
> > > +++ b/qpid/cpp/src/CMakeLists.txt
> > > @@ -306,7 +306,7 @@ endif (BUILD_TESTING)
> > >  # Boost on Windows can use automatic linking to pick up the correct
> > >  # Boost libs based on compile-time touching of the headers. Since we
> > don't
> > >  # really need to add them to the link lines, set the names to blanks.
> > > -option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to
> > link
> > > static)" ON)
> > > +option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to
> > link
> > > static)" OFF)
> > >  mark_as_advanced(QPID_LINK_BOOST_DYNAMIC)
> > >
> > >  if (MSVC)
> > > @@ -912,7 +912,7 @@ set (qpidcommon_SOURCES
> > >  )
> > >  add_msvc_version (qpidcommon library dll)
> > >
> > > -add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
> > > +add_library (qpidcommon STATIC ${qpidcommon_SOURCES})
> > >
> > >  target_link_libraries (qpidcommon qpidtypes
> > >                         ${qpidcommon_platform_LIBS}
> > > @@ -943,7 +943,7 @@ set_source_files_properties(
> > >       COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
> > >
> > >  add_msvc_version (qpidtypes library dll)
> > > -add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
> > > +add_library(qpidtypes STATIC ${qpidtypes_SOURCES})
> > >  target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
> > >  set_target_properties (qpidtypes PROPERTIES
> > >                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> > > ${LINK_VERSION_SCRIPT_FLAG}"
> > > @@ -999,7 +999,7 @@ set (qpidclient_SOURCES
> > >  )
> > >  add_msvc_version (qpidclient library dll)
> > >
> > > -add_library (qpidclient SHARED ${qpidclient_SOURCES})
> > > +add_library (qpidclient STATIC ${qpidclient_SOURCES})
> > >
> > >  target_link_libraries (qpidclient qpidcommon
> > >                         ${Boost_PROGRAM_OPTIONS_LIBRARY}
> > > @@ -1070,7 +1070,7 @@ set (qpidmessaging_SOURCES
> > >
> > >  add_msvc_version (qpidmessaging library dll)
> > >
> > > -add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
> > > +add_library (qpidmessaging STATIC ${qpidmessaging_SOURCES})
> > >  target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon
> > > "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIB
> > >  set_target_properties (qpidmessaging PROPERTIES
> > >                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> > > ${LINK_VERSION_SCRIPT_FLAG}"
> > > @@ -1092,7 +1092,7 @@ if (MSVC)
> > >      set(qpidxarm_SOURCES
> > > ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
> > >      if (EXISTS ${qpidxarm_SOURCES})
> > >          add_msvc_version (qpidxarm library dll)
> > > -        add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
> > > +        add_library (qpidxarm STATIC ${qpidxarm_SOURCES})
> > >          target_link_libraries (qpidxarm qpidclient qpidcommon)
> > >          install (TARGETS qpidxarm
> > >                   RUNTIME DESTINATION ${QPID_INSTALL_BINDIR}
> > > @@ -1203,7 +1203,7 @@ set (qpidbroker_SOURCES
> > >       qpid/sys/TCPIOPlugin.cpp
> > >  )
> > >  add_msvc_version (qpidbroker library dll)
> > > -add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
> > > +add_library (qpidbroker STATIC ${qpidbroker_SOURCES})
> > >
> > >  target_link_libraries (qpidbroker qpidcommon qpidtypes
> > >                         "${Boost_PROGRAM_OPTIONS_LIBRARY}"
> > > @@ -1322,7 +1322,7 @@ endif (NOT WIN32)
> > >          )
> > >
> > >      add_msvc_version (qmf2 library dll)
> > > -    add_library (qmf2 SHARED ${qmf2_SOURCES})
> > > +    add_library (qmf2 STATIC ${qmf2_SOURCES})
> > >      target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient
> > > qpidcommon)
> > >      set_target_properties (qmf2 PROPERTIES
> > >                             VERSION ${qmf2_version}
> > > -----
> > >
> > > Want to link proton 0.50 static library
> > > (/home/davin/external/proton-0.5/lib64/libqpid-proton.a):
> > >
> > > $ export
> > >
> >
> PKG_CONFIG_PATH=$HOME/external/proton-0.5/lib64/pkgconfig:$PKG_CONFIG_PATH
> > > $ pkg-config --cflags libqpid-proton
> > > -I/home/davin/external/proton-0.5/include -I/usr/include/uuid
> > > $ pkg-config --libs libqpid-proton
> > > -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl -lcrypto
> > -luuid
> > >
> > > Want to link PIC, link boost v1.55.0 static libraries and enable AMQP
> 1.0
> > > (via proton):
> > >
> > > $ rm -rf build-cpp
> > > $ mkdir build-cpp
> > > $ cd build-cpp
> > > $ cmake \
> > >
> -DBoost_LIBRARY_DIR:PATH="/home/davin/external/boost-1.55.0/boost/lib"
> > \
> > >
> > >
> >
> -DBoost_INCLUDE_DIR:PATH="/home/davin/external/boost-1.55.0/boost/include"
> > > \
> > >   -DCMAKE_CXX_FLAGS:STRING="-Wno-unused-local-typedefs
> > > -Wno-ignored-qualifiers -fPIC -DPIC -DQMF_USE_DEPRECATED_API" \
> > >   -DBUILD_AMQP:BOOL="1" ../qpid/cpp
> > >
> > > $ make all && make DESTDIR=$(readlink -e ..)/qpid-install install
> > >
> > > OS is fedora19, compiler is gcc 4.8.2.  qpid is from SCM (git-svn-id:
> > > https://svn.apache.org/repos/asf/qpid/trunk@1558037).  The static
> boost
> > > and
> > > proton libraries are all built with -fPIC -DPIC.  gcc 4.8 and boost
> > 1.55.0
> > > generate many unused local typedef warnings with are suppressed with
> > > -Wno-unused-local-typedefs and there is a warning about a qualifier
> being
> > > ignored in boost, so we suppress that also with
> -Wno-ignored-qualifiers.
> > > The QMF build is warning about using a deprecated API, so we suppress
> > that
> > > with -DPIC -DQMF_USE_DEPRECATED_API.
> > >
> > > I get this far:
> > >
> > > [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/types.cpp.o
> > > [ 78%] Building CXX object
> > src/CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
> > > Linking CXX shared module ha.so
> > > /usr/bin/ld: cannot find -lqpid-proton
> > > collect2: error: ld returned 1 exit status
> > > make[2]: *** [src/ha.so] Error 1
> > > make[1]: *** [src/CMakeFiles/ha.dir/all] Error 2
> > > make: *** [all] Error 2
> > >
> > > The build of ha.so should be using the LDFLAGS from pkg-config --libs
> (in
> > > this case -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl
> > > -lcrypto -luuid), but obviously it is not working correctly.
> > >
> > > $ ls -l /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> > > -rw-r--r-- 1 davin davin 553474 Dec 30 16:47
> > > /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> > >
> > > Are the build scripts not using pkg-config correctly or am I not using
> > > cmake correctly?
> > >
> > > --
> > > Davin Shearer
> > >
> >
>
>
> --
> Davin Shearer
>

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
OK, got it built and I'm pleased that ldd on the executables and modules
reports nothing about qpid, proton and boost and I have a nice set of
libqpid*.a files available for static linking.  What I had to do was expand
all the -lqpid-proton to /path/to/lib/libqpid-proton.a in all the link.txt
files.

So after running cmake and before running make, I run:

PROTON_LIB=$(pkg-config --libs-only-L libqpid-proton | sed -e 's|^-L||' -e
's|\s*$|/libqpid-proton.a|')
find -type f -name link.txt | xargs perl -pi -e
"s|-lqpid-proton|$PROTON_LIB|g"

All those times the build would have used -lqpid-python it now just has the
path directly to the .a file.  I wish I knew more about the build process
to (suggest how) fix this properly.

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
Ok, so it's not actually using pkg-config to get the linker arguments (been
in automake territory for too long).  I find this in the build directory:

$ ack qpid-proton
CMakeCache.txt
494:amqp_LIB_DEPENDS:STATIC=general;qpidtypes;general;qpidbroker;general;qpidcommon;general;qpid-proton;general;ssl;general;crypto;general;uuid;general;/home/davin/external/boost-1.55.0/lib/libboost_program_options.a;
551:qpidmessaging_LIB_DEPENDS:STATIC=general;qpidtypes;general;qpidclient;general;qpidcommon;general;/home/davin/external/boost-1.55.0/lib/libboost_program_options.a;general;qpid-proton;general;ssl;general;crypto;general;uuid;
893:PROTON_LDFLAGS:INTERNAL=-L/home/davin/external/proton-0.5/lib64;-lqpid-proton;-lssl;-lcrypto;-luuid
896:PROTON_LIBRARIES:INTERNAL=qpid-proton;ssl;crypto;uuid
907:PROTON_STATIC_LDFLAGS:INTERNAL=-Wl,-z,relro;-L/home/davin/external/proton-0.5/lib64;-lqpid-proton;-lssl;-lcrypto;-ldl;-lz;-lgssapi_krb5;-lkrb5;-lcom_err;-lk5crypto;-luuid
910:PROTON_STATIC_LIBRARIES:INTERNAL=qpid-proton;ssl;crypto;dl;z;gssapi_krb5;krb5;com_err;k5crypto;uuid
917:PROTON_libqpid-proton_INCLUDEDIR:INTERNAL=
918:PROTON_libqpid-proton_LIBDIR:INTERNAL=
919:PROTON_libqpid-proton_PREFIX:INTERNAL=
920:PROTON_libqpid-proton_VERSION:INTERNAL=

Hope it helps.



On Wed, Jan 15, 2014 at 10:10 AM, Shearer, Davin <ds...@novetta.com>wrote:

> The HA section in the CMakeLists.txt file is straightforward.  I suspect
> that the issue isn't with the HA build itself, but with the flags of its
> dependencies (correctly, proton is not listed).  Around line 636, we see
> this:
>
>     target_link_libraries (ha
>                            qpidtypes qpidcommon qpidbroker qpidmessaging
>                            "${Boost_PROGRAM_OPTIONS_LIBRARY}")
>
>
> If this operation uses the pkg-config files of the dependency qpid*
> libraries, I'd say that's where you're going to find your problem.
> Specifically that one or more of those libraries have the -lqpid-proton
> -lssl -lcrypto in its pkg-config file, but is missing the
> -L/path/to/libqpid-proton argument.  If that is the case, the fix is to put
> qpid-proton into the Requires line instead.  What that will do is use
> pkg-config to get the (correct) linker flags from the qpid-proton.pc.
>
>
> On Wed, Jan 15, 2014 at 9:51 AM, Shearer, Davin <ds...@novetta.com>wrote:
>
>> Hi Gordon,
>>
>> I put my changes off into a separate branch, switched back to trunk and
>> re-ran the build on the unmodified source and I've still got the same
>> problem (HA trying to link proton without the -L argument).  In my
>> CMakeLists.txt in cpp/src, the include (amqp.make) line is at 649.  I'm
>> using commit git-svn-id:
>> https://svn.apache.org/repos/asf/qpid/trunk@155836313f79535-47bb-0310-9956-ffa450edef68.
>>
>> I then tried (as you suggested) moving the include (amqp.make) line to
>> somewhere above the HA stuff:
>>
>> $ git diff
>> diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
>> index c77b753..5939419 100644
>> --- a/qpid/cpp/src/CMakeLists.txt
>> +++ b/qpid/cpp/src/CMakeLists.txt
>> @@ -574,6 +574,9 @@ if (BUILD_ACL)
>>        )
>>  endif (BUILD_ACL)
>>
>> +# Check for optional AMQP 1.0 support requirements
>> +include (amqp.cmake)
>> +
>>  set (ha_default ON)
>>
>>  option(BUILD_HA "Build Active-Passive HA plugin" ${ha_default})
>> @@ -645,9 +648,6 @@ endif (BUILD_HA)
>>  # Check for optional RDMA support requirements
>>  include (rdma.cmake)
>>
>> -# Check for optional AMQP 1.0 support requirements
>> -include (amqp.cmake)
>> -
>>  # Check for syslog capabilities not present on all systems
>>  check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
>>  check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)
>>
>> The good news is that the amqp.so module built fine (it has the proper -L
>> argument), but the HA module _still_ fails to link (missing the -L
>> argument).  And you're suspicion about HA not needing proton (nor ssl nor
>> crypto) is correct and should be removed from the HA build.  BTW, if I
>> remove them by hand (-lqpid-proton -lssl -lcrypto), the ha.so module is
>> linked successfully.
>>
>>
>> On Wed, Jan 15, 2014 at 4:47 AM, Gordon Sim <gs...@redhat.com> wrote:
>>
>>> On 01/14/2014 09:48 PM, Shearer, Davin wrote:
>>>
>>>> Thanks for the quick response (I love the responsiveness of this group).
>>>> AFAIK, proton is good to go.  This appears to be a problem with the qpid
>>>> build scripts not using pkg-config correctly (or my insufficient
>>>> cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
>>>> which does indeed emit:
>>>>
>>>> $ pkg-config --libs-only-l libqpid-proton
>>>> -lqpid-proton -lssl -lcrypto -luuid
>>>>
>>>> Which is what we see in the linker invocation, when it should be using:
>>>>
>>>> $ pkg-config --libs libqpid-proton
>>>> -L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto
>>>> -luuid
>>>>
>>>
>>> My first question was why ha.so needed to link to proton at all... that
>>> appears to be a result of changing the 1.0 support in the client from a
>>> plugin to compiled in (the ha module links against the client).
>>>
>>> What seems to be missing in your case is the effect of the
>>> link_directories(${PROTON_LIBRARY_DIRS}) in amqp.cmake. That sets the
>>> path for the library where $PROTON_LIBRARIES is only the library itself.
>>>
>>> I always build against a non-standard location of proton, and it works
>>> for me as checked in on fedora 17. Does a build without your modifications
>>> for static libraries work?
>>>
>>> One thought is whether moving the include (amqp.cmake) in line 652 up
>>> above the ha section would help (line 579 or earlier) would help?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>>> For additional commands, e-mail: users-help@qpid.apache.org
>>>
>>>
>>
>> --
>> Davin Shearer
>>
>
>
> --
> Davin Shearer
>



-- 
Davin Shearer
Engineer

8830 Stanford Blvd, Suite 306
Columbia, MD 21045

443-741-4517

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
The HA section in the CMakeLists.txt file is straightforward.  I suspect
that the issue isn't with the HA build itself, but with the flags of its
dependencies (correctly, proton is not listed).  Around line 636, we see
this:

    target_link_libraries (ha
                           qpidtypes qpidcommon qpidbroker qpidmessaging
                           "${Boost_PROGRAM_OPTIONS_LIBRARY}")


If this operation uses the pkg-config files of the dependency qpid*
libraries, I'd say that's where you're going to find your problem.
Specifically that one or more of those libraries have the -lqpid-proton
-lssl -lcrypto in its pkg-config file, but is missing the
-L/path/to/libqpid-proton argument.  If that is the case, the fix is to put
qpid-proton into the Requires line instead.  What that will do is use
pkg-config to get the (correct) linker flags from the qpid-proton.pc.


On Wed, Jan 15, 2014 at 9:51 AM, Shearer, Davin <ds...@novetta.com>wrote:

> Hi Gordon,
>
> I put my changes off into a separate branch, switched back to trunk and
> re-ran the build on the unmodified source and I've still got the same
> problem (HA trying to link proton without the -L argument).  In my
> CMakeLists.txt in cpp/src, the include (amqp.make) line is at 649.  I'm
> using commit git-svn-id:
> https://svn.apache.org/repos/asf/qpid/trunk@155836313f79535-47bb-0310-9956-ffa450edef68.
>
> I then tried (as you suggested) moving the include (amqp.make) line to
> somewhere above the HA stuff:
>
> $ git diff
> diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
> index c77b753..5939419 100644
> --- a/qpid/cpp/src/CMakeLists.txt
> +++ b/qpid/cpp/src/CMakeLists.txt
> @@ -574,6 +574,9 @@ if (BUILD_ACL)
>        )
>  endif (BUILD_ACL)
>
> +# Check for optional AMQP 1.0 support requirements
> +include (amqp.cmake)
> +
>  set (ha_default ON)
>
>  option(BUILD_HA "Build Active-Passive HA plugin" ${ha_default})
> @@ -645,9 +648,6 @@ endif (BUILD_HA)
>  # Check for optional RDMA support requirements
>  include (rdma.cmake)
>
> -# Check for optional AMQP 1.0 support requirements
> -include (amqp.cmake)
> -
>  # Check for syslog capabilities not present on all systems
>  check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
>  check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)
>
> The good news is that the amqp.so module built fine (it has the proper -L
> argument), but the HA module _still_ fails to link (missing the -L
> argument).  And you're suspicion about HA not needing proton (nor ssl nor
> crypto) is correct and should be removed from the HA build.  BTW, if I
> remove them by hand (-lqpid-proton -lssl -lcrypto), the ha.so module is
> linked successfully.
>
>
> On Wed, Jan 15, 2014 at 4:47 AM, Gordon Sim <gs...@redhat.com> wrote:
>
>> On 01/14/2014 09:48 PM, Shearer, Davin wrote:
>>
>>> Thanks for the quick response (I love the responsiveness of this group).
>>> AFAIK, proton is good to go.  This appears to be a problem with the qpid
>>> build scripts not using pkg-config correctly (or my insufficient
>>> cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
>>> which does indeed emit:
>>>
>>> $ pkg-config --libs-only-l libqpid-proton
>>> -lqpid-proton -lssl -lcrypto -luuid
>>>
>>> Which is what we see in the linker invocation, when it should be using:
>>>
>>> $ pkg-config --libs libqpid-proton
>>> -L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto
>>> -luuid
>>>
>>
>> My first question was why ha.so needed to link to proton at all... that
>> appears to be a result of changing the 1.0 support in the client from a
>> plugin to compiled in (the ha module links against the client).
>>
>> What seems to be missing in your case is the effect of the
>> link_directories(${PROTON_LIBRARY_DIRS}) in amqp.cmake. That sets the
>> path for the library where $PROTON_LIBRARIES is only the library itself.
>>
>> I always build against a non-standard location of proton, and it works
>> for me as checked in on fedora 17. Does a build without your modifications
>> for static libraries work?
>>
>> One thought is whether moving the include (amqp.cmake) in line 652 up
>> above the ha section would help (line 579 or earlier) would help?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>>
>
> --
> Davin Shearer
>


-- 
Davin Shearer

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
Hi Gordon,

I put my changes off into a separate branch, switched back to trunk and
re-ran the build on the unmodified source and I've still got the same
problem (HA trying to link proton without the -L argument).  In my
CMakeLists.txt in cpp/src, the include (amqp.make) line is at 649.  I'm
using commit git-svn-id:
https://svn.apache.org/repos/asf/qpid/trunk@155836313f79535-47bb-0310-9956-ffa450edef68.

I then tried (as you suggested) moving the include (amqp.make) line to
somewhere above the HA stuff:

$ git diff
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index c77b753..5939419 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -574,6 +574,9 @@ if (BUILD_ACL)
       )
 endif (BUILD_ACL)

+# Check for optional AMQP 1.0 support requirements
+include (amqp.cmake)
+
 set (ha_default ON)

 option(BUILD_HA "Build Active-Passive HA plugin" ${ha_default})
@@ -645,9 +648,6 @@ endif (BUILD_HA)
 # Check for optional RDMA support requirements
 include (rdma.cmake)

-# Check for optional AMQP 1.0 support requirements
-include (amqp.cmake)
-
 # Check for syslog capabilities not present on all systems
 check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
 check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)

The good news is that the amqp.so module built fine (it has the proper -L
argument), but the HA module _still_ fails to link (missing the -L
argument).  And you're suspicion about HA not needing proton (nor ssl nor
crypto) is correct and should be removed from the HA build.  BTW, if I
remove them by hand (-lqpid-proton -lssl -lcrypto), the ha.so module is
linked successfully.


On Wed, Jan 15, 2014 at 4:47 AM, Gordon Sim <gs...@redhat.com> wrote:

> On 01/14/2014 09:48 PM, Shearer, Davin wrote:
>
>> Thanks for the quick response (I love the responsiveness of this group).
>> AFAIK, proton is good to go.  This appears to be a problem with the qpid
>> build scripts not using pkg-config correctly (or my insufficient
>> cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
>> which does indeed emit:
>>
>> $ pkg-config --libs-only-l libqpid-proton
>> -lqpid-proton -lssl -lcrypto -luuid
>>
>> Which is what we see in the linker invocation, when it should be using:
>>
>> $ pkg-config --libs libqpid-proton
>> -L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto
>> -luuid
>>
>
> My first question was why ha.so needed to link to proton at all... that
> appears to be a result of changing the 1.0 support in the client from a
> plugin to compiled in (the ha module links against the client).
>
> What seems to be missing in your case is the effect of the
> link_directories(${PROTON_LIBRARY_DIRS}) in amqp.cmake. That sets the
> path for the library where $PROTON_LIBRARIES is only the library itself.
>
> I always build against a non-standard location of proton, and it works for
> me as checked in on fedora 17. Does a build without your modifications for
> static libraries work?
>
> One thought is whether moving the include (amqp.cmake) in line 652 up
> above the ha section would help (line 579 or earlier) would help?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

-- 
Davin Shearer

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by Gordon Sim <gs...@redhat.com>.
On 01/14/2014 09:48 PM, Shearer, Davin wrote:
> Thanks for the quick response (I love the responsiveness of this group).
> AFAIK, proton is good to go.  This appears to be a problem with the qpid
> build scripts not using pkg-config correctly (or my insufficient
> cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
> which does indeed emit:
>
> $ pkg-config --libs-only-l libqpid-proton
> -lqpid-proton -lssl -lcrypto -luuid
>
> Which is what we see in the linker invocation, when it should be using:
>
> $ pkg-config --libs libqpid-proton
> -L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto -luuid

My first question was why ha.so needed to link to proton at all... that 
appears to be a result of changing the 1.0 support in the client from a 
plugin to compiled in (the ha module links against the client).

What seems to be missing in your case is the effect of the 
link_directories(${PROTON_LIBRARY_DIRS}) in amqp.cmake. That sets the 
path for the library where $PROTON_LIBRARIES is only the library itself.

I always build against a non-standard location of proton, and it works 
for me as checked in on fedora 17. Does a build without your 
modifications for static libraries work?

One thought is whether moving the include (amqp.cmake) in line 652 up 
above the ha section would help (line 579 or earlier) would help?


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


Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by "Shearer, Davin" <ds...@novetta.com>.
Hi Robbie,

Thanks for the quick response (I love the responsiveness of this group).
AFAIK, proton is good to go.  This appears to be a problem with the qpid
build scripts not using pkg-config correctly (or my insufficient
cmake-fu?!).  It looks to me like it's using pkg-config --libs-only-l,
which does indeed emit:

$ pkg-config --libs-only-l libqpid-proton
-lqpid-proton -lssl -lcrypto -luuid

Which is what we see in the linker invocation, when it should be using:

$ pkg-config --libs libqpid-proton
-L/home/davin/external/proton-5.0/lib64 -lqpid-proton -lssl -lcrypto -luuid

Hope it helps.

On Tue, Jan 14, 2014 at 4:30 PM, Robbie Gemmell <ro...@gmail.com>wrote:

> Hi Davin,
>
> I am completely the wrong person to answer your actual question I'm afraid,
> but just to say...
>
> The vote to release RC3 as Proton 0.6 passed earlier today, so if you
> wanted to try with that before it is properly distributed you can currently
> find it here: http://people.apache.org/~rhs/qpid-proton-0.6rc3/
>
> Hopefully someone who can actually help will be along next...
>
> Robbie
>
> On 14 January 2014 20:56, Shearer, Davin <ds...@novetta.com> wrote:
>
> > Want to create all libraries statically and boost statically, so updated
> > the CMakeLists.txt to make that happen (I'm not an expert on cmake, so
> let
> > me know if this is the wrong way to build static libraries):
> >
> > -----
> > diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
> > index c77b753..22f72f0 100644
> > --- a/qpid/cpp/src/CMakeLists.txt
> > +++ b/qpid/cpp/src/CMakeLists.txt
> > @@ -306,7 +306,7 @@ endif (BUILD_TESTING)
> >  # Boost on Windows can use automatic linking to pick up the correct
> >  # Boost libs based on compile-time touching of the headers. Since we
> don't
> >  # really need to add them to the link lines, set the names to blanks.
> > -option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to
> link
> > static)" ON)
> > +option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to
> link
> > static)" OFF)
> >  mark_as_advanced(QPID_LINK_BOOST_DYNAMIC)
> >
> >  if (MSVC)
> > @@ -912,7 +912,7 @@ set (qpidcommon_SOURCES
> >  )
> >  add_msvc_version (qpidcommon library dll)
> >
> > -add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
> > +add_library (qpidcommon STATIC ${qpidcommon_SOURCES})
> >
> >  target_link_libraries (qpidcommon qpidtypes
> >                         ${qpidcommon_platform_LIBS}
> > @@ -943,7 +943,7 @@ set_source_files_properties(
> >       COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
> >
> >  add_msvc_version (qpidtypes library dll)
> > -add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
> > +add_library(qpidtypes STATIC ${qpidtypes_SOURCES})
> >  target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
> >  set_target_properties (qpidtypes PROPERTIES
> >                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> > ${LINK_VERSION_SCRIPT_FLAG}"
> > @@ -999,7 +999,7 @@ set (qpidclient_SOURCES
> >  )
> >  add_msvc_version (qpidclient library dll)
> >
> > -add_library (qpidclient SHARED ${qpidclient_SOURCES})
> > +add_library (qpidclient STATIC ${qpidclient_SOURCES})
> >
> >  target_link_libraries (qpidclient qpidcommon
> >                         ${Boost_PROGRAM_OPTIONS_LIBRARY}
> > @@ -1070,7 +1070,7 @@ set (qpidmessaging_SOURCES
> >
> >  add_msvc_version (qpidmessaging library dll)
> >
> > -add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
> > +add_library (qpidmessaging STATIC ${qpidmessaging_SOURCES})
> >  target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon
> > "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIB
> >  set_target_properties (qpidmessaging PROPERTIES
> >                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> > ${LINK_VERSION_SCRIPT_FLAG}"
> > @@ -1092,7 +1092,7 @@ if (MSVC)
> >      set(qpidxarm_SOURCES
> > ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
> >      if (EXISTS ${qpidxarm_SOURCES})
> >          add_msvc_version (qpidxarm library dll)
> > -        add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
> > +        add_library (qpidxarm STATIC ${qpidxarm_SOURCES})
> >          target_link_libraries (qpidxarm qpidclient qpidcommon)
> >          install (TARGETS qpidxarm
> >                   RUNTIME DESTINATION ${QPID_INSTALL_BINDIR}
> > @@ -1203,7 +1203,7 @@ set (qpidbroker_SOURCES
> >       qpid/sys/TCPIOPlugin.cpp
> >  )
> >  add_msvc_version (qpidbroker library dll)
> > -add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
> > +add_library (qpidbroker STATIC ${qpidbroker_SOURCES})
> >
> >  target_link_libraries (qpidbroker qpidcommon qpidtypes
> >                         "${Boost_PROGRAM_OPTIONS_LIBRARY}"
> > @@ -1322,7 +1322,7 @@ endif (NOT WIN32)
> >          )
> >
> >      add_msvc_version (qmf2 library dll)
> > -    add_library (qmf2 SHARED ${qmf2_SOURCES})
> > +    add_library (qmf2 STATIC ${qmf2_SOURCES})
> >      target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient
> > qpidcommon)
> >      set_target_properties (qmf2 PROPERTIES
> >                             VERSION ${qmf2_version}
> > -----
> >
> > Want to link proton 0.50 static library
> > (/home/davin/external/proton-0.5/lib64/libqpid-proton.a):
> >
> > $ export
> >
> PKG_CONFIG_PATH=$HOME/external/proton-0.5/lib64/pkgconfig:$PKG_CONFIG_PATH
> > $ pkg-config --cflags libqpid-proton
> > -I/home/davin/external/proton-0.5/include -I/usr/include/uuid
> > $ pkg-config --libs libqpid-proton
> > -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl -lcrypto
> -luuid
> >
> > Want to link PIC, link boost v1.55.0 static libraries and enable AMQP 1.0
> > (via proton):
> >
> > $ rm -rf build-cpp
> > $ mkdir build-cpp
> > $ cd build-cpp
> > $ cmake \
> >   -DBoost_LIBRARY_DIR:PATH="/home/davin/external/boost-1.55.0/boost/lib"
> \
> >
> >
> -DBoost_INCLUDE_DIR:PATH="/home/davin/external/boost-1.55.0/boost/include"
> > \
> >   -DCMAKE_CXX_FLAGS:STRING="-Wno-unused-local-typedefs
> > -Wno-ignored-qualifiers -fPIC -DPIC -DQMF_USE_DEPRECATED_API" \
> >   -DBUILD_AMQP:BOOL="1" ../qpid/cpp
> >
> > $ make all && make DESTDIR=$(readlink -e ..)/qpid-install install
> >
> > OS is fedora19, compiler is gcc 4.8.2.  qpid is from SCM (git-svn-id:
> > https://svn.apache.org/repos/asf/qpid/trunk@1558037).  The static boost
> > and
> > proton libraries are all built with -fPIC -DPIC.  gcc 4.8 and boost
> 1.55.0
> > generate many unused local typedef warnings with are suppressed with
> > -Wno-unused-local-typedefs and there is a warning about a qualifier being
> > ignored in boost, so we suppress that also with -Wno-ignored-qualifiers.
> > The QMF build is warning about using a deprecated API, so we suppress
> that
> > with -DPIC -DQMF_USE_DEPRECATED_API.
> >
> > I get this far:
> >
> > [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/types.cpp.o
> > [ 78%] Building CXX object
> src/CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
> > Linking CXX shared module ha.so
> > /usr/bin/ld: cannot find -lqpid-proton
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [src/ha.so] Error 1
> > make[1]: *** [src/CMakeFiles/ha.dir/all] Error 2
> > make: *** [all] Error 2
> >
> > The build of ha.so should be using the LDFLAGS from pkg-config --libs (in
> > this case -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl
> > -lcrypto -luuid), but obviously it is not working correctly.
> >
> > $ ls -l /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> > -rw-r--r-- 1 davin davin 553474 Dec 30 16:47
> > /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> >
> > Are the build scripts not using pkg-config correctly or am I not using
> > cmake correctly?
> >
> > --
> > Davin Shearer
> >
>


-- 
Davin Shearer

Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19

Posted by Robbie Gemmell <ro...@gmail.com>.
Hi Davin,

I am completely the wrong person to answer your actual question I'm afraid,
but just to say...

The vote to release RC3 as Proton 0.6 passed earlier today, so if you
wanted to try with that before it is properly distributed you can currently
find it here: http://people.apache.org/~rhs/qpid-proton-0.6rc3/

Hopefully someone who can actually help will be along next...

Robbie

On 14 January 2014 20:56, Shearer, Davin <ds...@novetta.com> wrote:

> Want to create all libraries statically and boost statically, so updated
> the CMakeLists.txt to make that happen (I'm not an expert on cmake, so let
> me know if this is the wrong way to build static libraries):
>
> -----
> diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
> index c77b753..22f72f0 100644
> --- a/qpid/cpp/src/CMakeLists.txt
> +++ b/qpid/cpp/src/CMakeLists.txt
> @@ -306,7 +306,7 @@ endif (BUILD_TESTING)
>  # Boost on Windows can use automatic linking to pick up the correct
>  # Boost libs based on compile-time touching of the headers. Since we don't
>  # really need to add them to the link lines, set the names to blanks.
> -option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
> static)" ON)
> +option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link
> static)" OFF)
>  mark_as_advanced(QPID_LINK_BOOST_DYNAMIC)
>
>  if (MSVC)
> @@ -912,7 +912,7 @@ set (qpidcommon_SOURCES
>  )
>  add_msvc_version (qpidcommon library dll)
>
> -add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
> +add_library (qpidcommon STATIC ${qpidcommon_SOURCES})
>
>  target_link_libraries (qpidcommon qpidtypes
>                         ${qpidcommon_platform_LIBS}
> @@ -943,7 +943,7 @@ set_source_files_properties(
>       COMPILE_FLAGS "${HIDE_SYMBOL_FLAGS}")
>
>  add_msvc_version (qpidtypes library dll)
> -add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
> +add_library(qpidtypes STATIC ${qpidtypes_SOURCES})
>  target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
>  set_target_properties (qpidtypes PROPERTIES
>                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> ${LINK_VERSION_SCRIPT_FLAG}"
> @@ -999,7 +999,7 @@ set (qpidclient_SOURCES
>  )
>  add_msvc_version (qpidclient library dll)
>
> -add_library (qpidclient SHARED ${qpidclient_SOURCES})
> +add_library (qpidclient STATIC ${qpidclient_SOURCES})
>
>  target_link_libraries (qpidclient qpidcommon
>                         ${Boost_PROGRAM_OPTIONS_LIBRARY}
> @@ -1070,7 +1070,7 @@ set (qpidmessaging_SOURCES
>
>  add_msvc_version (qpidmessaging library dll)
>
> -add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
> +add_library (qpidmessaging STATIC ${qpidmessaging_SOURCES})
>  target_link_libraries (qpidmessaging qpidtypes qpidclient qpidcommon
> "${Boost_PROGRAM_OPTIONS_LIBRARY}" ${PROTON_LIB
>  set_target_properties (qpidmessaging PROPERTIES
>                         LINK_FLAGS "${HIDE_SYMBOL_FLAGS}
> ${LINK_VERSION_SCRIPT_FLAG}"
> @@ -1092,7 +1092,7 @@ if (MSVC)
>      set(qpidxarm_SOURCES
> ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
>      if (EXISTS ${qpidxarm_SOURCES})
>          add_msvc_version (qpidxarm library dll)
> -        add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
> +        add_library (qpidxarm STATIC ${qpidxarm_SOURCES})
>          target_link_libraries (qpidxarm qpidclient qpidcommon)
>          install (TARGETS qpidxarm
>                   RUNTIME DESTINATION ${QPID_INSTALL_BINDIR}
> @@ -1203,7 +1203,7 @@ set (qpidbroker_SOURCES
>       qpid/sys/TCPIOPlugin.cpp
>  )
>  add_msvc_version (qpidbroker library dll)
> -add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
> +add_library (qpidbroker STATIC ${qpidbroker_SOURCES})
>
>  target_link_libraries (qpidbroker qpidcommon qpidtypes
>                         "${Boost_PROGRAM_OPTIONS_LIBRARY}"
> @@ -1322,7 +1322,7 @@ endif (NOT WIN32)
>          )
>
>      add_msvc_version (qmf2 library dll)
> -    add_library (qmf2 SHARED ${qmf2_SOURCES})
> +    add_library (qmf2 STATIC ${qmf2_SOURCES})
>      target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient
> qpidcommon)
>      set_target_properties (qmf2 PROPERTIES
>                             VERSION ${qmf2_version}
> -----
>
> Want to link proton 0.50 static library
> (/home/davin/external/proton-0.5/lib64/libqpid-proton.a):
>
> $ export
> PKG_CONFIG_PATH=$HOME/external/proton-0.5/lib64/pkgconfig:$PKG_CONFIG_PATH
> $ pkg-config --cflags libqpid-proton
> -I/home/davin/external/proton-0.5/include -I/usr/include/uuid
> $ pkg-config --libs libqpid-proton
> -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl -lcrypto -luuid
>
> Want to link PIC, link boost v1.55.0 static libraries and enable AMQP 1.0
> (via proton):
>
> $ rm -rf build-cpp
> $ mkdir build-cpp
> $ cd build-cpp
> $ cmake \
>   -DBoost_LIBRARY_DIR:PATH="/home/davin/external/boost-1.55.0/boost/lib" \
>
> -DBoost_INCLUDE_DIR:PATH="/home/davin/external/boost-1.55.0/boost/include"
> \
>   -DCMAKE_CXX_FLAGS:STRING="-Wno-unused-local-typedefs
> -Wno-ignored-qualifiers -fPIC -DPIC -DQMF_USE_DEPRECATED_API" \
>   -DBUILD_AMQP:BOOL="1" ../qpid/cpp
>
> $ make all && make DESTDIR=$(readlink -e ..)/qpid-install install
>
> OS is fedora19, compiler is gcc 4.8.2.  qpid is from SCM (git-svn-id:
> https://svn.apache.org/repos/asf/qpid/trunk@1558037).  The static boost
> and
> proton libraries are all built with -fPIC -DPIC.  gcc 4.8 and boost 1.55.0
> generate many unused local typedef warnings with are suppressed with
> -Wno-unused-local-typedefs and there is a warning about a qualifier being
> ignored in boost, so we suppress that also with -Wno-ignored-qualifiers.
> The QMF build is warning about using a deprecated API, so we suppress that
> with -DPIC -DQMF_USE_DEPRECATED_API.
>
> I get this far:
>
> [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/types.cpp.o
> [ 78%] Building CXX object src/CMakeFiles/ha.dir/qpid/ha/TxReplicator.cpp.o
> Linking CXX shared module ha.so
> /usr/bin/ld: cannot find -lqpid-proton
> collect2: error: ld returned 1 exit status
> make[2]: *** [src/ha.so] Error 1
> make[1]: *** [src/CMakeFiles/ha.dir/all] Error 2
> make: *** [all] Error 2
>
> The build of ha.so should be using the LDFLAGS from pkg-config --libs (in
> this case -L/home/davin/external/proton-0.5/lib64 -lqpid-proton -lssl
> -lcrypto -luuid), but obviously it is not working correctly.
>
> $ ls -l /home/davin/external/proton-0.5/lib64/libqpid-proton.a
> -rw-r--r-- 1 davin davin 553474 Dec 30 16:47
> /home/davin/external/proton-0.5/lib64/libqpid-proton.a
>
> Are the build scripts not using pkg-config correctly or am I not using
> cmake correctly?
>
> --
> Davin Shearer
>