Re: [R-pkg-devel] Fixing travis build fail due to fftwtools fatal error (fftw3.h: No such file or directory)

2020-09-11 Thread Dirk Eddelbuettel


On 10 September 2020 at 14:14, Marta Karaś wrote:
| Adding the following to .travis.yml:
| 
| before_install:
|   - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -y install
| libfftw3-dev ; fi
| 
| did the trick!

I think that is an example of the issue discussed in this blog post:
  http://dirk.eddelbuettel.com/blog/2020/08/26#029_introducing_bspm

The RSPM system gets you the package, but it is by its (on purpose simple)
design disconnected and unaware of the dependency required which sent you
down a rabbit hole. (One could also suggest that maybe Karim should expand
   SystemRequirements:  fftw3 (>= 3.1.2)
to maybe list the packages offering fftw3 _headers_. Jeroen uses a pattern
for this, eg curl has
   SystemRequirements:  libcurl: libcurl-devel (rpm) or libcurl4-openssl-dev 
(deb).
which is already one step better.)

Only systems with actual dependency resolution can go further, but it is hard
to do that cross-platform / cross-OS.  On Linux we have both BSPM utilising
the existing rpm and deb binaries, respectively, maintained by tireless
volunteers, as well as the older use of directly using the binaries.

Eg looking at the Ubuntu binary from the Rutter PPA shows that
r-cran-fftwtools will bring the fftw3 runtime in:

   docker@08d894be427a:/work$ apt-cache show r-cran-fftwtools | grep ^Depends
   Depends: r-base-core, libfftw3-double3 (>= 3.3.5)
   docker@08d894be427a:/work$ 

That would be an easier binary install as it skips the 'from source' build
step that sent Marta hunting for the required header.

If I find some time I will try to set up some Travis CI examples utilizing
BSPM.  Until then, one can do as I have done for over half a decade and point
Travis CI to these binaries via the (still maintained and simple) r-travis
setup.  Works for me.  See http://eddelbuettel.github.io/r-travis/  and
numerous .travis.yml in packages of mine and a few other users.

Dirk

| Thank you both for your attention to this issue!
| 
| Bests,
| Marta Karas
| 
| 
| 
| 
| 
| On Thu, Sep 10, 2020 at 8:35 AM Karim Rahim  wrote:
| 
| > Thanks,
| >
| > That may be it. It is a missing dependency.
| >
| > It's been a while and I'm not sure which package exposes fftw3.h ...
| >
| > Karim
| >
| > On Thu, Sep 10, 2020 at 8:16 AM Dirk Eddelbuettel  wrote:
| >
| >>
| >> On 9 September 2020 at 23:45, Karim Rahim wrote:
| >> |  sudo apt-get install -y fftw3
| >>
| >> Or maybe rather
| >>
| >>sudo apt-get install libfftw3-dev
| >>
| >> to get the development headers?
| >>
| >> Dirk
| >>
| >> | Then try again.
| >> |
| >> | Let me know if it doesn't work.
| >> |
| >> | Cheers!
| >> | Karim
| >> |
| >> | On Wed, Sep 9, 2020 at 10:27 PM Max Turgeon 
| >> wrote:
| >> | >
| >> | > Hi Marta,
| >> | >
| >> | > One change I can see from your Git history that seems to match the
| >> first failed build on Travis is when you added "Imports: fftwtools" to your
| >> DESCRIPTION file. And it makes sense, because if we look at its DESCRIPTION
| >> file, we can see that it has fftw3 as a SystemRequirements. In other words,
| >> it needs to be installed on Travis before you can run the checks on your
| >> package.
| >> | >
| >> | > As for solutions, I can see that Karim wrote a short description of
| >> how to install the library on Linux, and there's a link for Mac; all this
| >> is on the Github repo: https://github.com/krahim/fftwtools
| >> | >
| >> | > I also noticed that there is an R package wrapping fftw on CRAN (
| >> https://cran.r-project.org/package=fftw) and I can see that it's a
| >> Suggested package for fftwtools. I haven't tried it, but presumably you
| >> could install the fftw R package, instead of the fftw3 library.
| >> | >
| >> | > HTH,
| >> | >
| >> | > Max Turgeon
| >> | > Assistant Professor
| >> | > Department of Statistics
| >> | > Department of Computer Science|
 >> | > University of Manitoba
| >> | > maxturgeon.ca
| >> | >
| >> | >
| >> | >
| >> | > 
| >> | > From: R-package-devel  on
| >> behalf of Marta Karaś 
| >> | > Sent: Wednesday, September 9, 2020 9:09 PM
| >> | > To: package-develop 
| >> | > Cc: karim.ra...@queensu.ca 
| >> | > Subject: [R-pkg-devel] Fixing travis build fail due to fftwtools
| >> fatal error (fftw3.h: No such file or directory)
| >> | >
| >> | > 
| >> | > Caution: This message was sent from outside the University of
| >> Manitoba.
| >> | > 
| >> | >
| >> | > Dear all,
| >> | >
| >> | > I have been facing travis build fail on linux xenial due to *fftwtools
| >> | > fatal error* (fftw3.h: No such file or directory) with my R package.
| >> The
| >> | > error appeared at a random time a few months ago (at a random time :=
| >> I do
| >> | > not link it with any fftwtools-function related change commit I did)
| >> and
| >> | > persists.
| >> | >
| >> | > There is not much I achieved in googling and trying to decipher it,
| >> sadly;
| >> |

Re: [R-pkg-devel] Fixing travis build fail due to fftwtools fatal error (fftw3.h: No such file or directory)

2020-09-11 Thread Karim Rahim
Hi Dirk,

Thanks for resolving this! It's been awhile since I've worked on this...

So for dependencies, I'd like to keep it as simple as possible. I agree
fftw3 may need to be updated.

It's my understanding that if one were to install the latest fftw (3.3.8)
from source then it would expose the header file.

Is this incorrect?

If this is the case, then it becomes about the various distribution
specific packages.
So then I want to aim people in the right direction.

How about?

fftw3 (>= 3.1.2; ensure fftw3.h is exposed - libfftw3-dev in Ubuntu)

Kind Regards,
Karim





On Fri, Sep 11, 2020 at 11:20 AM Dirk Eddelbuettel  wrote:
>
>
> On 10 September 2020 at 14:14, Marta Karaś wrote:
> | Adding the following to .travis.yml:
> |
> | before_install:
> |   - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -y install
> | libfftw3-dev ; fi
> |
> | did the trick!
>
> I think that is an example of the issue discussed in this blog post:
>   http://dirk.eddelbuettel.com/blog/2020/08/26#029_introducing_bspm
>
> The RSPM system gets you the package, but it is by its (on purpose simple)
> design disconnected and unaware of the dependency required which sent you
> down a rabbit hole. (One could also suggest that maybe Karim should expand
>SystemRequirements:  fftw3 (>= 3.1.2)
> to maybe list the packages offering fftw3 _headers_. Jeroen uses a pattern
> for this, eg curl has
>SystemRequirements:  libcurl: libcurl-devel (rpm) or
libcurl4-openssl-dev (deb).
> which is already one step better.)
>
> Only systems with actual dependency resolution can go further, but it is
hard
> to do that cross-platform / cross-OS.  On Linux we have both BSPM
utilising
> the existing rpm and deb binaries, respectively, maintained by tireless
> volunteers, as well as the older use of directly using the binaries.
>
> Eg looking at the Ubuntu binary from the Rutter PPA shows that
> r-cran-fftwtools will bring the fftw3 runtime in:
>
>docker@08d894be427a:/work$ apt-cache show r-cran-fftwtools | grep
^Depends
>Depends: r-base-core, libfftw3-double3 (>= 3.3.5)
>docker@08d894be427a:/work$
>
> That would be an easier binary install as it skips the 'from source' build
> step that sent Marta hunting for the required header.
>
> If I find some time I will try to set up some Travis CI examples utilizing
> BSPM.  Until then, one can do as I have done for over half a decade and
point
> Travis CI to these binaries via the (still maintained and simple) r-travis
> setup.  Works for me.  See http://eddelbuettel.github.io/r-travis/  and
> numerous .travis.yml in packages of mine and a few other users.
>
> Dirk
>
> | Thank you both for your attention to this issue!
> |
> | Bests,
> | Marta Karas
> |
> |
> |
> |
> |
> | On Thu, Sep 10, 2020 at 8:35 AM Karim Rahim 
wrote:
> |
> | > Thanks,
> | >
> | > That may be it. It is a missing dependency.
> | >
> | > It's been a while and I'm not sure which package exposes fftw3.h ...
> | >
> | > Karim
> | >
> | > On Thu, Sep 10, 2020 at 8:16 AM Dirk Eddelbuettel 
wrote:
> | >
> | >>
> | >> On 9 September 2020 at 23:45, Karim Rahim wrote:
> | >> |  sudo apt-get install -y fftw3
> | >>
> | >> Or maybe rather
> | >>
> | >>sudo apt-get install libfftw3-dev
> | >>
> | >> to get the development headers?
> | >>
> | >> Dirk
> | >>
> | >> | Then try again.
> | >> |
> | >> | Let me know if it doesn't work.
> | >> |
> | >> | Cheers!
> | >> | Karim
> | >> |
> | >> | On Wed, Sep 9, 2020 at 10:27 PM Max Turgeon <
max.turg...@umanitoba.ca>
> | >> wrote:
> | >> | >
> | >> | > Hi Marta,
> | >> | >
> | >> | > One change I can see from your Git history that seems to match
the
> | >> first failed build on Travis is when you added "Imports: fftwtools"
to your
> | >> DESCRIPTION file. And it makes sense, because if we look at its
DESCRIPTION
> | >> file, we can see that it has fftw3 as a SystemRequirements. In other
words,
> | >> it needs to be installed on Travis before you can run the checks on
your
> | >> package.
> | >> | >
> | >> | > As for solutions, I can see that Karim wrote a short description
of
> | >> how to install the library on Linux, and there's a link for Mac; all
this
> | >> is on the Github repo: https://github.com/krahim/fftwtools
> | >> | >
> | >> | > I also noticed that there is an R package wrapping fftw on CRAN (
> | >> https://cran.r-project.org/package=fftw) and I can see that it's a
> | >> Suggested package for fftwtools. I haven't tried it, but presumably
you
> | >> could install the fftw R package, instead of the fftw3 library.
> | >> | >
> | >> | > HTH,
> | >> | >
> | >> | > Max Turgeon
> | >> | > Assistant Professor
> | >> | > Department of Statistics
> | >> | > Department of Computer Science|
>  >> | > University of Manitoba
> | >> | > maxturgeon.ca
> | >> | >
> | >> | >
> | >> | >
> | >> | > 
> | >> | > From: R-package-devel  on
> | >> behalf of Marta Karaś 
> | >> | > Sent: Wednesday, September 9, 2020 9:09 PM
> | >> | > To: package-develop 
> | >

Re: [R-pkg-devel] Fixing travis build fail due to fftwtools fatal error (fftw3.h: No such file or directory)

2020-09-11 Thread Dirk Eddelbuettel


Hi Karim,

On 11 September 2020 at 13:09, Karim Rahim wrote:
| Thanks for resolving this! It's been awhile since I've worked on this...
| 
| So for dependencies, I'd like to keep it as simple as possible. I agree
| fftw3 may need to be updated.
| 
| It's my understanding that if one were to install the latest fftw (3.3.8)
| from source then it would expose the header file.

Not necessarily and it depends on how the package is setup.

In general you want a '-dev' or '-devel' package but I do not know what this
one is called in the Fedora/RH/CentOS world.
 
| Is this incorrect?
| 
| If this is the case, then it becomes about the various distribution
| specific packages.
| So then I want to aim people in the right direction.
| 
| How about?
| 
| fftw3 (>= 3.1.2; ensure fftw3.h is exposed - libfftw3-dev in Ubuntu)

So per the above I would suggest you reconsider the curl example I emailed
earlier and do something like

  fftw3 development package: libfftw3-dev (deb), . (rpm)

Maybe someone can help with the rpm package name.

Cheers, Dirk

| 
| Kind Regards,
| Karim
| 
| 
| 
| 
| 
| On Fri, Sep 11, 2020 at 11:20 AM Dirk Eddelbuettel  wrote:
| >
| >
| > On 10 September 2020 at 14:14, Marta Karaś wrote:
| > | Adding the following to .travis.yml:
| > |
| > | before_install:
| > |   - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -y install
| > | libfftw3-dev ; fi
| > |
| > | did the trick!
| >
| > I think that is an example of the issue discussed in this blog post:
| >   http://dirk.eddelbuettel.com/blog/2020/08/26#029_introducing_bspm
| >
| > The RSPM system gets you the package, but it is by its (on purpose simple)
| > design disconnected and unaware of the dependency required which sent you
| > down a rabbit hole. (One could also suggest that maybe Karim should expand
| >SystemRequirements:  fftw3 (>= 3.1.2)
| > to maybe list the packages offering fftw3 _headers_. Jeroen uses a pattern
| > for this, eg curl has
| >SystemRequirements:  libcurl: libcurl-devel (rpm) or
| libcurl4-openssl-dev (deb).
| > which is already one step better.)
| >
| > Only systems with actual dependency resolution can go further, but it is
| hard
| > to do that cross-platform / cross-OS.  On Linux we have both BSPM
| utilising
| > the existing rpm and deb binaries, respectively, maintained by tireless
| > volunteers, as well as the older use of directly using the binaries.
| >
| > Eg looking at the Ubuntu binary from the Rutter PPA shows that
| > r-cran-fftwtools will bring the fftw3 runtime in:
| >
| >docker@08d894be427a:/work$ apt-cache show r-cran-fftwtools | grep
| ^Depends
| >Depends: r-base-core, libfftw3-double3 (>= 3.3.5)
| >docker@08d894be427a:/work$
| >
| > That would be an easier binary install as it skips the 'from source' build
| > step that sent Marta hunting for the required header.
| >
| > If I find some time I will try to set up some Travis CI examples utilizing
| > BSPM.  Until then, one can do as I have done for over half a decade and
| point
| > Travis CI to these binaries via the (still maintained and simple) r-travis
| > setup.  Works for me.  See http://eddelbuettel.github.io/r-travis/  and
| > numerous .travis.yml in packages of mine and a few other users.
| >
| > Dirk
| >
| > | Thank you both for your attention to this issue!
| > |
| > | Bests,
| > | Marta Karas
| > |
| > |
| > |
| > |
| > |
| > | On Thu, Sep 10, 2020 at 8:35 AM Karim Rahim 
| wrote:
| > |
| > | > Thanks,
| > | >
| > | > That may be it. It is a missing dependency.
| > | >
| > | > It's been a while and I'm not sure which package exposes fftw3.h ...
| > | >
| > | > Karim
| > | >
| > | > On Thu, Sep 10, 2020 at 8:16 AM Dirk Eddelbuettel 
| wrote:
| > | >
| > | >>
| > | >> On 9 September 2020 at 23:45, Karim Rahim wrote:
| > | >> |  sudo apt-get install -y fftw3
| > | >>
| > | >> Or maybe rather
| > | >>
| > | >>sudo apt-get install libfftw3-dev
| > | >>
| > | >> to get the development headers?
| > | >>
| > | >> Dirk
| > | >>
| > | >> | Then try again.
| > | >> |
| > | >> | Let me know if it doesn't work.
| > | >> |
| > | >> | Cheers!
| > | >> | Karim
| > | >> |
| > | >> | On Wed, Sep 9, 2020 at 10:27 PM Max Turgeon <
| max.turg...@umanitoba.ca>
| > | >> wrote:
| > | >> | >
| > | >> | > Hi Marta,
| > | >> | >
| > | >> | > One change I can see from your Git history that seems to match
| the
| > | >> first failed build on Travis is when you added "Imports: fftwtools"
| to your
| > | >> DESCRIPTION file. And it makes sense, because if we look at its
| DESCRIPTION
| > | >> file, we can see that it has fftw3 as a SystemRequirements. In other
| words,
| > | >> it needs to be installed on Travis before you can run the checks on
| your
| > | >> package.
| > | >> | >
| > | >> | > As for solutions, I can see that Karim wrote a short description
| of
| > | >> how to install the library on Linux, and there's a link for Mac; all
| this
| > | >> is on the Github repo: https://github.com/krahim/fftwtools
| > | >> | >
| > | >> 

[R-pkg-devel] Rcpp with clang++ -stdlib=libc++ ?

2020-09-11 Thread Dr . Jens Oehlschlägel
I can compile a package under clang++ with -stdlib=libstdc++, but with 
-stdlib=libc++ I get

"
In file included from 
/home/jo/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include/Rcpp/r/headers.h:67:
/home/jo/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include/Rcpp/platform/compiler.h:100:10:
 fatal error: 'cmath' file not found
#include 
 ^~~
1 error generated.
"

Is there any howto for using Rcpp with -stdlib=libc++ ?
Greetings from Munich

Jens Oehlschlägel

 
P.S.

Package Makevars
CXX_STD = CXX17
PKG_CXXFLAGS=-O3 -march=native -pthread
PKG_LIBS=-latomic -pthread

~.R/Makevars
CXX17 = clang++ -stdlib=libc++
CXX17FLAGS = -fstack-protector-strong -D_FORTIFY_SOURCE=2 -g $(LTO)
CXX17STD = -std=c++17

> packageVersion("Rcpp")
[1] ‘1.0.5’

> version
   _  
platform   x86_64-pc-linux-gnu
arch   x86_64 
os linux-gnu  
system x86_64, linux-gnu  
status
major  4  
minor  0.2
year   2020   
month  06 
day    22 
svn rev    78730  
language   R  
version.string R version 4.0.2 (2020-06-22)
nickname   Taking Off Again

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel