Обсуждение: [pgagent] patch: link with -pthread

Поиск
Список
Период
Сортировка

[pgagent] patch: link with -pthread

От
Christoph Berg
Дата:
All non-x868 architectures need -pthread to link with threads:

https://buildd.debian.org/status/logs.php?pkg=pgagent&ver=4.0.0-1&suite=sid

This patch fixes the problem:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,7 @@ ENDIF(WIN32)

 ADD_EXECUTABLE(pgagent ${_srcs})
 TARGET_LINK_LIBRARIES(
-        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES}
+        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread
 )

 # Installation


Christoph


Re: [pgagent] patch: link with -pthread

От
Dave Page
Дата:
Hi

On Fri, Jul 20, 2018 at 9:55 AM, Christoph Berg <myon@debian.org> wrote:
All non-x868 architectures need -pthread to link with threads:

https://buildd.debian.org/status/logs.php?pkg=pgagent&ver=4.0.0-1&suite=sid

This patch fixes the problem:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,7 @@ ENDIF(WIN32)

 ADD_EXECUTABLE(pgagent ${_srcs})
 TARGET_LINK_LIBRARIES(
-        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES}
+        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread
 )

 # Installation

That throws a nice warning on macOS (unused-command-line-argument) as I suspected it might. I'll bet Windows barfs on it too.

Neel, can you look and see what is the best solution here please? I'm guessing you still have build environments for all platforms from the Boost work you did.

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgagent] patch: link with -pthread

От
Neel Patel
Дата:
Hi Dave,

Sure. 
I can see below warning during linking in windows.


1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>  Checking Build System
1>  CMake does not need to re-run because C:/Projects/pgagent/build/CMakeFiles/generate.stamp is up-to-date.
1>  CMake does not need to re-run because C:/Projects/pgagent/build/pgaevent/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: pgagent, Configuration: Debug Win32 ------
2>  Building Custom Rule C:/Projects/pgagent/CMakeLists.txt
2>  CMake does not need to re-run because C:/Projects/pgagent/build/CMakeFiles/generate.stamp is up-to-date.
2>  connection.cpp
2>  job.cpp
2>  misc.cpp
2>C:\Projects\pgagent\misc.cpp(172): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
2>  pgAgent.cpp
2>  precomp.cpp
2>  unix.cpp
2>  win32.cpp
2>  Generating Code...
2>LINK : warning LNK4044: unrecognized option '/pthread'; ignored
2>  pgagent.vcxproj -> C:\Projects\pgagent\build\Debug\pgagent.exe
2>  pgagent.vcxproj -> C:/Projects/pgagent/build/Debug/pgagent.pdb (Full PDB)
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Is this only required in case of linux right ? I can work on this - Should we skip linking in case of Mac and windows ?

Thanks
Neel Patel


On Fri, Jul 20, 2018 at 2:36 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Jul 20, 2018 at 9:55 AM, Christoph Berg <myon@debian.org> wrote:
All non-x868 architectures need -pthread to link with threads:

https://buildd.debian.org/status/logs.php?pkg=pgagent&ver=4.0.0-1&suite=sid

This patch fixes the problem:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,7 @@ ENDIF(WIN32)

 ADD_EXECUTABLE(pgagent ${_srcs})
 TARGET_LINK_LIBRARIES(
-        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES}
+        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread
 )

 # Installation

That throws a nice warning on macOS (unused-command-line-argument) as I suspected it might. I'll bet Windows barfs on it too.

Neel, can you look and see what is the best solution here please? I'm guessing you still have build environments for all platforms from the Boost work you did.

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgagent] patch: link with -pthread

От
Dave Page
Дата:


On Fri, Jul 20, 2018 at 11:00 AM, Neel Patel <neel.patel@enterprisedb.com> wrote:
Hi Dave,

Sure. 
I can see below warning during linking in windows.


1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>  Checking Build System
1>  CMake does not need to re-run because C:/Projects/pgagent/build/CMakeFiles/generate.stamp is up-to-date.
1>  CMake does not need to re-run because C:/Projects/pgagent/build/pgaevent/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: pgagent, Configuration: Debug Win32 ------
2>  Building Custom Rule C:/Projects/pgagent/CMakeLists.txt
2>  CMake does not need to re-run because C:/Projects/pgagent/build/CMakeFiles/generate.stamp is up-to-date.
2>  connection.cpp
2>  job.cpp
2>  misc.cpp
2>C:\Projects\pgagent\misc.cpp(172): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
2>  pgAgent.cpp
2>  precomp.cpp
2>  unix.cpp
2>  win32.cpp
2>  Generating Code...
2>LINK : warning LNK4044: unrecognized option '/pthread'; ignored
2>  pgagent.vcxproj -> C:\Projects\pgagent\build\Debug\pgagent.exe
2>  pgagent.vcxproj -> C:/Projects/pgagent/build/Debug/pgagent.pdb (Full PDB)
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Is this only required in case of linux right ? I can work on this - Should we skip linking in case of Mac and windows ?

Yes, at minimum I suspect. Does it complain if it's there on x86 Linux? Christoph said he needed it on non-x86 archs.
 

Thanks
Neel Patel


On Fri, Jul 20, 2018 at 2:36 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Jul 20, 2018 at 9:55 AM, Christoph Berg <myon@debian.org> wrote:
All non-x868 architectures need -pthread to link with threads:

https://buildd.debian.org/status/logs.php?pkg=pgagent&ver=4.0.0-1&suite=sid

This patch fixes the problem:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,7 @@ ENDIF(WIN32)

 ADD_EXECUTABLE(pgagent ${_srcs})
 TARGET_LINK_LIBRARIES(
-        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES}
+        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread
 )

 # Installation

That throws a nice warning on macOS (unused-command-line-argument) as I suspected it might. I'll bet Windows barfs on it too.

Neel, can you look and see what is the best solution here please? I'm guessing you still have build environments for all platforms from the Boost work you did.

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgagent] patch: link with -pthread

От
Christoph Berg
Дата:
Re: Dave Page 2018-07-20 <CA+OCxoxf5u3Ovf5yahei2RG-MA3C9jQLQ5vZ3q=isG5-Upf7Mg@mail.gmail.com>
> Yes, at minimum I suspect. Does it complain if it's there on x86 Linux?
> Christoph said he needed it on non-x86 archs.

It's needed on non-x86 Linux, but does not complain on x86 (and I
think it's good style to use it there as well).

Christoph


Re: [pgagent] patch: link with -pthread

От
Dave Page
Дата:


On Fri, Jul 20, 2018 at 11:12 AM, Christoph Berg <myon@debian.org> wrote:
Re: Dave Page 2018-07-20 <CA+OCxoxf5u3Ovf5yahei2RG-MA3C9jQLQ5vZ3q=isG5-Upf7Mg@mail.gmail.com>
> Yes, at minimum I suspect. Does it complain if it's there on x86 Linux?
> Christoph said he needed it on non-x86 archs.

It's needed on non-x86 Linux, but does not complain on x86 (and I
think it's good style to use it there as well).

Fair point. Thanks.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgagent] patch: link with -pthread

От
Neel Patel
Дата:
Hi Dave,

Please find updated patch where we have linked "-pthread" library with x86 and non-x86 linux.
Do review it and let us know for comments.

Thanks,
Neel Patel

On Fri, Jul 20, 2018 at 4:03 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, Jul 20, 2018 at 11:12 AM, Christoph Berg <myon@debian.org> wrote:
Re: Dave Page 2018-07-20 <CA+OCxoxf5u3Ovf5yahei2RG-MA3C9jQLQ5vZ3q=isG5-Upf7Mg@mail.gmail.com>
> Yes, at minimum I suspect. Does it complain if it's there on x86 Linux?
> Christoph said he needed it on non-x86 archs.

It's needed on non-x86 Linux, but does not complain on x86 (and I
think it's good style to use it there as well).

Fair point. Thanks.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

Re: [pgagent] patch: link with -pthread

От
Dave Page
Дата:
Thanks - looks good to me. Pushed to git.

On Fri, Jul 20, 2018 at 1:06 PM, Neel Patel <neel.patel@enterprisedb.com> wrote:
Hi Dave,

Please find updated patch where we have linked "-pthread" library with x86 and non-x86 linux.
Do review it and let us know for comments.

Thanks,
Neel Patel

On Fri, Jul 20, 2018 at 4:03 PM, Dave Page <dpage@pgadmin.org> wrote:


On Fri, Jul 20, 2018 at 11:12 AM, Christoph Berg <myon@debian.org> wrote:
Re: Dave Page 2018-07-20 <CA+OCxoxf5u3Ovf5yahei2RG-MA3C9jQLQ5vZ3q=isG5-Upf7Mg@mail.gmail.com>
> Yes, at minimum I suspect. Does it complain if it's there on x86 Linux?
> Christoph said he needed it on non-x86 archs.

It's needed on non-x86 Linux, but does not complain on x86 (and I
think it's good style to use it there as well).

Fair point. Thanks.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company