Hi Jakub!

On 2022-06-09T10:19:03+0200, Jakub Jelinek via Gcc-patches 
<gcc-patches@gcc.gnu.org> wrote:
> This patch adds support for dlopening libmemkind.so

Instead of 'dlopen'ing literally 'libmemkind.so':

> --- libgomp/allocator.c.jj    2022-06-08 08:21:03.099446883 +0200
> +++ libgomp/allocator.c       2022-06-08 13:41:45.647133610 +0200

> +  void *handle = dlopen ("libmemkind.so", RTLD_LAZY);

..., shouldn't this instead 'dlopen' 'libmemkind.so.0'?  At least for
Debian/Ubuntu, the latter ('libmemkind.so.0') is shipped in the "library"
package:

    $ apt-file list libmemkind0 | grep -F libmemkind.so
    libmemkind0: /usr/lib/x86_64-linux-gnu/libmemkind.so.0
    libmemkind0: /usr/lib/x86_64-linux-gnu/libmemkind.so.0.0.1

..., but the former ('libmemkind.so') only in the "development" package:

    $ apt-file list libmemkind-dev | grep -F libmemkind.so
    libmemkind-dev: /usr/lib/x86_64-linux-gnu/libmemkind.so

..., which users of GCC/libgomp shouldn't have to care about.


Any plans about test cases for this?  (Not trivial, I suppose?)

Or, at least some 'gomp_debug' logging, what's happening behind the
scenes?


> --- libgomp/config/linux/allocator.c.jj       2022-06-08 08:58:23.197078191 
> +0200
> +++ libgomp/config/linux/allocator.c  2022-06-08 09:39:15.108410730 +0200
> @@ -0,0 +1,36 @@

> +#define _GNU_SOURCE
> +#include "libgomp.h"
> +#if defined(PLUGIN_SUPPORT) && defined(LIBGOMP_USE_PTHREADS)
> +#define LIBGOMP_USE_MEMKIND
> +#endif
> +
> +#include "../../../allocator.c"

Given this use of 'PLUGIN_SUPPORT' (and thus 'dlopen' etc.) for something
different than libgomp plugins (offloading), might move 'DL_LIBS',
'PLUGIN_SUPPORT' from 'libgomp/plugin/configfrag.ac' into
'libgomp/configure.ac', and 'libgomp_la_LIBADD += $(DL_LIBS)' from
'libgomp/plugin/Makefrag.am' into 'libgomp/Makefile.am'.


Grüße
 Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to