[covid-19] Help with r-bioc-rgadem needed

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[covid-19] Help with r-bioc-rgadem needed

Andreas Tille-5
Hi,

since I did not got any response from r-pkg team yet I guess nobody has
a clue about this autoconf issue.  So I'd like to forward this question
here to finalise a package which is relevant for our COVID-19
Biohackathon.

I injected r-bioc-rgadem[1] but the build ends in:

   dh_autoreconf -O--buildsystem=R
autoheader: warning: missing template: HAVE_OPENMP
autoheader: Use AC_DEFINE([HAVE_OPENMP], [], [Description])
autoreconf: /usr/bin/autoheader failed with exit status: 1
dh_autoreconf: error: autoreconf -f -i returned exit code 1
make: *** [debian/rules:4: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2


Any hint would be welcome

       Andreas.


[1] https://salsa.debian.org/r-pkg-team/r-bioc-rgadem

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

Re: [covid-19] Help with r-bioc-rgadem needed

Jeremy Sowden
On 2020-04-06, at 17:59:05 +0200, Andreas Tille wrote:

> since I did not got any response from r-pkg team yet I guess nobody
> has a clue about this autoconf issue.  So I'd like to forward this
> question here to finalise a package which is relevant for our COVID-19
> Biohackathon.
>
> I injected r-bioc-rgadem[1] but the build ends in:
>
>    dh_autoreconf -O--buildsystem=R
> autoheader: warning: missing template: HAVE_OPENMP
> autoheader: Use AC_DEFINE([HAVE_OPENMP], [], [Description])
> autoreconf: /usr/bin/autoheader failed with exit status: 1
> dh_autoreconf: error: autoreconf -f -i returned exit code 1
> make: *** [debian/rules:4: binary] Error 25
> dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
>
>
> Any hint would be welcome
Similar to some of the problems with mpqc yesterday.  Patch attached.

J.

diff --git a/configure.ac b/configure.ac
index 0b7e8d793a31..aef047400685 100755
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,7 @@ Use --disable-parallel (or ARG=no) to keep the code sequential even if GCD or Op
 # As recommended by Simon Urbanek on R-Devel
 AC_DEFUN([AC_CHECK_PKG_OPENMP],
   [dnl
+    AH_TEMPLATE([HAVE_OPENMP],[])
     AC_MSG_CHECKING([whether OpenMP will work in a package])
     ac_pkg_openmp=no
     AS_IF(

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[covid-19] Autoconf solved but now there is a C issue (Was: Help with r-bioc-rgadem needed)

Andreas Tille-5
Hi Jeremy,

On Mon, Apr 06, 2020 at 05:34:23PM +0100, Jeremy Sowden wrote:

> On 2020-04-06, at 17:59:05 +0200, Andreas Tille wrote:
> >    dh_autoreconf -O--buildsystem=R
> > autoheader: warning: missing template: HAVE_OPENMP
> > autoheader: Use AC_DEFINE([HAVE_OPENMP], [], [Description])
> > autoreconf: /usr/bin/autoheader failed with exit status: 1
> > dh_autoreconf: error: autoreconf -f -i returned exit code 1
> > make: *** [debian/rules:4: binary] Error 25
> > dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
>
> Similar to some of the problems with mpqc yesterday.  Patch attached.

Thanks a lot for your patch (commited to Git[1]) which solved the
autoconf issue.  Unfortunately there is another issue now:


ecking for stdint.h... yes
checking for unistd.h... yes
checking dispatch/dispatch.h usability... no
checking dispatch/dispatch.h presence... no
checking for dispatch/dispatch.h... no
checking whether OpenMP will work in a package... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
make[1]: Entering directory '/build/r-bioc-rgadem-2.34.1/src'
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG    -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-j1tBvV/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Gadem_Analysis.c -o Gadem_Analysis.o
Gadem_Analysis.c: In function 'GADEM_Analysis':
Gadem_Analysis.c:618:7: warning: implicit declaration of function 'DO_APPLY' [-Wimplicit-function-declaration]
  618 |       DO_APPLY(populationCalculation(maxSeqLen, numEM, fitness+ii,
      |       ^~~~~~~~
Gadem_Analysis.c:618:16: error: invalid use of void expression
  618 |       DO_APPLY(populationCalculation(maxSeqLen, numEM, fitness+ii,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |                                      startPWMfound, minminSites, maxpFactor[ii],
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620 |                                      numSeq, numSeqEM, seq, rseq, seqLen, Iseq,
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  621 |                                      bfreq0, posWeight, weightType,
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  622 |                                      pvalueCutoff, emSeqLen,
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~
  623 |                                      pwm[ii], pwmLen[ii], epwm[ii], opwm[ii],
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  624 |                                      pwmConsensus[ii], scoreCutoff+ii, sdyad[ii], ii),
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [/usr/lib/R/etc/Makeconf:168: Gadem_Analysis.o] Error 1


Thanks a lot for your help anyway

      Andreas.

[1] https://salsa.debian.org/r-pkg-team/r-bioc-rgadem

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

Re: [covid-19] Autoconf solved but now there is a C issue (Was: Help with r-bioc-rgadem needed)

Jeremy Sowden
On 2020-04-06, at 20:32:12 +0200, Andreas Tille wrote:

> Hi Jeremy,
>
> On Mon, Apr 06, 2020 at 05:34:23PM +0100, Jeremy Sowden wrote:
> > On 2020-04-06, at 17:59:05 +0200, Andreas Tille wrote:
> > >    dh_autoreconf -O--buildsystem=R
> > > autoheader: warning: missing template: HAVE_OPENMP
> > > autoheader: Use AC_DEFINE([HAVE_OPENMP], [], [Description])
> > > autoreconf: /usr/bin/autoheader failed with exit status: 1
> > > dh_autoreconf: error: autoreconf -f -i returned exit code 1
> > > make: *** [debian/rules:4: binary] Error 25
> > > dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
> >
> > Similar to some of the problems with mpqc yesterday.  Patch attached.
>
> Thanks a lot for your patch (commited to Git[1]) which solved the
> autoconf issue.  Unfortunately there is another issue now:
>
>
> ecking for stdint.h... yes
> checking for unistd.h... yes
> checking dispatch/dispatch.h usability... no
> checking dispatch/dispatch.h presence... no
> checking for dispatch/dispatch.h... no
> checking whether OpenMP will work in a package... yes
> configure: creating ./config.status
> config.status: creating src/Makevars
> config.status: creating src/config.h
> ** libs
> make[1]: Entering directory '/build/r-bioc-rgadem-2.34.1/src'
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG    -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-j1tBvV/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Gadem_Analysis.c -o Gadem_Analysis.o
> Gadem_Analysis.c: In function 'GADEM_Analysis':
> Gadem_Analysis.c:618:7: warning: implicit declaration of function 'DO_APPLY' [-Wimplicit-function-declaration]
>   618 |       DO_APPLY(populationCalculation(maxSeqLen, numEM, fitness+ii,
>       |       ^~~~~~~~
> Gadem_Analysis.c:618:16: error: invalid use of void expression
>   618 |       DO_APPLY(populationCalculation(maxSeqLen, numEM, fitness+ii,
>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   619 |                                      startPWMfound, minminSites, maxpFactor[ii],
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   620 |                                      numSeq, numSeqEM, seq, rseq, seqLen, Iseq,
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   621 |                                      bfreq0, posWeight, weightType,
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   622 |                                      pvalueCutoff, emSeqLen,
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~
>   623 |                                      pwm[ii], pwmLen[ii], epwm[ii], opwm[ii],
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   624 |                                      pwmConsensus[ii], scoreCutoff+ii, sdyad[ii], ii),
>       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[1]: *** [/usr/lib/R/etc/Makeconf:168: Gadem_Analysis.o] Error 1
>
>
> Thanks a lot for your help anyway
Patch attached.

J.

From d3b5c1358bcf8463719c0175d759f74819e74f8e Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <[hidden email]>
Date: Mon, 6 Apr 2020 20:41:54 +0100
Subject: [PATCH] The definition of DO_APPLY in src/config.h.in is clobbered by
 autoheader, so add it in Gadem_Analysis.c where it is used.

---
 src/Gadem_Analysis.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/Gadem_Analysis.c b/src/Gadem_Analysis.c
index a604afeb0479..0e868b56918a 100755
--- a/src/Gadem_Analysis.c
+++ b/src/Gadem_Analysis.c
@@ -25,6 +25,32 @@
 
 #include "config.h"
 
+#ifdef HAVE_DISPATCH_DISPATCH_H
+  #include <dispatch/dispatch.h>
+  #define DO_APPLY(task, n_times, counter_name) \
+    R_CheckUserInterrupt(); \
+    dispatch_apply(n_times, \
+                   dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),       \
+                   ^(size_t counter_name) { task; });
+  
+#else // not HAVE_DISPATCH_DISPATCH_H
+  #ifdef HAVE_OPENMP
+    #include <omp.h>
+    #define DO_APPLY(task, n_times, counter_name) \
+      R_CheckUserInterrupt(); \
+      _Pragma("omp parallel for") \
+      for (int counter_name = 0; counter_name < n_times; ++counter_name) { \
+        task; \
+      }
+  #else // not HAVE_OPENMP
+    #define DO_APPLY(task, n_times, counter_name) \
+      for (int counter_name = 0; counter_name < n_times; ++counter_name) { \
+        R_CheckUserInterrupt(); \
+        task; \
+      }
+  #endif // HAVE_OPENMP
+#endif // HAVE_DISPATCH_DISPATCH_H
+
 /*---------------------------------------------------------------------------
 // v1.3.1: last modifications 5/14/2011
 // added user-input background model
--
2.25.1


signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [covid-19] Autoconf solved but now there is a C issue (Was: Help with r-bioc-rgadem needed)

Andreas Tille-5
On Mon, Apr 06, 2020 at 08:53:12PM +0100, Jeremy Sowden wrote:
> > Thanks a lot for your help anyway
>
> Patch attached.

Thank you so much again, Andreas.

--
http://fam-tille.de