Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEBE51008E for ; Tue, 14 Jan 2014 21:23:56 +0000 (UTC) Received: (qmail 65007 invoked by uid 500); 14 Jan 2014 21:23:56 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 64979 invoked by uid 500); 14 Jan 2014 21:23:56 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 64969 invoked by uid 99); 14 Jan 2014 21:23:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 21:23:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.214.41] (HELO mail-bk0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 21:23:51 +0000 Received: by mail-bk0-f41.google.com with SMTP id u12so285273bkz.14 for ; Tue, 14 Jan 2014 13:23:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=qRcfSFGIU+wQAKitiUljxGsjhvJIP9t1lotSf4sZy2w=; b=iXbA7DiQ/I2t0onQNrND/XItPOPtiUW5bkVvb68OJzPefLBphBUVFQT/GAW3bPqw6m iETrwCB2VrthryIQWbRFa+2BOrpc2w9XrHsj0dG5rW8DyEyH/3kSkiAKGJuBDdyi5JLL vraiEWFnhQcA2MQDfab3ZtngTTYK+jcMdOJoFaWwGC5l1fToxLCD3yFI/8SKvlMWPFLv WjylGH4qadHfXqBhHksI5mAOM+x5wFug4u0AyZ8Cnbi1tX9XwKRQy0Rzed7ifIUvHUX6 07iWXbdAupg5S9j+TA71EGuv52gWBSvjdWyOVy4TAax4B/he0SMWq4EX9qt9LtdNuIzl xMAA== X-Gm-Message-State: ALoCoQmZsVXT1W7ocfLeGFsrkN4cQffkUdGdii9kczhVmTR3XqJ2q8MTDKA3PIxXBcjgvfFYJg/J MIME-Version: 1.0 X-Received: by 10.205.43.73 with SMTP id ub9mr1801823bkb.91.1389734609987; Tue, 14 Jan 2014 13:23:29 -0800 (PST) Received: by 10.205.89.10 with HTTP; Tue, 14 Jan 2014 13:23:29 -0800 (PST) In-Reply-To: References: Date: Tue, 14 Jan 2014 16:23:29 -0500 Message-ID: Subject: Re: How to build qpid with proton v0.5, boost v1.55.0 statically on fedora19 From: "Shearer, Davin" To: "users@qpid.apache.org" Content-Type: multipart/alternative; boundary=bcaec529960dc309c404eff4cd19 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec529960dc309c404eff4cd19 Content-Type: text/plain; charset=UTF-8 $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 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 --bcaec529960dc309c404eff4cd19--