Re: [hpx-users] list of OS names

2018-08-14 Thread Lars Viklund
I did some work porting HPX to DragonFly BSD last winter, but ended up
not merging it back because of hwloc on DFBSD reporting topologies we
did not expect in HPX.

For reference, my work can be found at:
https://github.com/zao/hpx/commit/9786ac6c58754912f84af243a467a5ab2572d456

Particularly the init_globally example and the counters are a bit
non-trivial.

For RTLD_DI_ORIGIN, I reimplemented it now by something like the
following:

  void* end_sym = dlsym(dll_handle, "_end");
  Dl_info dli;
  dlinfo(end_sym, );
  // dli.dli_fname contains the full path to the library, apply
  // dirname-alike to strip the file component off, as dirname(3) may be
  // mutating or not be reentrant

Note that dlinfo(RTLD_DI_LINKMAP)'s claims to return paths in its
Dl_info* is a lie and cannot be used here, it seems to actually be the
literal contents of the library file.

On Mon, Aug 13, 2018 at 05:40:39PM +0200, Thomas Heller wrote:
> Patrick Welche  schrieb am Mo., 13. Aug. 2018 16:16:
> 
> > On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> > > FWIW, I have merged #3402 just now.
> >
> > Thanks!
> >
> > I have got as far as linking libhpx now - somehow there is a -ldl in
> > link.txt (and in the generated pkg-config .pc files). I have been hunting
> > through the cmake files where it comes from, but haven't found it. Any
> > ideas? (dlopen and friends are in many OS's system library as opposed to
> > libdl.)
> >
> 
> If I'm not mistaken, this might even come out of the inner cmake core
> itself.
> 
> 
> > Cheers,
> >
> > Patrick
> > ___
> > hpx-users mailing list
> > hpx-users@stellar.cct.lsu.edu
> > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
> >

> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


-- 
Lars Viklund | z...@acc.umu.se
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Nikunj Gupta
I've added a patch for the error related to linking with libhpx_wrap. It
should resolve issues relating to it.
If the issue still persists, please let me know.
Patch: https://github.com/STEllAR-GROUP/hpx/pull/3412

Regards
Nikunj Gupta


On Tue, Aug 14, 2018 at 9:35 PM Hartmut Kaiser 
wrote:

>
> > On Tue, Aug 14, 2018 at 08:58:59PM +0530, Nikunj Gupta wrote:
> > > Could you please share the error log with us. I will be able to handle
> > > the situation better. Also, on which platform are you on? (My
> > > implementation works for Linux and Mac OSX only)
> >
> > How about defining HPX_NG_CUNNING_RUNTIME to defined(__linux__)... &&
> > defined(__APPLE__) or whatever, and using that pin point the wrapping?
> > (Makes it easier to understand what they are for...)
>
> Yes, that's definitely something to consider doing.
>
> Thanks!
> Regards Hartmut
> ---
> http://stellar.cct.lsu.edu
> https://github.com/STEllAR-GROUP/hpx
>
>
> >
> > Somehow I managed to mangle my git in the meantime:
> >
> > Your branch and 'origin/master' have diverged, and have 17 and 13
> > different commits each, respectively.
> >
> > when trying to rebase against Stellar - strange as I only have 9
> > patches...
> > - so I'm temporarily out of action..
> >
> > Cheers,
> >
> > Patrick
>
>
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Hartmut Kaiser


> On Tue, Aug 14, 2018 at 08:58:59PM +0530, Nikunj Gupta wrote:
> > Could you please share the error log with us. I will be able to handle
> > the situation better. Also, on which platform are you on? (My
> > implementation works for Linux and Mac OSX only)
>
> How about defining HPX_NG_CUNNING_RUNTIME to defined(__linux__)... &&
> defined(__APPLE__) or whatever, and using that pin point the wrapping?
> (Makes it easier to understand what they are for...)

Yes, that's definitely something to consider doing.

Thanks!
Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx


>
> Somehow I managed to mangle my git in the meantime:
>
> Your branch and 'origin/master' have diverged, and have 17 and 13
> different commits each, respectively.
>
> when trying to rebase against Stellar - strange as I only have 9
> patches...
> - so I'm temporarily out of action..
>
> Cheers,
>
> Patrick


___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Hartmut Kaiser
FWIW, libhpx_wrap is tied into the build here:
https://github.com/STEllAR-GROUP/hpx/blob/master/cmake/HPX_SetupTarget.cmake
#L191-L198

HTH
Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx


> -Original Message-
> From: 'Patrick Welche' 
> Sent: Tuesday, August 14, 2018 4:09 AM
> To: Hartmut Kaiser 
> Cc: hpx-users@stellar.cct.lsu.edu
> Subject: Re: [hpx-users] list of OS names
>
> On Mon, Aug 13, 2018 at 02:18:41PM -0500, Hartmut Kaiser wrote:
> > > Thanks I searched for ldl and libdl... This gets me further:
> > >
> > > diff --git a/CMakeLists.txt b/CMakeLists.txt index
> > > c780ea50ef..69e8261dce
> > > 100644
> > > --- a/CMakeLists.txt
> > > +++ b/CMakeLists.txt
> > > @@ -1227,9 +1227,15 @@ if(NOT WIN32)
> > >  endif()
> > >endif()
> > >
> > > -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > -hpx_libraries(dl)
> > > -  endif()
> > > +  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > +find_library(DL_LIBRARY NAMES dl)
> > > +if(DL_LIBRARY)
> > > +  message(STATUS "dl library found")
> > > +  hpx_libraries(dl)
> > > +else()
> > > +  message(STATUS "dl library not found")
> > > +endif()
> > > +  # XXXPW endif()
> > >
> > >if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
> > >  hpx_libraries(rt)
> > >
> > >
> > > but there are lots of ways of skinning that cat - have you a
> > > preferred way of doing AC_CHECK_LIB([dl],[dlopen]) ?
> > >
> > > (On linking I get:
> >
> > How about doing something like this:
> > https://github.com/Fadis/libdcompile/blob/master/CMakeFiles/modules/Fi
> > ndLibD
> > L.cmake
>
> It think that that assumes that you need an extra library to go with the
> include file, which isn't the case. According to hpx/util/plugin/dll.hpp,
> we assume that everyone not on windows has the include file. I think the
> find_library() is good enough, but could be convinced about a
> CHECK_LIBRARY_EXISTS().
>
> > >
> CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o:
> > > In function
> > > `hpx::threads::coroutines::detail::context_base::~context_base()':
> > > this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail1
> > > 2conte
> > >
> xt_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
> > > undefined reference to
> > > `hpx::threads::coroutines::detail::posix::use_guard_pages'
> > > )
> >
> > This is unrelated. The variable is defined here:
> > https://github.com/STEllAR-GROUP/hpx/blob/master/src/util/runtime_conf
> > igurat
> > ion.cpp#L71-L83.
>
> Thanks - I did the awful "add OS" there to carry on - really need to think
> about what we are actually testing for...
>
> Possibly related, I now get
>
> ld: cannot find -lhpx_wrap
>
> Is that also the GSoC runtime project?
>
>
> cheers,
>
> Patrick


___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Nikunj Gupta
#3402 is merged with master (as hkaiser pointed out in one the earlier
emails) so building on top of current master should resolve issues.

Have you tried installing from current master? If the problem still
persists, please share an error log so that I could provide with a patch.

Regards
Nikunj Gupta

On Tue, Aug 14, 2018, 9:14 PM Patrick Welche  wrote:

> On Tue, Aug 14, 2018 at 08:58:59PM +0530, Nikunj Gupta wrote:
> > Could you please share the error log with us. I will be able to handle
> the
> > situation better. Also, on which platform are you on? (My implementation
> > works for Linux and Mac OSX only)
>
> How about defining HPX_NG_CUNNING_RUNTIME to defined(__linux__)... &&
> defined(__APPLE__) or whatever, and using that pin point the wrapping?
> (Makes it easier to understand what they are for...)
>
> Somehow I managed to mangle my git in the meantime:
>
> Your branch and 'origin/master' have diverged,
> and have 17 and 13 different commits each, respectively.
>
> when trying to rebase against Stellar - strange as I only have 9 patches...
> - so I'm temporarily out of action..
>
> Cheers,
>
> Patrick
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Patrick Welche
On Tue, Aug 14, 2018 at 08:58:59PM +0530, Nikunj Gupta wrote:
> Could you please share the error log with us. I will be able to handle the
> situation better. Also, on which platform are you on? (My implementation
> works for Linux and Mac OSX only)

How about defining HPX_NG_CUNNING_RUNTIME to defined(__linux__)... &&
defined(__APPLE__) or whatever, and using that pin point the wrapping?
(Makes it easier to understand what they are for...)

Somehow I managed to mangle my git in the meantime:

Your branch and 'origin/master' have diverged,
and have 17 and 13 different commits each, respectively.

when trying to rebase against Stellar - strange as I only have 9 patches...
- so I'm temporarily out of action..

Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Nikunj Gupta
Patrick,

Could you please share the error log with us. I will be able to handle the
situation better. Also, on which platform are you on? (My implementation
works for Linux and Mac OSX only)

The reason for various #defines was to match the platform specific
operating systems. Doing #ifndef with Windows can result in unexpected
results so I stuck with the current method.

The linking issue with libhpx_wrap sounds a bit weird. If you're on Linux
then it should build the library and link to it. If the code can't link
hpx_wrap, the error log should be able to help me investigate the situation
and provide a patch to it as well.

Regards
Nikunj Gupta

On Tue, Aug 14, 2018, 7:31 PM Hartmut Kaiser 
wrote:

> > On Mon, Aug 13, 2018 at 02:18:41PM -0500, Hartmut Kaiser wrote:
> > > > Thanks I searched for ldl and libdl... This gets me further:
> > > >
> > > > diff --git a/CMakeLists.txt b/CMakeLists.txt index
> > > > c780ea50ef..69e8261dce
> > > > 100644
> > > > --- a/CMakeLists.txt
> > > > +++ b/CMakeLists.txt
> > > > @@ -1227,9 +1227,15 @@ if(NOT WIN32)
> > > >  endif()
> > > >endif()
> > > >
> > > > -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > > -hpx_libraries(dl)
> > > > -  endif()
> > > > +  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > > +find_library(DL_LIBRARY NAMES dl)
> > > > +if(DL_LIBRARY)
> > > > +  message(STATUS "dl library found")
> > > > +  hpx_libraries(dl)
> > > > +else()
> > > > +  message(STATUS "dl library not found")
> > > > +endif()
> > > > +  # XXXPW endif()
> > > >
> > > >if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
> > > >  hpx_libraries(rt)
> > > >
> > > >
> > > > but there are lots of ways of skinning that cat - have you a
> > > > preferred way of doing AC_CHECK_LIB([dl],[dlopen]) ?
> > > >
> > > > (On linking I get:
> > >
> > > How about doing something like this:
> > > https://github.com/Fadis/libdcompile/blob/master/CMakeFiles/modules/Fi
> > > ndLibD
> > > L.cmake
> >
> > It think that that assumes that you need an extra library to go with the
> > include file, which isn't the case. According to hpx/util/plugin/dll.hpp,
> > we assume that everyone not on windows has the include file. I think the
> > find_library() is good enough, but could be convinced about a
> > CHECK_LIBRARY_EXISTS().
> >
> > > >
> > CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o:
> > > > In function
> > > > `hpx::threads::coroutines::detail::context_base::~context_base()':
> > > > this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail1
> > > > 2conte
> > > >
> > xt_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
> > > > undefined reference to
> > > > `hpx::threads::coroutines::detail::posix::use_guard_pages'
> > > > )
> > >
> > > This is unrelated. The variable is defined here:
> > > https://github.com/STEllAR-GROUP/hpx/blob/master/src/util/runtime_conf
> > > igurat
> > > ion.cpp#L71-L83.
> >
> > Thanks - I did the awful "add OS" there to carry on - really need to
> think
> > about what we are actually testing for...
> >
> > Possibly related, I now get
> >
> > ld: cannot find -lhpx_wrap
> >
> > Is that also the GSoC runtime project?
>
> Yes. I have cc'ed the student to be in the loop.
>
> Regards Hartmut
> ---
> http://stellar.cct.lsu.edu
> https://github.com/STEllAR-GROUP/hpx
>
>
>
>
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread Hartmut Kaiser
> On Mon, Aug 13, 2018 at 02:18:41PM -0500, Hartmut Kaiser wrote:
> > > Thanks I searched for ldl and libdl... This gets me further:
> > >
> > > diff --git a/CMakeLists.txt b/CMakeLists.txt index
> > > c780ea50ef..69e8261dce
> > > 100644
> > > --- a/CMakeLists.txt
> > > +++ b/CMakeLists.txt
> > > @@ -1227,9 +1227,15 @@ if(NOT WIN32)
> > >  endif()
> > >endif()
> > >
> > > -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > -hpx_libraries(dl)
> > > -  endif()
> > > +  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > > +find_library(DL_LIBRARY NAMES dl)
> > > +if(DL_LIBRARY)
> > > +  message(STATUS "dl library found")
> > > +  hpx_libraries(dl)
> > > +else()
> > > +  message(STATUS "dl library not found")
> > > +endif()
> > > +  # XXXPW endif()
> > >
> > >if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
> > >  hpx_libraries(rt)
> > >
> > >
> > > but there are lots of ways of skinning that cat - have you a
> > > preferred way of doing AC_CHECK_LIB([dl],[dlopen]) ?
> > >
> > > (On linking I get:
> >
> > How about doing something like this:
> > https://github.com/Fadis/libdcompile/blob/master/CMakeFiles/modules/Fi
> > ndLibD
> > L.cmake
>
> It think that that assumes that you need an extra library to go with the
> include file, which isn't the case. According to hpx/util/plugin/dll.hpp,
> we assume that everyone not on windows has the include file. I think the
> find_library() is good enough, but could be convinced about a
> CHECK_LIBRARY_EXISTS().
>
> > >
> CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o:
> > > In function
> > > `hpx::threads::coroutines::detail::context_base::~context_base()':
> > > this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail1
> > > 2conte
> > >
> xt_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
> > > undefined reference to
> > > `hpx::threads::coroutines::detail::posix::use_guard_pages'
> > > )
> >
> > This is unrelated. The variable is defined here:
> > https://github.com/STEllAR-GROUP/hpx/blob/master/src/util/runtime_conf
> > igurat
> > ion.cpp#L71-L83.
>
> Thanks - I did the awful "add OS" there to carry on - really need to think
> about what we are actually testing for...
>
> Possibly related, I now get
>
> ld: cannot find -lhpx_wrap
>
> Is that also the GSoC runtime project?

Yes. I have cc'ed the student to be in the loop.

Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx




___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-14 Thread 'Patrick Welche'
On Mon, Aug 13, 2018 at 02:18:41PM -0500, Hartmut Kaiser wrote:
> > Thanks I searched for ldl and libdl... This gets me further:
> >
> > diff --git a/CMakeLists.txt b/CMakeLists.txt index c780ea50ef..69e8261dce
> > 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -1227,9 +1227,15 @@ if(NOT WIN32)
> >  endif()
> >endif()
> >
> > -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > -hpx_libraries(dl)
> > -  endif()
> > +  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> > +find_library(DL_LIBRARY NAMES dl)
> > +if(DL_LIBRARY)
> > +  message(STATUS "dl library found")
> > +  hpx_libraries(dl)
> > +else()
> > +  message(STATUS "dl library not found")
> > +endif()
> > +  # XXXPW endif()
> >
> >if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
> >  hpx_libraries(rt)
> >
> >
> > but there are lots of ways of skinning that cat - have you a preferred way
> > of doing AC_CHECK_LIB([dl],[dlopen]) ?
> >
> > (On linking I get:
> 
> How about doing something like this:
> https://github.com/Fadis/libdcompile/blob/master/CMakeFiles/modules/FindLibD
> L.cmake

It think that that assumes that you need an extra library to go with
the include file, which isn't the case. According to
hpx/util/plugin/dll.hpp, we assume that everyone not on windows has
the include file. I think the find_library() is good enough, but could be
convinced about a CHECK_LIBRARY_EXISTS().

> > CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o:
> > In function
> > `hpx::threads::coroutines::detail::context_base::~context_base()':
> > this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail12conte
> > xt_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
> > undefined reference to
> > `hpx::threads::coroutines::detail::posix::use_guard_pages'
> > )
> 
> This is unrelated. The variable is defined here:
> https://github.com/STEllAR-GROUP/hpx/blob/master/src/util/runtime_configurat
> ion.cpp#L71-L83.

Thanks - I did the awful "add OS" there to carry on - really need to
think about what we are actually testing for...

Possibly related, I now get

ld: cannot find -lhpx_wrap

Is that also the GSoC runtime project?


cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Hartmut Kaiser
> > > On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> > > > FWIW, I have merged #3402 just now.
> > >
> > > Thanks!
> > >
> > > I have got as far as linking libhpx now - somehow there is a -ldl in
> > > link.txt (and in the generated pkg-config .pc files). I have been
> > > hunting through the cmake files where it comes from, but haven't
> > > found it. Any ideas? (dlopen and friends are in many OS's system
> > > library as opposed to
> > > libdl.)
> >
> > libdl is handled here:
> > https://github.com/STEllAR-GROUP/hpx/blob/master/CMakeLists.txt#L1230-
> > L1232
>
> Thanks I searched for ldl and libdl... This gets me further:
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt index c780ea50ef..69e8261dce
> 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -1227,9 +1227,15 @@ if(NOT WIN32)
>  endif()
>endif()
>
> -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> -hpx_libraries(dl)
> -  endif()
> +  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
> +find_library(DL_LIBRARY NAMES dl)
> +if(DL_LIBRARY)
> +  message(STATUS "dl library found")
> +  hpx_libraries(dl)
> +else()
> +  message(STATUS "dl library not found")
> +endif()
> +  # XXXPW endif()
>
>if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
>  hpx_libraries(rt)
>
>
> but there are lots of ways of skinning that cat - have you a preferred way
> of doing AC_CHECK_LIB([dl],[dlopen]) ?
>
> (On linking I get:

How about doing something like this:
https://github.com/Fadis/libdcompile/blob/master/CMakeFiles/modules/FindLibD
L.cmake

>
> CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o:
> In function
> `hpx::threads::coroutines::detail::context_base::~context_base()':
> this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail12conte
> xt_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
> undefined reference to
> `hpx::threads::coroutines::detail::posix::use_guard_pages'
> )

This is unrelated. The variable is defined here:
https://github.com/STEllAR-GROUP/hpx/blob/master/src/util/runtime_configurat
ion.cpp#L71-L83.

Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx




___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread 'Patrick Welche'
On Mon, Aug 13, 2018 at 09:31:23AM -0500, Hartmut Kaiser wrote:
> 
> > On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> > > FWIW, I have merged #3402 just now.
> >
> > Thanks!
> >
> > I have got as far as linking libhpx now - somehow there is a -ldl in
> > link.txt (and in the generated pkg-config .pc files). I have been hunting
> > through the cmake files where it comes from, but haven't found it. Any
> > ideas? (dlopen and friends are in many OS's system library as opposed to
> > libdl.)
> 
> libdl is handled here:
> https://github.com/STEllAR-GROUP/hpx/blob/master/CMakeLists.txt#L1230-L1232

Thanks I searched for ldl and libdl... This gets me further:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c780ea50ef..69e8261dce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1227,9 +1227,15 @@ if(NOT WIN32)
 endif()
   endif()
 
-  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-hpx_libraries(dl)
-  endif()
+  # XXXPW if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+find_library(DL_LIBRARY NAMES dl)
+if(DL_LIBRARY)
+  message(STATUS "dl library found")
+  hpx_libraries(dl)
+else()
+  message(STATUS "dl library not found")
+endif()
+  # XXXPW endif()
 
   if(NOT APPLE AND NOT ("${HPX_PLATFORM_UC}" STREQUAL "ANDROID"))
 hpx_libraries(rt)


but there are lots of ways of skinning that cat - have you a preferred
way of doing AC_CHECK_LIB([dl],[dlopen]) ?

(On linking I get:

CMakeFiles/hpx.dir/runtime/threads/executors/this_thread_executors.cpp.o: In 
function `hpx::threads::coroutines::detail::context_base::~context_base()':
this_thread_executors.cpp:(.text._ZN3hpx7threads10coroutines6detail12context_baseD2Ev[_ZN3hpx7threads10coroutines6detail12context_baseD5Ev]+0x41):
 undefined reference to 
`hpx::threads::coroutines::detail::posix::use_guard_pages'
)

Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Thomas Heller
Patrick Welche  schrieb am Mo., 13. Aug. 2018 16:16:

> On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> > FWIW, I have merged #3402 just now.
>
> Thanks!
>
> I have got as far as linking libhpx now - somehow there is a -ldl in
> link.txt (and in the generated pkg-config .pc files). I have been hunting
> through the cmake files where it comes from, but haven't found it. Any
> ideas? (dlopen and friends are in many OS's system library as opposed to
> libdl.)
>

If I'm not mistaken, this might even come out of the inner cmake core
itself.


> Cheers,
>
> Patrick
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Hartmut Kaiser


> On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> > FWIW, I have merged #3402 just now.
>
> Thanks!
>
> I have got as far as linking libhpx now - somehow there is a -ldl in
> link.txt (and in the generated pkg-config .pc files). I have been hunting
> through the cmake files where it comes from, but haven't found it. Any
> ideas? (dlopen and friends are in many OS's system library as opposed to
> libdl.)

libdl is handled here:
https://github.com/STEllAR-GROUP/hpx/blob/master/CMakeLists.txt#L1230-L1232

Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx



___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Patrick Welche
On Mon, Aug 13, 2018 at 08:06:25AM -0500, Hartmut Kaiser wrote:
> FWIW, I have merged #3402 just now.

Thanks!

I have got as far as linking libhpx now - somehow there is a -ldl in
link.txt (and in the generated pkg-config .pc files). I have been hunting
through the cmake files where it comes from, but haven't found it. Any
ideas? (dlopen and friends are in many OS's system library as opposed to
libdl.)

Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Hartmut Kaiser
FWIW, I have merged #3402 just now.

Regards Hartmut
---
http://stellar.cct.lsu.edu
https://github.com/STEllAR-GROUP/hpx


> -Original Message-
> From: hpx-users-boun...@stellar.cct.lsu.edu  boun...@stellar.cct.lsu.edu> On Behalf Of Lars Viklund
> Sent: Monday, August 13, 2018 7:35 AM
> To: hpx-users@stellar.cct.lsu.edu
> Subject: Re: [hpx-users] list of OS names
>
> On Mon, Aug 13, 2018 at 01:22:38PM +0100, Patrick Welche wrote:
> > On Mon, Aug 13, 2018 at 01:19:42PM +0100, Patrick Welche wrote:
> > > Chugging along trying to get hpx to compile, I thought I would try
> > > the
> > > 1.1.0 patches I had so far on master. I just got an extra compile
> error:
> > >
> > > /usr/src/local/hpx/src/hpx_init.cpp: In function â?~int
> hpx::detail::run_or_start(hpx::util::function_nonser tions::variables_map&)>&, const
> boost::program_options::options_description&, int, char**,
> std::vector >&&, hpx::startup_function_type,
> hpx::shutdown_function_type, hpx::runtime_mode, bool)â?T:
> > > /usr/src/local/hpx/src/hpx_init.cpp:603:24: error: â?~hpx_startâ?T has
> not been declared
> > >  if(hpx_start::include_libhpx_wrap)
>
> The functionality in question is part of one of our GSoC student's work on
> introducing HPX even earlier in the startup process via loader tricks,
> currently only on a few OSes like GNU/Linux and macOS.
>
> There is a missing guard in this source file and it should be resolved by
> the fix in PR#3402.
>
> https://github.com/STEllAR-GROUP/hpx/pull/3402
>
> Everything else about this feature should be inert on the OSes the feature
> doesn't apply to.
>
> --
> Lars Viklund | z...@acc.umu.se
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Lars Viklund
On Mon, Aug 13, 2018 at 01:22:38PM +0100, Patrick Welche wrote:
> On Mon, Aug 13, 2018 at 01:19:42PM +0100, Patrick Welche wrote:
> > Chugging along trying to get hpx to compile, I thought I would try the
> > 1.1.0 patches I had so far on master. I just got an extra compile error:
> > 
> > /usr/src/local/hpx/src/hpx_init.cpp: In function ‘int 
> > hpx::detail::run_or_start(hpx::util::function_nonser&,
> >  const boost::program_options::options_description&, int, char**, 
> > std::vector >&&, hpx::startup_function_type, 
> > hpx::shutdown_function_type, hpx::runtime_mode, bool)’:
> > /usr/src/local/hpx/src/hpx_init.cpp:603:24: error: ‘hpx_start’ has not 
> > been declared
> >  if(hpx_start::include_libhpx_wrap)

The functionality in question is part of one of our GSoC student's work
on introducing HPX even earlier in the startup process via loader
tricks, currently only on a few OSes like GNU/Linux and macOS.

There is a missing guard in this source file and it should be resolved
by the fix in PR#3402.

https://github.com/STEllAR-GROUP/hpx/pull/3402

Everything else about this feature should be inert on the OSes the
feature doesn't apply to.

-- 
Lars Viklund | z...@acc.umu.se
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Patrick Welche
On Mon, Aug 13, 2018 at 01:19:42PM +0100, Patrick Welche wrote:
> Chugging along trying to get hpx to compile, I thought I would try the
> 1.1.0 patches I had so far on master. I just got an extra compile error:
> 
> /usr/src/local/hpx/src/hpx_init.cpp: In function ‘int 
> hpx::detail::run_or_start(hpx::util::function_nonser&,
>  const boost::program_options::options_description&, int, char**, 
> std::vector >&&, hpx::startup_function_type, 
> hpx::shutdown_function_type, hpx::runtime_mode, bool)’:
> /usr/src/local/hpx/src/hpx_init.cpp:603:24: error: ‘hpx_start’ has not 
> been declared
>  if(hpx_start::include_libhpx_wrap)
> 
> 
> which seems to be from
> 
> commit bd77d6ed1720ba2d1c45c7129c5bf1d299a80498
> Author: Nikunj Gupta 
> Date:   Wed Jul 18 09:35:54 2018 +0530
> 
> Changes according to review
> 
> 
> Would a quick glance by you suggest the #ifs served as useful protection?
> (Now to find out what HPX_HAVE_DYNAMIC_HPX_MAIN does...)

Those #ifs still currently protect

namespace hpx_start
{
// Importing weak symbol from libhpx_wrap.a which may be shadowed by one 
present in
// hpx_main.hpp.
HPX_SYMBOL_EXPORT __attribute__((weak)) extern bool include_libhpx_wrap;
}


(but I don't understand the shadowing issue...)


Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-13 Thread Patrick Welche
Chugging along trying to get hpx to compile, I thought I would try the
1.1.0 patches I had so far on master. I just got an extra compile error:

/usr/src/local/hpx/src/hpx_init.cpp: In function ‘int 
hpx::detail::run_or_start(hpx::util::function_nonser&,
 const boost::program_options::options_description&, int, char**, 
std::vector >&&, hpx::startup_function_type, 
hpx::shutdown_function_type, hpx::runtime_mode, bool)’:
/usr/src/local/hpx/src/hpx_init.cpp:603:24: error: ‘hpx_start’ has not been 
declared
 if(hpx_start::include_libhpx_wrap)


which seems to be from

commit bd77d6ed1720ba2d1c45c7129c5bf1d299a80498
Author: Nikunj Gupta 
Date:   Wed Jul 18 09:35:54 2018 +0530

Changes according to review


Would a quick glance by you suggest the #ifs served as useful protection?
(Now to find out what HPX_HAVE_DYNAMIC_HPX_MAIN does...)


Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-08 Thread Lars Viklund
On Wed, Aug 08, 2018 at 10:08:22PM +0100, Patrick Welche wrote:
> On Wed, Aug 08, 2018 at 11:01:40PM +0200, Thomas Heller wrote:
> > With that being said, we are totally open to suggestions to make this
> > handling of different OSes more maintainable. Do you have suggestions?
> 
> Yes - I had a subsequent trivial patch which then also matches better
> the header inclusion #ifdefs at the start - basically "not windows"
> should be the #else case as per the little patch.
> 
> I said I would check FreeBSD. I looked in:
> 
>   https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/getenv.c
> 
> and don't see a "freebsd_environ". Does "environ" same as everyone else
> really not work on FreeBSD?

There's some subtle differences when it comes to shared libraries.

On Linux `environ` is available universally regardless of where you are
in the program, while on FreeBSD we need to grab it at a specific point
and clone the contents, so that it's available everywhere we need it.
There no system function to acquire the proper environment like there's
on macOS, which would make things easier.

I forget the particulars, but it's differently available at link time on
FreeBSD vs. Linux and results in linker errors if you use it directly in
a shared library. The way here is convoluted, but it works.

Heller outlined most of the pain points already where low level
differences occur, but it's very easy as a programmer to accidentally
target GNU/Linux extensions and features and not know about it until
someone like you or me figures it's time to try it on a BSD.

All the non-Windows OSes are similar, except for all the places where
they're quite different.

Anything you see in the codebase that's conditional under `__FreeBSD__`
is typically due to me trying to build the thing and figuring out what
things need generalization and what things just need specialization.

At some places, macOS and FreeBSD are similar enough to share
implementations, and I've tried to do that there. Due to having rather
limited Net and Open experience, I opted to not use the generic
BSD conditional.

// Lars Viklund, user of weird OSes

> 
> Cheers,
> 
> Patrick
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

-- 
Lars Viklund | z...@acc.umu.se
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-08 Thread Patrick Welche
On Wed, Aug 08, 2018 at 11:01:40PM +0200, Thomas Heller wrote:
> With that being said, we are totally open to suggestions to make this
> handling of different OSes more maintainable. Do you have suggestions?

Yes - I had a subsequent trivial patch which then also matches better
the header inclusion #ifdefs at the start - basically "not windows"
should be the #else case as per the little patch.

I said I would check FreeBSD. I looked in:

  https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/getenv.c

and don't see a "freebsd_environ". Does "environ" same as everyone else
really not work on FreeBSD?


Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-08 Thread Thomas Heller
Hi Patrick,

Yes, it's hard to maintain. The problem is, that we have to rely on some OS
specific parts in very few places. From the top of my that includes:
 - User level context switching (that's the most crucial part)
 - Dynamic plugin loading (the one you stumbled over in your second mail)
 - OS thread handling (that should be handled by your C++ standard library
though)

We currently support (most) POSIX like systems (that should include OSX and
some BSD flavors) and Windows. For some *NIX flavors, we have some
workarounds. Most of it has grown over the years and could, probably
deserve a cleanup. Please also keep in mind that we don't run tests
regularly on those "exotic" platforms. However, if you want to dedicate
resources for testing, that would be awesome!

With that being said, we are totally open to suggestions to make this
handling of different OSes more maintainable. Do you have suggestions?

Regards,
Thomas


On Wed, Aug 8, 2018 at 10:06 PM Patrick Welche  wrote:

> I thought I would try out HPX, and hit:
>
> /tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/src/exception.cpp:207:2:
> error: #error "Don't know, how to access the execution environment on this
> platform"
>  #error "Don't know, how to access the execution environment on this
> platform"
>
> I don't think a hand-coded list of operating systems is maintainable.
> Staring at it, I can't spot the difference between linux and __APPLE__
> for instance. Maybe linux, AIX, and __APPLE__ should just be the #else
> so that chances are, your code would compile on a not-listed OS, and
> you would only receive bug reports from the few that don't.
> (Is FreeBSD really different? I must check...)
>
> Cheers,
>
> Patrick
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-08 Thread Patrick Diehl
Hi Patrick,

could you please provide more details, like OS, compiler, and so on?

Thanks,

Patrick

On 08/08/18 02:26 PM, Patrick Welche wrote:
> On Wed, Aug 08, 2018 at 05:34:06PM +0100, Patrick Welche wrote:
>> I thought I would try out HPX, and hit:
>>
>> /tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/src/exception.cpp:207:2: 
>> error: #error "Don't know, how to access the execution environment on this 
>> platform"
>>  #error "Don't know, how to access the execution environment on this 
>> platform"
>>
>> I don't think a hand-coded list of operating systems is maintainable.
>> Staring at it, I can't spot the difference between linux and __APPLE__
>> for instance. Maybe linux, AIX, and __APPLE__ should just be the #else
>> so that chances are, your code would compile on a not-listed OS, and
>> you would only receive bug reports from the few that don't.
>> (Is FreeBSD really different? I must check...)
> 
> After the attached patch I got to:
> 
> tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/hpx/util/plugin/detail/dll_dlopen.hpp:
>  In member function 'std::string 
> hpx::util::plugin::dll::get_directory(hpx::error_code&) const':
> /tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/hpx/util/plugin/detail/dll_dlopen.hpp:318:45:
>  error: 'RTLD_DI_ORIGIN' was not declared in this scope
>  if (!ec && ::dlinfo(dll_handle, RTLD_DI_ORIGIN, directory) < 0) {
>  ^~
> 
> but that is going to be harder...
> 
> 
> Cheers,
> 
> Patrick
> 
> 
> 
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
> 



signature.asc
Description: OpenPGP digital signature
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] list of OS names

2018-08-08 Thread Patrick Welche
On Wed, Aug 08, 2018 at 05:34:06PM +0100, Patrick Welche wrote:
> I thought I would try out HPX, and hit:
> 
> /tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/src/exception.cpp:207:2: 
> error: #error "Don't know, how to access the execution environment on this 
> platform"
>  #error "Don't know, how to access the execution environment on this platform"
> 
> I don't think a hand-coded list of operating systems is maintainable.
> Staring at it, I can't spot the difference between linux and __APPLE__
> for instance. Maybe linux, AIX, and __APPLE__ should just be the #else
> so that chances are, your code would compile on a not-listed OS, and
> you would only receive bug reports from the few that don't.
> (Is FreeBSD really different? I must check...)

After the attached patch I got to:

tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/hpx/util/plugin/detail/dll_dlopen.hpp:
 In member function 'std::string 
hpx::util::plugin::dll::get_directory(hpx::error_code&) const':
/tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/hpx/util/plugin/detail/dll_dlopen.hpp:318:45:
 error: 'RTLD_DI_ORIGIN' was not declared in this scope
 if (!ec && ::dlinfo(dll_handle, RTLD_DI_ORIGIN, directory) < 0) {
 ^~

but that is going to be harder...


Cheers,

Patrick
$NetBSD$

Avoid maintaining lists of names of operating systems.

--- src/exception.cpp.orig  2018-02-23 08:43:42.0 +
+++ src/exception.cpp
@@ -190,21 +190,15 @@ namespace hpx { namespace detail
 std::size_t len = get_arraylen(_environ);
 env.reserve(len);
 std::copy(&_environ[0], &_environ[len], std::back_inserter(env));
-#elif defined(linux) || defined(__linux) || defined(__linux__) || 
defined(__AIX__)
-std::size_t len = get_arraylen(environ);
-env.reserve(len);
-std::copy([0], [len], std::back_inserter(env));
 #elif defined(__FreeBSD__)
 std::size_t len = get_arraylen(freebsd_environ);
 env.reserve(len);
 std::copy(_environ[0], _environ[len],
 std::back_inserter(env));
-#elif defined(__APPLE__)
+#else
 std::size_t len = get_arraylen(environ);
 env.reserve(len);
 std::copy([0], [len], std::back_inserter(env));
-#else
-#error "Don't know, how to access the execution environment on this platform"
 #endif
 
 std::sort(env.begin(), env.end());
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


[hpx-users] list of OS names

2018-08-08 Thread Patrick Welche
I thought I would try out HPX, and hit:

/tmp/pkgsrc/parallel/hpx/work.x86_64/hpx_1.1.0/src/exception.cpp:207:2: error: 
#error "Don't know, how to access the execution environment on this platform"
 #error "Don't know, how to access the execution environment on this platform"

I don't think a hand-coded list of operating systems is maintainable.
Staring at it, I can't spot the difference between linux and __APPLE__
for instance. Maybe linux, AIX, and __APPLE__ should just be the #else
so that chances are, your code would compile on a not-listed OS, and
you would only receive bug reports from the few that don't.
(Is FreeBSD really different? I must check...)

Cheers,

Patrick
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users