float icon indicating copy to clipboard operation
float copied to clipboard

Issue with CRAN-built packages in float/rsparse

Open wrathematics opened this issue 6 years ago • 3 comments

Noted here https://github.com/dselivanov/rsparse/issues/25

wrathematics avatar Jul 15 '19 15:07 wrathematics

we can try similar hook as data.table does - run install_name_tool after installation is done.

dselivanov avatar Jul 21 '19 13:07 dselivanov

I've written to r-sig-mac mailing list. Here is answer from Simon:

See R-exts 5.8: you cannot link directly to other package or its libraries. It is not possible is a portable way across platforms for many reasons including those that you are hitting here. If a package exposes some C-level functionality to other packages, you can use it and R provides a way to obtain access to the function - see R-exts 5.4.3. There are ways to make a static library available, because that allows your package to be installed without actually requiring the presence of the other package at install time. But, again, the package has to make it explicitly available since you cannot guarantee that your package won't break as it's technically internal to the other package. That said, it seems the there is a bug in float since it provides the wrong flags to link against its library (float:::ldflags()). It should really just use system.file("libs","libfloat.a",package="float") - you may want to contact the maintainer of float about that. Flags cannot be hard-coded at install time because the package can be installed in any location, moreover staged install is preformed in a direction separate from the R library anyway.

So I believe we need to try with a static library.

dselivanov avatar Jul 26 '19 12:07 dselivanov

Interesting, thanks. I don't think float:::ldflags(static=TRUE) is bugged (probably too complicated though). It should work as-is. I'll take a look this weekend.

wrathematics avatar Jul 26 '19 12:07 wrathematics