When I run
pkg-config.exe pangocairo --libs
on the Mingw64 shell I get:
-L/mingw64/lib -LC:/building/msys64/mingw64/lib/../lib -L/mingw64/lib -lpangocairo-1.0 -lpangoft2-1.0
-lpangowin32-1.0 -lgdi32 -lusp10 -l pango-1.0 -lm -lcairo -lz -lgobject-2.0 -lffi -lpixman-1 -lfontconfig -lexpat
-lfreetype -liconv -lexpat -lfreetype -lbz2 -lharfbuzz -lm -lglib-2.0 -lintl -pthread -lws2_32 -lole32 -lwinmm
-lshlwapi -lpcre -lintl -lpcre -lgraphite2 -lpng16 -lz
But if I run cmake using
/c/Program\ Files/CMake/bin/cmake -G "MSYS Makefiles" -DMSYS=1 -DPLD_extcairo=ON -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=/c/msys64/mingw64/ ../
I get
-- No package 'pangocairo' found
-- WARNING: pango and/or cairo not found with pkg-config.
The same is true for pango, pangoft2 and other packages. They exists if I run pkg-config, but are not detected by cmake. Please note that in the cmake output the correct PKG_CONFIG_DIR is displayed.
CMake output:
-- The C compiler identification is GNU 7.2.0
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- CMake version = 3.10.0
-- CMAKE_SYSTEM_NAME = Windows
-- SH_EXECUTABLE = C:/msys64/usr/bin/bash.exe
-- Checking whether system has ANSI C header files
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Performing Test memchrExists
-- Performing Test memchrExists - Success
-- Performing Test freeExists
-- Performing Test freeExists - Success
-- Check for whether ctype.h macros work on characters with the
high bit set.
-- High-bit characters - work
-- ANSI C header files - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file termios.h
-- Looking for include file termios.h - not found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for crt_externs.h
-- Looking for crt_externs.h - not found
-- Performing Test HAVE_SYS_WAIT_H
-- Performing Test HAVE_SYS_WAIT_H - Failed
-- Looking for DIR symbol in sys/types.h;dirent.h
-- Looking for DIR symbol in sys/types.h;dirent.h - found
-- Check for signal return type in <signal.h>
-- Check for signal handler return type type void - found
-- Looking for popen
-- Looking for popen - found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for mkdtemp
-- Looking for mkdtemp - not found
-- Looking for mkfifo
-- Looking for mkfifo - not found
-- Looking for unlink
-- Looking for unlink - found
-- Looking for _NSGetArgc
-- Looking for _NSGetArgc - not found
-- Looking for isfinite
-- Looking for isfinite - found
-- Looking for finite
-- Looking for finite - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for isinf
-- Looking for isinf - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Found SWIG: C:/msys64/mingw64/bin/swig.exe (found version "3.0.12")
-- SWIG_VERSION = 3.0.12
-- Found Perl: C:/msys64/usr/bin/perl.exe (found version "5.24.1")
-- WARNING: Perl module XML::DOM not found
-- The CXX compiler identification is GNU 7.2.0
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for using namespace support
-- Check for using namespace - found
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Check for broken isnan support in <cmath>
-- Check for isnan in <cmath> - found
-- Check for using stdint.h with CXX compiler
-- Check for using stdint.h with CXX compiler - ok
-- Found PkgConfig: C:/msys64/usr/bin/pkg-config.exe (found version "0.29.2")
-- Looking for pkg-config - found
-- cxx_compiler_library_pathname_list = C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/libstdc++.dll.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmingw32.a;C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/libgcc_s.a;C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/libgcc.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmoldname.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmingwex.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libpthread.dll.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libadvapi32.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libshell32.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libuser32.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libkernel32.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmingw32.a;C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/libgcc_s.a;C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/libgcc.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmoldname.a;C:/msys64/mingw64/x86_64-w64-mingw32/lib/libmingwex.a
-- X11_FOUND =
-- X11_INCLUDE_DIR =
-- X11_COMPILE_FLAGS =
-- X11_LIBRARIES =
-- A test cmake run with language = Fortran enabled failed.
-- Specify -DENABLE_compiler_diagnostics=ON to see full CMake diagnostics concerning this failure.
-- WARNING: no working Fortran compiler so disabling fortran binding and examples.
-- A test cmake run with language = Java enabled failed.
-- Specify -DENABLE_compiler_diagnostics=ON to see full CMake diagnostics concerning this failure.
-- WARNING: no working Java compiler so disabling Java binding and examples.
-- Could NOT find PythonInterp: Found unsuitable version "2.7.14", but required is at least "3" (found C:/msys64/mingw64/bin/python.exe)
-- Found PythonInterp: C:/msys64/mingw64/bin/python.exe (found suitable version "2.7.14", minimum required is "2")
-- Found PythonLibs: C:/msys64/mingw64/lib/libpython2.7.dll.a (found version "2.7.14")
-- WARNING: NumPy header not found. Disabling Python binding
-- WARNING: The octave command not found. Disabling Octave binding
-- Start determining consistent system data for Tcl and friends
-- Found Tclsh: C:/msys64/mingw64/bin/tclsh.exe (found version "8.6")
-- Found TCL: C:/msys64/mingw64/lib/libtcl.dll.a
-- Found TCLTK: C:/msys64/mingw64/lib/libtcl.dll.a
-- Found TK: C:/msys64/mingw64/lib/libtk.dll.a
-- Looking for Tcl - found
-- TCL_INCLUDE_PATH = C:/msys64/mingw64/include
-- TCL_LIBRARY = C:/msys64/mingw64/lib/libtcl.dll.a
-- TCL_STUB_LIBRARY = C:/msys64/mingw64/lib/libtclstub86.a
-- TCL_LIBRARY_PATH = C:/msys64/mingw64/lib
-- Looking for tclsh - found
-- TCL_TCLSH = C:/msys64/mingw64/bin/tclsh.exe
-- Looking for Tcl version with tclsh - found
-- PLPLOT_TCL_VERSION = 8.6.7
-- Itcl not available or not compatible with current Tcl shell
-- WARNING: Disabling Itcl interface code
-- Looking for Tk - found
-- TK_INCLUDE_PATH = C:/msys64/mingw64/include
-- TK_LIBRARY = C:/msys64/mingw64/lib/libtk.dll.a
-- TK_STUB_LIBRARY = C:/msys64/mingw64/lib/libtkstub86.a
-- TK_LIBRARY_PATH = C:/msys64/mingw64/lib
-- Looking for wish - found
-- TK_WISH = C:/msys64/mingw64/bin/wish.exe
-- Looking for Tk version with wish - found
-- Tcl and Tk versions found by both tclsh and wish are identical
-- Itk not available or not compatible with current Tcl shell
-- WARNING: Disabling Itk interface code
-- Finished determining consistent system data for Tcl and friends
-- A test cmake run with language = Ada enabled failed.
-- Specify -DENABLE_compiler_diagnostics=ON to see full CMake diagnostics concerning this failure.
-- WARNING: no working Ada compiler so disabling Ada binding and examples.
-- Could NOT find Lua (missing: LUA_EXECUTABLE LUA_VERSION LUA_LIBRARIES LUA_INCLUDE_DIR)
-- WARNING: Lua library and/or header not found. Disabling Lua binding
-- WARNING: SHAPELIB not found. Setting HAVE_SHAPELIB to OFF.
-- Found Freetype: C:/msys64/mingw64/lib/libfreetype.dll.a (found version "2.8.1")
-- FREETYPE_CFLAGS = -IC:/msys64/mingw64/include/freetype2
-- FREETYPE_LIBRARIES = C:/msys64/mingw64/lib/libfreetype.dll.a
-- Check for NaN awareness in C compiler
-- Check for NaN awareness in C compiler - found
-- Neither qhull/qhull_a.h header nor libqhull/qhull_a.h could be found
-- qhull library could not be found
-- Could NOT find QHULL (missing: QHULL_INCLUDE_DIRS QHULL_LIBRARIES QHULL_LIBRARY_DIRS)
-- QHULL_INCLUDE_DIRS =
-- QHULL_LIBRARIES =
-- WARNING: at least one of QHULL_INCLUDE_DIRS or QHULL_LIBRARIES is false so setting PL_HAVE_QHULL to OFF.
-- Checking for module 'pango'
-- No package 'pango' found
-- WARNING: pkg-config does not find pango.
-- Checking for module 'pangoft2'
-- No package 'pangoft2' found
-- WARNING: pkg-config does not find pangoft2.
-- Checking for module 'pangocairo'
-- No package 'pangocairo' found
-- WARNING: pango and/or cairo not found with pkg-config.
Disabling cairo drivers. To enable these drivers you must install
development versions of pango and cairo and/or set
the environment variable PKG_CONFIG_PATH appropriately.
-- WARNING: X11 not found. Therefore turning off tk and tkwin devices that depend on it
-- TKLIB_COMPILE_FLAGS = -I"C:/msys64/mingw64/include"
-- ntk_COMPILE_FLAGS = -I"C:/msys64/mingw64/include" -I"C:/msys64/mingw64/include"
-- ntk_LINK_FLAGS = C:/msys64/mingw64/lib/libtcl.dll.a;C:/msys64/mingw64/lib/libtk.dll.a
-- ntk_RPATH =
-- Checking for modules 'lasi;pango;pangoft2'
-- No package 'lasi' found
-- No package 'pango' found
-- No package 'pangoft2' found
-- WARNING: pango, pangoft2, or lasi not found with pkg-config.
Setting PLD_psttf to OFF. Please install all of these packages
and/or set the environment variable PKG_CONFIG_PATH appropriately.
-- Found unsuitable Qt version "" from NOTFOUND
-- WARNING: Suitable Qt4 development environment not found so trying Qt5 instead.
-- WARNING: Suitable Qt5 development environment not found so disabling qt
-- WARNING: ENABLE_qt is OFF so setting all qt devices to OFF.
-- WARNING: PLPLOT_USE_QT5 is ON so setting ENABLE_pyqt4 to OFF.
-- WARNING: ENABLE_python is OFF so setting ENABLE_pyqt5 to OFF.
-- Looking for gdi32 header and library
-- Looking for gdi32 header and library - found
-- wxWidgets_FOUND : FALSE
-- wxWidgets_INCLUDE_DIRS :
-- wxWidgets_LIBRARIES :
-- wxWidgets_LIBRARY_DIRS :
-- wxWidgets_DEFINITIONS : UNICODE;_UNICODE
-- wxWidgets_DEFINITIONS_DEBUG :
-- WARNING: wxWidgets or its libraries not found so setting all wxwidgets devices to OFF.
-- WARNING: PLD_wxwidgets is OFF so setting ENABLE_wxwidgets to OFF.
-- WARNING: ENABLE_wxwidgets is OFF so setting all wxwidgets devices to OFF.
-- Looking for haru pdf header and library
-- Looking for haru pdf header and library - not found
-- WARNING: Setting PLD_pdf to OFF.
-- WARNING: The ocamlc application not found. Disabling OCaml binding
-- WARNING: ENABLE_ocaml is OFF so disabling Plcairo module and lablgtk2 support
-- WARNING: validate target will not be available to check for syntax issues in the PLplot DocBook documentation because onsgmls (or env) was not found.
-- WARNING: Perl modules XML::Parser and/or XML::DOM not available
so cannot check that swig_documentation.i is up to date.
-- ENABLE_itcl: OFF
-- Itcl libraries: plplot;C:/msys64/mingw64/lib/libtcl.dll.a
-- TEST_ENVIRONMENT = EXAMPLES_DIR=C:/Users/johannes/plplot-5.13.0/build-msys2/examples SRC_EXAMPLES_DIR=C:/Users/johannes/plplot-5.13.0/examples OUTPUT_DIR=C:/Users/johannes/plplot-5.13.0/build-msys2/ctest_examples_output_dir VC_CTEST_DIRECTORY=
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/johannes/plplot-5.13.0/build-msys2
Summary of CMake build system results for PLplot
Install location variables which can be set by the user. N.B. These
variables are ordered by decreasing degree of generality, with the
default values of the later ones in the list determined by the
values of variables earlier in the list. So, for example, it is
usually sufficient in the vast majority of cases to just set
CMAKE_INSTALL_PREFIX, and the rest of these variables are adjusted
accordingly (at least for a fresh configuration), and it is rare
indeed that is is necessary for a user to set any variable here whose
name does not start with "CMAKE_INSTALL_".
CMAKE_INSTALL_PREFIX: C:/msys64/mingw64
CMAKE_INSTALL_EXEC_PREFIX: C:/msys64/mingw64
CMAKE_INSTALL_BINDIR: C:/msys64/mingw64/bin
CMAKE_INSTALL_DATADIR: C:/msys64/mingw64/share
CMAKE_INSTALL_LIBDIR: C:/msys64/mingw64/lib
CMAKE_INSTALL_INCLUDEDIR: C:/msys64/mingw64/include
CMAKE_INSTALL_INFODIR: C:/msys64/mingw64/share/info
CMAKE_INSTALL_MANDIR: C:/msys64/mingw64/share/man
CMAKE_INSTALL_PKG_CONFIG_DIR: C:/msys64/mingw64/lib/pkgconfig
DATA_DIR: C:/msys64/mingw64/share/plplot5.13.0
LIB_DIR: C:/msys64/mingw64/lib
INCLUDE_DIR: C:/msys64/mingw64/include/plplot
BIN_DIR: C:/msys64/mingw64/bin
DRV_DIR: C:/msys64/mingw64/lib/plplot5.13.0/drivers
DOC_DIR: C:/msys64/mingw64/share/doc/plplot
INFO_DIR: C:/msys64/mingw64/share/info
MAN_DIR: C:/msys64/mingw64/share/man
PKG_CONFIG_DIR: C:/msys64/mingw64/lib/pkgconfig
TCL_DIR: C:/msys64/mingw64/share/plplot5.13.0/tcl
Other important CMake variables:
CMAKE_SYSTEM_NAME: Windows
UNIX:
WIN32: 1
APPLE:
MSVC: (MSVC_VERSION: )
MINGW: 1
MSYS: 1
CYGWIN:
BORLAND:
WATCOM:
SWIG_FOUND: TRUE
PERL_FOUND: TRUE
X11_FOUND:
CMAKE_BUILD_TYPE:
CMAKE_C_COMPILER CMAKE_C_FLAGS: C:/msys64/mingw64/bin/gcc.exe
CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS: C:/msys64/mingw64/bin/g++.exe
ENABLE_DYNDRIVERS: ON
DRIVERS_LIST: mem;ntk;null;ps;svg;wingcc;xfig
DEVICES_LIST: mem;ntk;null;ps;svg;wingcc;xfig
Library options:
BUILD_SHARED_LIBS: ON PL_DOUBLE: ON
Optional libraries:
PL_HAVE_QHULL: OFF WITH_CSA: ON
PL_HAVE_FREETYPE: ON PL_HAVE_PTHREAD:
HAVE_AGG: HAVE_SHAPELIB: OFF
Language Bindings:
ENABLE_ada: OFF
ENABLE_cxx: ON
ENABLE_d: OFF
ENABLE_fortran: OFF
ENABLE_java: OFF
ENABLE_lua: OFF
ENABLE_ocaml: OFF
ENABLE_octave: OFF
ENABLE_pdl: OFF
ENABLE_python: OFF
ENABLE_qt: OFF
ENABLE_pyqt5: OFF
ENABLE_tcl: ON
ENABLE_itcl: OFF
ENABLE_tk: ON
ENABLE_itk: OFF
ENABLE_wxwidgets: OFF
On 2017-11-24 13:23-0000 firefuzy wrote:
[...]
[...]
I don't have access to MinGW-w64/MSYS2 myself, but Arjen Markus's last
comprehensive test there (see his test results in
https://sourceforge.net/p/plplot/wiki/Testing_PLplot/#Testing%20Reports)
shows none of the above problems with pkg-config. In fact, I have
access to the cmake output results from that test, and when comparing
those with yours above, in his case cmake found the "mingw" version of
pkg-config (located at $prefix/mingw64/bin/pkg-config.exe) while in
your case cmake has found the "msys" version (located above at
$prefix/usr/bin/pkg-config.exe). I am virtually positive that "msys"
version will only find "msys" libraries (if any of that very limited
set of libraries publish pkg-config results) which explains why the
"msys" version of pkg-config had no success at all above. So to fix
this, you have to make sure that cmake finds the "mingw" version of
pkg-config.
I assume Arjen (like you?) built PLplot using the Mingw64 shell. In any
case, from his comprehensive test report of that build, when he looked
at PATH from the bash perspective, i.e.,
printenv |grep PATH
he obtained the following result
PATH="/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/"
Note that /mingw64/bin is higher in the PATH than /usr/bin
(which explains why cmake found the /mingw64/bin version of pkg-config
in his case).
So please insure your PATH (from the bash perspective) also has
/mingw64/bin higher than /usr/bin, and let me know whether
that solves the issue.
Alan
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
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
Related
Bugs: #190
Hi Alan,
for me PATH is:
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Seems to be fine, but it doesn't work that way. I could not find the problem, but it seems to be a problem of cmake and/or msys2.
I finally succeeded to build PLplot by hard-coding the variables in the cmake files of the pango/cairo libraries to the correct values (copy&paste of my pkg-config output)
Regards
firefuzy
On 2017-11-30 17:46-0000 firefuzy wrote:
[out of order]
Good. That means once you have convinced cmake to find and use the
"mingw" version of pkg-config.exe you should be fine. So although you
have a workaround now, I would appreciate you going on for the sake of
other PLplot users of the MinGW-w64/MSYS2 platform so we can advise
them in our wiki (once you figure out what the problem really is) how
to avoid the pkg-config trouble you have encountered.
Well, it is always a possibility that cmake no longer works correctly
on msys2, but it certainly worked correctly relatively recently when
Arjen did his test so I think that explanation is unlikely. So here
are some more likely explanations for why CMake finds the wrong
version of pkg-config for you to consider.
Is the problem that you are working with a stale cached value for the
pkg-config.exe location? That is, after you set the above PATH did
you start over with a fresh build in an initially empty build directory?
Anyhow, make sure you use a fresh build for each of your further tests.
I have just noticed in your original report that you used
"/c/Program\ Files/CMake/bin/cmake". That is likely a CMake version
that you downloaded from Kitware which should work fine for a bare
Windows system such as MSVC, but which is likely not suitable for the
MinGW-w64/MSYS2 platform. Instead, you should install and use cmake from the
mingw side of MinGW-w64/MSYS2. To confirm which version of cmake you
are using, take a look at the CMakeCache.txt file in the build tree
which gives the full path to cmake.exe. I have access to Arjen's
CMakeCache.txt which confirms his successful result was achieved using
$prefix/mingw64/bin/cmake.exe. Note, you should not use
the version of CMake from the msys side of MinGW-w64/MSYS2.
I have just downloaded to my Linux system
http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-cmake-3.9.6-1-any.pkg.tar.xz
(the latest version of CMake from the mingw side of MinGW-w64/MSYS2)
and taken a look at the file mingw64/share/cmake-3.9/Modules/FindPkgConfig.cmake within
that package which controls how pkg-config is found.
That logic (which you can check for youself by looking at the same
file installed as part of this MinGW-w64/MSYS2 cmake package) simply uses
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
to find pkg-config.exe, and if you look up
https://cmake.org/cmake/help/v3.9/command/find_program.html that
logic should simply find /mingw64/bin/pkg-config.exe with the above
PATH set. So I am predicting that is what the result will be once you
install and use the correct version of CMake from the mingw side of
MinGW-w64/MSYS2.
But if not, then I have to ask you are you forcing the wrong choice by
(inadvertently) using one of the other methods detailed in that URL
for affecting how CMake finds executables in general? Or are you
setting either the PKG_CONFIG environment variable or the CMake cache
variable PKG_CONFIG_EXECUTABLE (two other specific methods of
affecting how CMake finds pkg-config according to the documentation in
/mingw64/share/cmake-3.9/Modules/FindPkgConfig.cmake).
Good luck, and let me know how it goes.
Alan
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
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