On 11/23/2011 04:52 PM, Orion Poplawski wrote: > On 11/23/2011 01:06 PM, Alan W. Irwin wrote: >> On 2011-11-23 08:48-0700 Orion Poplawski wrote: >> >>> Don't forget about the pkg-config issue as well. >>> >> >> The pkg-config man page gives the reason why we get transitive linking >> in that case: >> >> Requires: >> This is a comma-separated list of packages that are required by >> your package. Flags from dependent packages will be merged in to >> the flags reported for your package.... >> >> The solution I am investigating for CMake automatically disables >> transitive linking for the shared case but uses transitive linking for >> the static case (which I believe is necessary from the accompanying >> discusssion). So we will want to do the same for the pkg-config >> case. From reading further in the pkg-config man page it appears you >> would get that by replacing the Requires: line in our *.pc files by >> the corresponding Requires.private: line. That is, for plplotd-c++.pc >> change >> >> Requires: plplotd >> ==> >> Requires.private: plplotd >> >> and similarly for our other *.pc files. >> >> Could you try that plplotd-c++.pc change by hand (or by editing >> bindings/c++/CMakeLists.txt) to see if that satisfies your pkg-config >> need for libplplotcxxd while I am working on the other question of >> dropping transitive linking from our CMake-generated linking? > > I'm testing the following change: > > diff -up plplot-5.9.9/pkgcfg/plplot-template.pc.cmake.pkgconfig > plplot-5.9.9/pkgcfg/plplot-template.pc.cmake > --- plplot-5.9.9/pkgcfg/plplot-template.pc.cmake.pkgconfig 2011-10-12 > 18:43:01.000000000 -0600 > +++ plplot-5.9.9/pkgcfg/plplot-template.pc.cmake 2011-11-23 > 16:47:14.627158764 -0700 > @@ -4,7 +4,7 @@ drvdir=@LIB_DIR@/plplot@VERSION@/drivers > > Name: PLplot @PC_SHORT_NAME@ > Description: Scientific plotting library (@PC_LONG_NAME@@PC_PRECISION@ > precision) > -Requires: @PC_REQUIRES@ > +Requires.private: @PC_REQUIRES@ > Version: @VERSION@ > Libs: -L${libdir} @PC_LINK_FLAGS@ > Cflags: -I${includedir} @PC_COMPILE_FLAGS@ > > Which hopefully handles most/all in one swoop. >
Test building the examples with this change I get: /usr/bin/gnatmake -aI/usr/share/ada/adainclude/plplotadad -aL/usr/lib/ada/adalib/plplotadad x15a.adb \ -cargs `PKG_CONFIG_PATH=/usr/lib/pkgconfig pkg-config --cflags plplotd-ada` -largs `PKG_CONFIG_PATH=/usr/lib/pkgconfig pkg-config --libs plplotd-ada` gcc -c -I/usr/share/ada/adainclude/plplotadad -I/usr/include/plplot x15a.adb gnatbind -aI/usr/share/ada/adainclude/plplotadad -aO/usr/lib/ada/adalib/plplotadad -x x15a.ali gnatlink x15a.ali -lplplotadad /usr/bin/ld: ./x15a.o: undefined reference to symbol 'c_plfill' /usr/bin/ld: note: 'c_plfill' is defined in DSO /usr/lib/libplplotd.so.11 so try adding it to the linker command line /usr/lib/libplplotd.so.11: could not read symbols: Invalid operation collect2: ld returned 1 exit status gnatlink: error when calling /usr/bin/gcc gnatmake: *** link failed. So something in the ada bindings can require (but not always) linking against plplotd. Others: /usr/lib/ccache/c++ x17.cc -o x17 `pkg-config --cflags --libs plplotd-c++` /usr/bin/ld: /tmp/ccUpkDBH.o: undefined reference to symbol 'c_plrandd' /usr/bin/ld: note: 'c_plrandd' is defined in DSO /usr/lib/libplplotd.so.11 so try adding it to the linker command line /usr/lib/libplplotd.so.11: could not read symbols: Invalid operation So I think it is probably worth it to keep plplotd in the Requires, but perhaps move the others items out of the plplotd.pc Requires. Here's an odd one: make[1]: Entering directory `/usr/share/plplot5.9.9/examples/f77' /usr/bin/gfortran x01f.f -o x01f `pkg-config --cflags --libs plplotd-f77` x01f.f:29: Error: Can't open included file 'plplot_parameters.h' make[1]: *** [x01f] Error 1 Apparently with gfortran you must explicitly add -I/usr/include. -- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA/CoRA Division FAX: 303-415-9702 3380 Mitchell Lane or...@cora.nwra.com Boulder, CO 80301 http://www.cora.nwra.com ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel