Hi Alan, Günter,

I use the Unix Makefiles generator as that seems to work best on the given 
platform. I will have to check your report against what I have found. Will get 
back to you on this.

Regards,

Arjen

-----Original Message-----
From: Alan W. Irwin <alan.w.irwin1...@gmail.com>
Sent: 04 January 2019 02:00
To: plplot_general <plplot-general@lists.sourceforge.net>; Günter Kanisch 
<guenter.kani...@hanse.net>
Subject: Re: [Plplot-general] PLPLOT-5.14.0: building cairo.dll fails (Windows 
10)

Hi Günter:

I have put my reply to your message on the plplot-general mailing list since 
your remarks and mine will be of interest to subscribers there.
Therefore, if you have not already subscribed to that list you should do so now 
since that is where such support requests are normally addressed.

More below in context.

On 2019-01-03 19:29+0100 Günter Kanisch wrote:

> Dear Alan,
>
> After a longer time having worked with the 32-bit version of plplot
> under Windows, I want to migrate now to the 64-bit executable of my
> Fortran/GTK/plplot program.  The fortran mathematics and the GTK gui
> are already running as an 64-bit executable. However, building now
> plplot-5.14.0 fails with linking the cairo.dll (in the path ..
> drivers/CMakeFiles/cairo.dir) resulting in two error messages: unknown
> reference to 'g_object_unref' .
>
> I am working with MSYS2 (installed under d:\msys64\mingw64 under
> Windows 10); it contains the 64-bitcompilers and GTK and so on, but also 
> mingw32-make.exe.
>
> I tried it for some days now - and could not solve the problem. At
> least, its seems that cmake finds all the correct 64-bit versions of exe and 
> dll files.
>
> I attach a text file containing the console output of the cmake and
> thereafter of the mingw32-make command(s), executed by a small bacth file.
> The cairo-related errors appears at the end of the file. I cannot
> exclude that the two commands (cmake and then mingw32-make) which I
> used are not sufficient for a complete build.
>
> Can you recommend some changes in my build steps which I could try then here?

I have no direct knowledge of the MinGW-w64/MSYS2 platform, but I keep in close 
touch with the PLplot developer Arjen Markus (who will be reading this on the 
plplot-general mailing list) who has had great recent success with the 64-bit 
MinGW-w64/MSYS2 platform.  That is, you will see at 
<https://sourceforge.net/p/plplot/wiki/Testing_Reports/>
that Arjen has achieved almost perfect comprehensive test results with this 
platform in October.  So there is excellent hope you will be able to achieve 
that near-perfection as well with PLplot on this platform.
:-)

I have just looked at the report from that test (which he shared with me), and 
it appears his pango, and cairo CMake find results were similar to the ones you 
have attached, i.e.,

irwin@merlin> grep -Ei 'cairo|pango' 
Arjen.Markus/20181026/MSYS2/shared/noninteractive/output_tree/cmake.out
-- Checking for module 'pango'
--   Found pango, version 1.42.1
-- Checking for module 'pangoft2'
--   Found pangoft2, version 1.42.1
-- Checking for module 'pangocairo'
--   Found pangocairo, version 1.42.1
-- WARNING: X windows not found. Setting xcairo driver to OFF.
-- Checking for modules 'lasi;pango;pangoft2'
-- WARNING: pango, pangoft2, or lasi not found with pkg-config.
-- WARNING: ENABLE_ocaml is OFF so disabling Plcairo module and lablgtk2 support
-- Determine compile and link flags for ext-cairo-test
-- Checking for module 'cairo'
--   Found cairo, version 1.15.12
DRIVERS_LIST: cairo;qt;mem;ntk;null;pdf;ps;svg;wingcc;xfig
DEVICES_LIST: 
memcairo;extcairo;pdfcairo;pngcairo;pscairo;epscairo;svgcairo;wincairo;pdfqt;qtwidget;bmpqt;jpgqt;pngqt;ppmqt;tiffqt;extqt;memqt;svgqt;mem;ntk;null;pdf;ps;psc;svg;wingcc;xfig

irwin@merlin> grep -Ei 'cairo|pango' Günter.Kanisch/20190103/MSYS2/text9.txt
-- Checking for module 'pango'
--   Found pango, version 1.43.0
-- Checking for module 'pangoft2'
--   Found pangoft2, version 1.43.0
-- Checking for module 'pangocairo'
--   Found pangocairo, version 1.43.0
-- WARNING: X windows not found. Setting xcairo driver to OFF.
-- Checking for modules 'lasi;pango;pangoft2'
-- WARNING: pango, pangoft2, or lasi not found with pkg-config.
-- WARNING: ENABLE_ocaml is OFF so disabling Plcairo module and lablgtk2 support
-- Determine compile and link flags for ext-cairo-test
-- Checking for module 'cairo'
--   Found cairo, version 1.16.0
DRIVERS_LIST: cairo;mem;ntk;null;pdf;ps;svg;wingcc;xfig
DEVICES_LIST: 
memcairo;extcairo;pdfcairo;pngcairo;pscairo;epscairo;svgcairo;wincairo;mem;ntk;null;pdf;ps;psc;svg;wingcc;xfig
[...] (I have excluded build results to make yours comparable with Arjen's 
cmake results.)

So it appears you have found slightly newever versions of the same pango and 
cairo libraries found by Arjen so I don't see any issues with your 
configuration.

@Arjen: will you double check that please?

@Günter

However, a possible issue is you have used the "MinGW-Makefiles"
generator.  In theory, that is supposed to work correctly on the
MinGW-w64/MSYS2 platform with mingw32-make, but Arjen has not yet tried testing 
that variant, and it is possible there is some cairo configuration issue or 
even "MinGW-Makefiles" cmake generator issue for that case which is not an 
issue if you use the "Unix Makefiles"
generator with make (that Arjen used for his test as you can see from the wiki 
test report).

Furthermore, here are the differences in the actual cairo build between Arjen 
and you.

Arjen's build result:

[ 13%] Building C object drivers/CMakeFiles/cairo.dir/cairo.c.obj
cd 
D:/plplot-svn/comprehensive_test_disposeable/shared/noninteractive/build_tree/drivers
 && D:/msys64-new/mingw64/bin/cc.exe -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL 
-Dcairo_EXPORTS @CMakeFiles/cairo.dir/includes_C.rsp  -mms-bitfields 
-ID:/msys64-new/mingw64/include/pango-1.0 
-ID:/msys64-new/mingw64/include/fribidi -ID:/msys64-new/mingw64/include/cairo 
-ID:/msys64-new/mingw64/include/pixman-1 -ID:/msys64-new/mingw64/include 
-ID:/msys64-new/mingw64/include/freetype2 -ID:/msys64-new/mingw64/include 
-ID:/msys64-new/mingw64/include/harfbuzz 
-ID:/msys64-new/mingw64/include/glib-2.0 
-ID:/msys64-new/mingw64/lib/glib-2.0/include -ID:/msys64-new/mingw64/include 
-ID:/msys64-new/mingw64/include/libpng16 -ID:/msys64-new/mingw64/include -o 
CMakeFiles/cairo.dir/cairo.c.obj   -c D:/plplot-svn/plplot-git/drivers/cairo.c
[ 13%] Linking C shared module ../dll/cairo.dll cd 
D:/plplot-svn/comprehensive_test_disposeable/shared/noninteractive/build_tree/drivers
 && D:/msys64-new/mingw64/bin/cmake.exe -E remove -f 
CMakeFiles/cairo.dir/objects.a cd 
D:/plplot-svn/comprehensive_test_disposeable/shared/noninteractive/build_tree/drivers
 && D:/msys64-new/mingw64/bin/ar.exe cr CMakeFiles/cairo.dir/objects.a 
@CMakeFiles/cairo.dir/objects1.rsp
cd 
D:/plplot-svn/comprehensive_test_disposeable/shared/noninteractive/build_tree/drivers
 && D:/msys64-new/mingw64/bin/cc.exe    -shared -o ../dll/cairo.dll 
-Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive 
CMakeFiles/cairo.dir/objects.a -Wl,--no-whole-archive 
@CMakeFiles/cairo.dir/linklibs.rsp
make[3]: Leaving directory 
'/d/plplot-svn/comprehensive_test_disposeable/shared/noninteractive/build_tree'
[ 13%] Built target cairo


Your result (from the attached file):

[ 42%] Building C object drivers/CMakeFiles/cairo.dir/cairo.c.obj
cd /d D:\plplot-5.14.0\buildmingw64\drivers && D:\msys64\mingw64\bin\gcc.exe 
-DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dcairo_EXPORTS 
@CMakeFiles/cairo.dir/includes_C.rsp  -mms-bitfields 
-Id:/msys64/mingw64/include/pango-1.0 -Id:/msys64/mingw64/include/fribidi 
-Id:/msys64/mingw64/include -Id:/msys64/mingw64/include/cairo 
-Id:/msys64/mingw64/include -Id:/msys64/mingw64/lib/libffi-3.2.1/include 
-Id:/msys64/mingw64/include/pixman-1 -Id:/msys64/mingw64/include 
-Id:/msys64/mingw64/include/freetype2 -Id:/msys64/mingw64/include 
-Id:/msys64/mingw64/include/harfbuzz -Id:/msys64/mingw64/include/glib-2.0 
-Id:/msys64/mingw64/lib/glib-2.0/include -Id:/msys64/mingw64/include 
-Id:/msys64/mingw64/include/libpng16 -Id:/msys64/mingw64/include -o 
CMakeFiles\cairo.dir\cairo.c.obj   -c D:\plplot-5.14.0\drivers\cairo.c
[ 42%] Linking C shared module ..\dll\cairo.dll cd /d 
D:\plplot-5.14.0\buildmingw64\drivers && D:\msys64\mingw64\bin\cmake.exe -E 
cmake_link_script CMakeFiles\cairo.dir\link.txt --verbose=1 
D:\msys64\mingw64\bin\cmake.exe -E remove -f CMakeFiles\cairo.dir/objects.a 
D:\msys64\mingw64\bin\ar.exe cr CMakeFiles\cairo.dir/objects.a 
@CMakeFiles\cairo.dir\objects1.rsp
D:\msys64\mingw64\bin\gcc.exe    -shared -o ..\dll\cairo.dll 
-Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive 
CMakeFiles\cairo.dir/objects.a -Wl,--no-whole-archive 
@CMakeFiles\cairo.dir\linklibs.rsp
CMakeFiles\cairo.dir/objects.a(cairo.c.obj):cairo.c:(.text+0x1279): undefined 
reference to `g_object_unref'
CMakeFiles\cairo.dir/objects.a(cairo.c.obj):cairo.c:(.text+0x16f4): undefined 
reference to `g_object_unref'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [drivers\CMakeFiles\cairo.dir\build.make:97: 
dll/cairo.dll] Error 1
mingw32-make[2]: Leaving directory 'D:/plplot-5.14.0/buildmingw64'
mingw32-make[1]: *** [CMakeFiles\Makefile2:1733: 
drivers/CMakeFiles/cairo.dir/all] Error 2
mingw32-make[1]: Leaving directory 'D:/plplot-5.14.0/buildmingw64'
mingw32-make: *** [Makefile:154: all] Error 2

So it appears your link step for our cairo device driver is quite different 
from Arjen's.  It's possible these differences are due to Arjen still using 
Windows 7 for his last comprehensive test while you are using Windows 10.  But 
ideally CMake should be able to adjust for those differences.

Anyhow, to get closer to the combination that works well for Arjen, I suggest 
you install the msys/bash and msys/make packages (which includes the Unix-style 
"make" command) from the msys archive and try the "Unix Makefiles" generator 
instead with make (run from a bash command line).

Note, if you want to go back to the "MinGW Makefiles" approach after trying 
"Unix Makefiles" (or the very similar "MSYS Makefiles") then you will have to 
remove the msys/bash package which is incompatible with the "MinGW Makefiles" 
generator without a hack I know (remove the sh.exe copy of bash.exe) to work 
around that issue.

By the way, if you still continue to have cairo linking problems when you 
switch to "Unix Makefiles" generator + msys make, I hope you will be willing to 
send this list a report tarball containing everything we need to know.  This is 
only possible on platforms with bash which is another reason for you to install 
msys/make and msys/bash.

On such platforms the way you create that tarball is simply to run

scripts/comprehensive_testing.sh

For a lot of important details about that script please look at 
<https://sourceforge.net/p/plplot/wiki/Testing_PLplot/>

> By the way: I observed that I do not know the libplplotfortran.dll.
> Does it replace one/some other dlls I have used previously?

libplplotfortran contains our modern Fortran binding for PLplot so it is 
essential for you with PLplot-5.14.0 (and also at least one previous version).  
So I infer you are trying to upgrade from a fairly old version of PLplot.  I 
highly encourage that step because of all the bug fixing and new features 
available with modern PLplot, but it does involve some "upgrade pain" for you.  
But I hope such discussions as these will ease that pain for you.

> Thank you very much in advance - and all the best for a successful new year!

Thanks, and you too.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state implementation for 
stellar interiors (freeeos.sf.net); the Time Ephemerides project 
(timeephem.sf.net); PLplot scientific plotting software package 
(plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux 
Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.

_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to