It has nothing to do with boost. You're compiling pgagent, and while compiling pgagent you get the following rather clear message:

#   error "Compiler threading support is not turned on. Please set the
correct command line options for threading: -pthread (Linux), -pthreads
(Solaris) or -mthreads (Mingw32)"

Thus you need to figure out how to add "-pthreads" to compile options in cmake config of pgagent.

-- Stian


From: Boost-users <boost-users-bounces@lists.boost.org> on behalf of Dechaux Eric CEN (BCQ STIG) via Boost-users <boost-users@lists.boost.org>
Sent: Thursday, January 3, 2019 2:41:54 PM
To: boost-users@lists.boost.org
Cc: Dechaux Eric CEN (BCQ STIG)
Subject: [Boost-users] New user : Help on Solaris
 
Hello everyone,

I am a Solaris user and need to build pgAgent 4.0 on a Solaris 11.4
X86_64 box. pgAgent require boost withthreading.

I have build boost 1.69 with no issue :

sol114:/tmp/build/boost_1_69_0$ ./b2 threading=multi -d+2 -a
Performing configuration checks

     - default address-model    : 64-bit
     - default architecture     : x86

Building the Boost C++ Libraries.


     - C++11 mutex              : yes
     - lockfree boost::atomic_flag : yes
     - Boost.Config Feature Check: cxx11_auto_declarations : yes
     - Boost.Config Feature Check: cxx11_constexpr : yes
     - Boost.Config Feature Check: cxx11_defaulted_functions : yes
     - Boost.Config Feature Check: cxx11_final : yes
     - Boost.Config Feature Check: cxx11_hdr_mutex : yes
     - Boost.Config Feature Check: cxx11_hdr_tuple : yes
     - Boost.Config Feature Check: cxx11_lambdas : yes
     - Boost.Config Feature Check: cxx11_noexcept : yes
     - Boost.Config Feature Check: cxx11_nullptr : yes
     - Boost.Config Feature Check: cxx11_rvalue_references : yes
     - Boost.Config Feature Check: cxx11_template_aliases : yes
     - Boost.Config Feature Check: cxx11_thread_local : yes
     - Boost.Config Feature Check: cxx11_variadic_templates : yes
     - has_icu builds           : yes
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
     - zlib                     : yes
     - bzip2                    : yes
     - lzma                     : yes
     - zstd                     : no
     - icu                      : yes
warning: non-free usage requirements <runtime-link>shared ignored
warning: in main-target build_options at libs/locale/build/Jamfile.v2:414
warning: non-free usage requirements <runtime-link>shared ignored
warning: in main-target build_flags at libs/locale/build/Jamfile.v2:415
     - xopen-source-600-supported : yes
     - native-atomic-int32-supported : yes
     - native-syslog-supported  : yes
     - pthread-supports-robust-mutexes : yes
     - compiler-supports-ssse3  : yes
     - compiler-supports-avx2   : yes
     - gcc visibility           : yes
     - long double support      : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
     - libbacktrace builds      : no
     - addr2line builds         : yes
     - WinDbg builds            : no
     - WinDbgCached builds      : no
     - BOOST_COMP_GNUC >= 4.3.0 : no
     - zlib                     : yes
     - bzip2                    : yes
     - lzma                     : yes
     - zstd                     : no

Component configuration:

     - atomic                   : building
     - chrono                   : building
     - container                : building
     - context                  : building
     - contract                 : building
     - coroutine                : building
     - date_time                : building
     - exception                : building
     - fiber                    : building
     - filesystem               : building
     - graph                    : building
     - graph_parallel           : building
     - iostreams                : building
     - locale                   : building
     - log                      : building
     - math                     : building
     - mpi                      : building
     - program_options          : building
     - python                   : building
     - random                   : building
     - regex                    : building
     - serialization            : building
     - stacktrace               : building
     - system                   : building
     - test                     : building
     - thread                   : building
     - timer                    : building
     - type_erasure             : building
     - wave                     : building

[...]

     "g++"   -fvisibility-inlines-hidden -fPIC -m64 -pthreads -O3
-finline-functions -Wno-inline -w -fvisibility=hidden 
-DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DNDEBUG  -I"." -c -o
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/cpplexer/re2clex/cpp_re.o"
"libs/wave/src/cpplexer/re2clex/cpp_re.cpp"

gcc.link.dll
bin.v2/libs/wave/build/gcc-7.3.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_wave.so.1.69.0

     "g++"
-L"/tmp/build/boost_1_69_0/bin.v2/libs/chrono/build/gcc-7.3.0/release/threading-multi/visibility-hidden"
-L"/tmp/build/boost_1_69_0/bin.v2/libs/date_time/build/gcc-7.3.0/release/threading-multi/visibility-hidden"
-L"/tmp/build/boost_1_69_0/bin.v2/libs/filesystem/build/gcc-7.3.0/release/threading-multi/visibility-hidden"
-L"/tmp/build/boost_1_69_0/bin.v2/libs/system/build/gcc-7.3.0/release/threading-multi/visibility-hidden"
-L"/tmp/build/boost_1_69_0/bin.v2/libs/thread/build/gcc-7.3.0/release/threadapi-pthread/threading-multi/visibility-hidden"
-o
"bin.v2/libs/wave/build/gcc-7.3.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_wave.so.1.69.0"
-shared
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_cpp_exprgrammar.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_cpp_grammar.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_cpp_literalgrs.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_defined_grammar.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_predef_macros.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_re2c_lexer.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/instantiate_re2c_lexer_str.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/token_ids.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/wave_config_constant.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/cpplexer/re2clex/aq.o"
"bin.v2/libs/wave/build/gcc-7.3.0/release/threading-multi/visibility-hidden/cpplexer/re2clex/cpp_re.o"
"bin.v2/libs/filesystem/build/gcc-7.3.0/release/threading-multi/visibility-hidden/libboost_filesystem.so.1.69.0"
"bin.v2/libs/thread/build/gcc-7.3.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_thread.so.1.69.0"
"bin.v2/libs/date_time/build/gcc-7.3.0/release/threading-multi/visibility-hidden/libboost_date_time.so.1.69.0"
"bin.v2/libs/chrono/build/gcc-7.3.0/release/threading-multi/visibility-hidden/libboost_chrono.so.1.69.0"
"bin.v2/libs/system/build/gcc-7.3.0/release/threading-multi/visibility-hidden/libboost_system.so.1.69.0"
-lrt  -fPIC -m64 -pthreads -fvisibility=hidden
-fvisibility-inlines-hidden -mimpure-text

common.copy stage/lib/libboost_wave.so.1.69.0

     cp
"bin.v2/libs/wave/build/gcc-7.3.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_wave.so.1.69.0"
"stage/lib/libboost_wave.so.1.69.0"

ln-UNIX stage/lib/libboost_wave.so

     ln -f -s 'libboost_wave.so.1.69.0' 'stage/lib/libboost_wave.so'



The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

     /tmp/build/boost_1_69_0

The following directory should be added to linker library paths:

     /tmp/build/boost_1_69_0/stage/lib


However, when I try to build pgAgent 4.0 I have the following errors :


sol114:/tmp/build/pgAgent-4.0.0-Source$ make
CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


CMake Warning at cmake/FindBoost.cmake:839 (message):
   New Boost version may have incorrect or missing dependencies and imported
   targets
Call Stack (most recent call first):
   cmake/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
   cmake/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:112 (FIND_PACKAGE)


-- Boost version: 1.69.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   date_time
--   thread
--   system
--   chrono
--   atomic
--
--
================================================================================
-- Configuration summary:
--
--   Project                     : pgagent
--   Description                 : pgAgent is a job scheduling engine
for PostgreSQL
--   Version                     : 4.0.0
--
--   PostgreSQL version string   : PostgreSQL 10.6
--   PostgreSQL version parts    : 10
--   PostgreSQL path             : /appli/11.4.4.4.0-20181220-10.6
--   PostgreSQL config binary    :
/appli/11.4.4.4.0-20181220-10.6/bin/pg_config
--   PostgreSQL include path     : /appli/11.4.4.4.0-20181220-10.6/include
--   PostgreSQL library path     : /appli/11.4.4.4.0-20181220-10.6/lib
--   PostgreSQL share path       :
/appli/11.4.4.4.0-20181220-10.6/share/postgresql
--
--   Boost version               : 1.69.0
--   Boost path                  : /tmp/build/boost_1_69_0
--   Boost include directory     : /tmp/build/boost_1_69_0
--   Boost library directory     : /tmp/build/boost_1_69_0/stage/lib
--   Boost Static linking        : NO
--
================================================================================
--
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build/pgAgent-4.0.0-Source
[ 11%] Built target run
[ 22%] Building CXX object CMakeFiles/pgagent.dir/connection.cpp.o
In file included from
/tmp/build/boost_1_69_0/boost/thread/detail/platform.hpp:17:0,
                  from /tmp/build/boost_1_69_0/boost/thread/mutex.hpp:12,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:22,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/config/requires_threads.hpp:47:5: error:
#error "Compiler threading support is not turned on. Please set the
correct command line options for threading: -pthread (Linux), -pthreads
(Solaris) or -mthreads (Mingw32)"
  #   error "Compiler threading support is not turned on. Please set the
correct command line options for threading: -pthread (Linux), -pthreads
(Solaris) or -mthreads (Mingw32)"
      ^~~~~
In file included from /tmp/build/boost_1_69_0/boost/thread/mutex.hpp:12:0,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:22,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/detail/platform.hpp:71:9: error:
#error "Sorry, no boost threads are available for this platform."
  #       error "Sorry, no boost threads are available for this platform."
          ^~~~~
In file included from
/tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:22:0,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/mutex.hpp:18:2: error: #error
"Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from /tmp/build/boost_1_69_0/boost/thread/thread.hpp:12:0,
                  from /tmp/build/boost_1_69_0/boost/thread.hpp:13,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/thread_only.hpp:19:2: error: #error
"Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from
/tmp/build/boost_1_69_0/boost/thread/detail/thread.hpp:21:0,
                  from
/tmp/build/boost_1_69_0/boost/thread/thread_only.hpp:22,
                  from /tmp/build/boost_1_69_0/boost/thread/thread.hpp:12,
                  from /tmp/build/boost_1_69_0/boost/thread.hpp:13,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/detail/thread_heap_alloc.hpp:19:2:
error: #error "Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from
/tmp/build/boost_1_69_0/boost/thread/thread_only.hpp:26:0,
                  from /tmp/build/boost_1_69_0/boost/thread/thread.hpp:12,
                  from /tmp/build/boost_1_69_0/boost/thread.hpp:13,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/condition_variable.hpp:18:2: error:
#error "Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from
/tmp/build/boost_1_69_0/boost/thread/detail/thread_group.hpp:10:0,
                  from /tmp/build/boost_1_69_0/boost/thread/thread.hpp:13,
                  from /tmp/build/boost_1_69_0/boost/thread.hpp:13,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/shared_mutex.hpp:31:2: error:
#error "Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from /tmp/build/boost_1_69_0/boost/thread.hpp:17:0,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/once.hpp:31:2: error: #error "Boost
threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~
In file included from /tmp/build/boost_1_69_0/boost/thread.hpp:18:0,
                  from /tmp/build/pgAgent-4.0.0-Source/include/job.h:16,
                  from /tmp/build/pgAgent-4.0.0-Source/include/pgAgent.h:37,
                  from /tmp/build/pgAgent-4.0.0-Source/connection.cpp:12:
/tmp/build/boost_1_69_0/boost/thread/recursive_mutex.hpp:18:2: error:
#error "Boost threads unavailable on this platform"
  #error "Boost threads unavailable on this platform"
   ^~~~~


I have no idea why the boost headers won't find the availability of
threads as it has built fine with pthread :
$ ldd /tmp/build/boost_1_69_0/stage/lib/libboost_system.so.1.69.0
         libstdc++.so.6 =>        /usr/lib/64/libstdc++.so.6
         libm.so.2 =>     /lib/64/libm.so.2
         librt.so.1 =>    /lib/64/librt.so.1
         libgcc_s.so.1 =>         /usr/lib/64/libgcc_s.so.1
         libpthread.so.1 =>       /lib/64/libpthread.so.1
         libc.so.1 =>     /lib/64/libc.so.1


Can anybody help me ?


Best regards
--
Eric