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 '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 '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 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 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 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 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(&environ[0], &environ[len], std::back_inserter(env));
 #elif defined(__FreeBSD__)
 std::size_t len = get_arraylen(freebsd_environ);
 env.reserve(len);
 std::copy(&freebsd_environ[0], &freebsd_environ[len],
 std::back_inserter(env));
-#elif defined(__APPLE__)
+#else
 std::size_t len = get_arraylen(environ);
 env.reserve(len);
 std::copy(&environ[0], &environ[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