public inbox for [email protected]help / color / mirror / Atom feed
RE: Windows meson build 5+ messages / 2 participants [nested] [flat]
* RE: Windows meson build @ 2025-01-06 09:57 Kohei Harikae (Fujitsu) <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Kohei Harikae (Fujitsu) @ 2025-01-06 09:57 UTC (permalink / raw) To: 'Vladlen Popolitov' <[email protected]>; +Cc: 'Andres Freund' <[email protected]>; '[email protected]' <[email protected]> Hi, > I think in the phrase: > "add the directory where the .pc file resides to PKG_CONFIG_PATH." > better to add wording, that PKG_CONFIG_PATH is the list of directories > separated by PATH separator ( ; in Windows, : in POSIX). Otherwise the > reader has to search additional information about this variable in > meson documentation. Thank you for your advice. I added the description of PATH separator based on your advice. > I think, it is better to add the other options how to configure external > libraries, if they do not have .pc file: > add meson options defined by PostgreSQL for its configuration (gettext > library example) > > -Dextra_include_dirs=c:\postgres\gettext\x64-windows\include,c:\otherlibs\include > -Dextra_lib_dirs=c:\postgres\gettext\x64-windows\lib,c:\otherlibs\lib > > extra_include_dirs and extra_lib_dirs are options defined by PostgreSQL. > This options are > comma separated lists of directories, if every value does not contain > comma itself. - 0001 icu - 0002 libxml - 0003 libxslt - 0004 lz4 - 0005 tcl - 0006 zlib - 0007 zstd These libraries could not be built by setting extra_include_dirs and extra_lib_dirs. These libraries may not have .pc file created. For example, if I use msc (Visual Studio) to build zLib, zlib.pc is not created. Could you tell me which libraries can use this option? Regards, Kohei Harikae Attachments: [application/octet-stream] installation-meson.patch (2.9K, 2-installation-meson.patch) download | inline diff: diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index ebdb5b3bc2d..cecf02fa5e5 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -2463,12 +2463,7 @@ ninja install <listitem> <para> Build with support for GSSAPI authentication. MIT Kerberos is required - to be installed for GSSAPI. On many systems, the GSSAPI system (a part - of the MIT Kerberos installation) is not installed in a location - that is searched by default (e.g., <filename>/usr/include</filename>, - <filename>/usr/lib</filename>). In - those cases, PostgreSQL will query <command>pkg-config</command> to - detect the required compiler and linker options. Defaults to auto. + to be installed for GSSAPI. Defaults to auto. <filename>meson configure</filename> will check for the required header files and libraries to make sure that your GSSAPI installation is sufficient before proceeding. @@ -2589,12 +2584,6 @@ ninja install Build with libxml2, enabling SQL/XML support. Defaults to auto. Libxml2 version 2.6.23 or later is required for this feature. </para> - - <para> - To use a libxml2 installation that is in an unusual location, you - can set <command>pkg-config</command>-related environment - variables (see its documentation). - </para> </listitem> </varlistentry> @@ -3174,6 +3163,45 @@ ninja install &targets-meson; </sect2> + <sect2 id="use-unusual-location-libraries-meson"> + <title>Steps to use libraries installed in an unusual location</title> + + <para> + PostgreSQL will query pkg-config to detect the required compiler and linker options. + To use modules installed in an unusual location, set pkg-config-related + environment variables (see its documentation). For example, if you want to add + the library to the PostgreSQL build, add the directory where the .pc file resides + to PKG_CONFIG_PATH. + + Sample procedures to include libraries for PostgreSQL build are as follows: + </para> + + <procedure> + <step id="sample-build-library"> + <title>Building and Installation library</title> + <para> + Check the path where the .pc file (e.g.libxml-2.0.pc) is created. + </para> + </step> + <step id="sample-add-PKG_CONFIG_PATH"> + <title>Add path to .pc directory to PKG_CONFIG_PATH</title> + <para> + PKG_CONFIG_PATH is the list of directories separated by PATH separator + ( ; in Windows, : in Unix). + </para> + </step> + <step id="sample-build-meson"> + <title>Building and Installation PostgreSQL with Meson</title> + <para> +<screen> +<userinput>meson setup build</userinput> +</screen> + </para> + </step> + </procedure> + + </sect2> + </sect1> <sect1 id="install-post"> ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Windows meson build @ 2025-01-09 11:03 Vladlen Popolitov <[email protected]> parent: Kohei Harikae (Fujitsu) <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Vladlen Popolitov @ 2025-01-09 11:03 UTC (permalink / raw) To: Kohei Harikae (Fujitsu) <[email protected]>; +Cc: 'Andres Freund' <[email protected]>; '[email protected]' <[email protected]> Kohei Harikae (Fujitsu) писал(а) 2025-01-06 16:57: > Hi, > > - 0001 icu > - 0002 libxml > - 0003 libxslt > - 0004 lz4 > - 0005 tcl > - 0006 zlib > - 0007 zstd > These libraries could not be built by setting extra_include_dirs and > extra_lib_dirs. > These libraries may not have .pc file created. > For example, if I use msc (Visual Studio) to build zLib, zlib.pc is not > created. > Could you tell me which libraries can use this option? > > Regards, > Kohei Harikae Hi! I don't have my Windows PC near me just now, I take information from my memory regarding these libraries. I use Windows package manager vcpkg to build these libraries, and vcpkg uses msvc (Visual Studio). As I remember, icu, libxml2, libxslt build by vcpkg have .pc file. Really pc file is easy to create by hands the text file with a) product name and version b) relative (from .pc file location) path to libs c) relative path to includes Libraries with .pc file can be listed in environment variable PKG_CONFIG_PATH. gettext does not have pc file, and lib and include location must be included in extra_include_dirs and extra_lib_dirs options, that are PostgreSQL options in meson (not meson itself options) added for libraries without .pc file. Steps to build PostgreSQL under Windsows using meson and vcpkg 1) create build.cmd for all commands 2) install vcpkg to any location (except network drive, it has problems with it. Hard drive C: is OK) 3) install all libraries: vcpkg install libxml2 etc... 4) look for all libraries lib/pkgconf library and find .pc file. All pc file paths add to SET PKG_CONFIG_PATH=... in build.cmd 5) all libraries without pc file - add to -Dextra_include_dirs= and -Dextra_lib_dirs for meson command, that prepares the build directory - add it to build.cmd 6) add in the beginning build.cmd this or correct path for your system call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 7) run build.cmd This library configuration should work. I recommend install libraries to special location for every build version to control exact location and library version. vcpkg has options for library version and install directory. -- Best regards, Vladlen Popolitov. ^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: Windows meson build @ 2025-01-10 09:43 Kohei Harikae (Fujitsu) <[email protected]> parent: Vladlen Popolitov <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Kohei Harikae (Fujitsu) @ 2025-01-10 09:43 UTC (permalink / raw) To: 'Vladlen Popolitov' <[email protected]>; +Cc: 'Andres Freund' <[email protected]>; '[email protected]' <[email protected]> Hi, Thank you for your advice. Based on your advice, I have added a description of the vcpkg and -Dextra_include_dirs options. How do you think about this? Regards, Kohei Harikae Attachments: [application/octet-stream] installation-meson.patch (3.1K, 2-installation-meson.patch) download | inline diff: diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index ebdb5b3bc2d..523dba03b5b 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -2463,12 +2463,7 @@ ninja install <listitem> <para> Build with support for GSSAPI authentication. MIT Kerberos is required - to be installed for GSSAPI. On many systems, the GSSAPI system (a part - of the MIT Kerberos installation) is not installed in a location - that is searched by default (e.g., <filename>/usr/include</filename>, - <filename>/usr/lib</filename>). In - those cases, PostgreSQL will query <command>pkg-config</command> to - detect the required compiler and linker options. Defaults to auto. + to be installed for GSSAPI. Defaults to auto. <filename>meson configure</filename> will check for the required header files and libraries to make sure that your GSSAPI installation is sufficient before proceeding. @@ -2589,12 +2584,6 @@ ninja install Build with libxml2, enabling SQL/XML support. Defaults to auto. Libxml2 version 2.6.23 or later is required for this feature. </para> - - <para> - To use a libxml2 installation that is in an unusual location, you - can set <command>pkg-config</command>-related environment - variables (see its documentation). - </para> </listitem> </varlistentry> @@ -3174,6 +3163,50 @@ ninja install &targets-meson; </sect2> + <sect2 id="use-unusual-location-libraries-meson"> + <title>Steps to use libraries installed in an unusual location</title> + + <para> + PostgreSQL will query pkg-config to detect the required compiler and linker options. + To use modules installed in an unusual location, set pkg-config-related + environment variables (see its documentation). For example, if you want to add + the library to the PostgreSQL build, add the directory where the .pc file resides + to PKG_CONFIG_PATH. + + Sample procedures to include libraries for PostgreSQL build are as follows: + </para> + + <procedure> + <step id="sample-build-library"> + <title>Building and Installation library</title> + <para> + Check the path where the .pc file (e.g.libxml-2.0.pc) is created. + Many libraries create the .pc files when built using vcpkg. + You might want to create the .pc file manually. + </para> + </step> + <step id="sample-add-PKG_CONFIG_PATH"> + <title>Add path to .pc directory to PKG_CONFIG_PATH</title> + <para> + PKG_CONFIG_PATH is the list of directories separated by PATH separator + ( ; in Windows, : in Unix). + </para> + </step> + <step id="sample-build-meson"> + <title>Building and Installation PostgreSQL with Meson</title> + <para> +<screen> +<userinput>meson setup build</userinput> +</screen> + For some libraries (e.g. .pc file not created gettext), + the path can be specified with the + -Dextra_include_dirs, -Dextra_lib_dirs option. + </para> + </step> + </procedure> + + </sect2> + </sect1> <sect1 id="install-post"> ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Windows meson build @ 2025-01-16 09:05 Vladlen Popolitov <[email protected]> parent: Kohei Harikae (Fujitsu) <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Vladlen Popolitov @ 2025-01-16 09:05 UTC (permalink / raw) To: Kohei Harikae (Fujitsu) <[email protected]>; +Cc: 'Andres Freund' <[email protected]>; '[email protected]' <[email protected]> Kohei Harikae (Fujitsu) писал(а) 2025-01-10 16:43: > Hi, > > Thank you for your advice. > Based on your advice, I have added a description of the vcpkg and > -Dextra_include_dirs options. > How do you think about this? > > Regards, > Kohei Harikae Hi, Looks good! If you create commitfest entry, I would make review. -- Best regards, Vladlen Popolitov. ^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: Windows meson build @ 2025-01-24 12:13 Kohei Harikae (Fujitsu) <[email protected]> parent: Vladlen Popolitov <[email protected]> 0 siblings, 0 replies; 5+ messages in thread From: Kohei Harikae (Fujitsu) @ 2025-01-24 12:13 UTC (permalink / raw) To: 'Vladlen Popolitov' <[email protected]>; +Cc: 'Andres Freund' <[email protected]>; '[email protected]' <[email protected]> Hi, My previous patch had whitespace issues. I recreated the patch. I will create a commitfest with this patch. Regards, Kohei Harikae Attachments: [application/octet-stream] installation-meson.patch (3.1K, 2-installation-meson.patch) download | inline diff: diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 271615e4a65..46ad83a7dae 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -2463,12 +2463,7 @@ ninja install <listitem> <para> Build with support for GSSAPI authentication. MIT Kerberos is required - to be installed for GSSAPI. On many systems, the GSSAPI system (a part - of the MIT Kerberos installation) is not installed in a location - that is searched by default (e.g., <filename>/usr/include</filename>, - <filename>/usr/lib</filename>). In - those cases, PostgreSQL will query <command>pkg-config</command> to - detect the required compiler and linker options. Defaults to auto. + to be installed for GSSAPI. Defaults to auto. <filename>meson configure</filename> will check for the required header files and libraries to make sure that your GSSAPI installation is sufficient before proceeding. @@ -2589,12 +2584,6 @@ ninja install Build with libxml2, enabling SQL/XML support. Defaults to auto. Libxml2 version 2.6.23 or later is required for this feature. </para> - - <para> - To use a libxml2 installation that is in an unusual location, you - can set <command>pkg-config</command>-related environment - variables (see its documentation). - </para> </listitem> </varlistentry> @@ -3174,6 +3163,50 @@ ninja install &targets-meson; </sect2> + <sect2 id="use-unusual-location-libraries-meson"> + <title>Steps to use libraries installed in an unusual location</title> + + <para> + PostgreSQL will query pkg-config to detect the required compiler and linker options. + To use modules installed in an unusual location, set pkg-config-related + environment variables (see its documentation). For example, if you want to add + the library to the PostgreSQL build, add the directory where the .pc file resides + to PKG_CONFIG_PATH. + + Sample procedures to include libraries for PostgreSQL build are as follows: + </para> + + <procedure> + <step id="sample-build-library"> + <title>Building and Installation library</title> + <para> + Check the path where the .pc file (e.g.libxml-2.0.pc) is created. + Many libraries create the .pc files when built using vcpkg. + You might want to create the .pc file manually. + </para> + </step> + <step id="sample-add-PKG_CONFIG_PATH"> + <title>Add path to .pc directory to PKG_CONFIG_PATH</title> + <para> + PKG_CONFIG_PATH is the list of directories separated by PATH separator + ( ; in Windows, : in Unix). + </para> + </step> + <step id="sample-build-meson"> + <title>Building and Installation PostgreSQL with Meson</title> + <para> +<screen> +<userinput>meson setup build</userinput> +</screen> + For some libraries (e.g. .pc file not created gettext), + the path can be specified with the + -Dextra_include_dirs, -Dextra_lib_dirs option. + </para> + </step> + </procedure> + + </sect2> + </sect1> <sect1 id="install-post"> ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2025-01-24 12:13 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-01-06 09:57 RE: Windows meson build Kohei Harikae (Fujitsu) <[email protected]> 2025-01-09 11:03 ` Vladlen Popolitov <[email protected]> 2025-01-10 09:43 ` Kohei Harikae (Fujitsu) <[email protected]> 2025-01-16 09:05 ` Vladlen Popolitov <[email protected]> 2025-01-24 12:13 ` Kohei Harikae (Fujitsu) <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox