On 03/05/17 17:54, Ralf Stubner wrote:
> [...]

Hi all,
this is really another iteration of #741297.


Honestly, I believe that the whole test of openmpi "existence" using
dlopen is unnecessary. This code is only executed if we have compiled
against openmpi, so why do we have to double-check that it is in the
system?  I propose to completely drop the dlopen test.

I attach a patch that does exactly that. I tried to prepare NMU, but
had a hard time with version 1.0 of this package :(.

Cheers,
Tomasz
From d4d39b7f09cfc0d2746702b417bebf0bf421b947 Mon Sep 17 00:00:00 2001
From: Tomasz Buchert <tom...@buchert.pl>
Date: Sat, 6 May 2017 17:13:41 +0200
Subject: [PATCH] Fix for #861748.

---
 ...ent-the-use-of-dlopen-for-libmpi.so-files.patch | 36 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 debian/patches/0001-Comment-the-use-of-dlopen-for-libmpi.so-files.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/0001-Comment-the-use-of-dlopen-for-libmpi.so-files.patch b/debian/patches/0001-Comment-the-use-of-dlopen-for-libmpi.so-files.patch
new file mode 100644
index 0000000..3630980
--- /dev/null
+++ b/debian/patches/0001-Comment-the-use-of-dlopen-for-libmpi.so-files.patch
@@ -0,0 +1,36 @@
+From: Tomasz Buchert <tom...@buchert.pl>
+Date: Sat, 6 May 2017 17:08:38 +0200
+Subject: Comment the use of dlopen() for libmpi.so files.
+
+dlopen is used only to runtime check that rmpi is running against
+openmpi. But this code is only compiled in when openmpi is the mpi
+runtime in the system. Hence, the test is useless.
+
+The reason why it causes the import to fail is that the version of
+openmpi in stretch has changed the .so file numbering from "so.1" to
+"so.20". The previous "fix" in https://bugs.debian.org/741297 clearly
+just pushes the problem only in the future.
+---
+ src/Rmpi.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/Rmpi.c b/src/Rmpi.c
+index ce9a718..91c9145 100644
+--- a/src/Rmpi.c
++++ b/src/Rmpi.c
+@@ -74,12 +74,15 @@ if (flag)
+ 
+ #ifndef __APPLE__
+ #ifdef OPENMPI
++	/*
++	// This test is not necessary in Debian.
+     if (!dlopen("libmpi.so.1", RTLD_GLOBAL | RTLD_LAZY) 
+ 	&& !dlopen("libmpi.so.0", RTLD_GLOBAL | RTLD_LAZY)
+ 	&& !dlopen("libmpi.so", RTLD_GLOBAL | RTLD_LAZY)) {
+         Rprintf("%s\n",dlerror());
+         return AsInt(0);
+     }
++	*/
+ #endif
+ #endif
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..560da9e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Comment-the-use-of-dlopen-for-libmpi.so-files.patch
-- 
2.11.0

Attachment: signature.asc
Description: PGP signature

Reply via email to