OpenBSD ports: PostgreSQL PL/R

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

OpenBSD ports: PostgreSQL PL/R

Adam Jensen
Would it be difficult or awkward in any way to include PL/R [1] along
with the PostgreSQL and R ports?

[1]: <http://www.joeconway.com/doc/doc.html>

If PostGIS [2] were also included then that creates an interesting Data
Science capability that even FreeBSD currently lacks.

[2]: <http://postgis.net/>

As long as I am presenting a wish list of sorts, include a carefully
integrated port of RStudio [3,4] and that could make OpenBSD a very
attractive developer/researcher platform for this arena.

[3]: <https://www.rstudio.com/>
[4]: <https://github.com/rstudio/rstudio/>

Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD ports: PostgreSQL PL/R

Landry Breuil-5
On Mon, Oct 30, 2017 at 03:28:23PM -0400, Adam Jensen wrote:
> Would it be difficult or awkward in any way to include PL/R [1] along
> with the PostgreSQL and R ports?
>
> [1]: <http://www.joeconway.com/doc/doc.html>
>
> If PostGIS [2] were also included then that creates an interesting Data
> Science capability that even FreeBSD currently lacks.
>
> [2]: <http://postgis.net/>

Postgis is already in geo/postgis.

Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD ports: PostgreSQL PL/R

Ingo Feinerer-2
In reply to this post by Adam Jensen
On Mon, Oct 30, 2017 at 03:28:23PM -0400, Adam Jensen wrote:
> Would it be difficult or awkward in any way to include PL/R [1] along
> with the PostgreSQL and R ports?
>
> [1]: <http://www.joeconway.com/doc/doc.html>

(Without having tried) I do not see big obstacles in creating a port for
it. According to https://github.com/postgres-plr/plr/ you need

- R headers are required.

  Done: The math/R package includes all headers.

- R must have been built with the --enable-R-shlib option.

  Done: math/R is configured with "--enable-R-shlib" (see CONFIGURE_ARGS
  in math/R/Makefile).

- R_HOME must be defined in the environment of the user under which
  PostgreSQL is started, before the postmaster is started.
 
  That does not affect the port (probably a pkg/README mentioning this
  fact suffices).

http://www.joeconway.com/doc/plr-install.html shows relevant steps.
Moreover, there are already databases/postgresql-plv8 and
databases/postgresql-pllua in the ports tree which you can use as
inspiration/template.

> As long as I am presenting a wish list of sorts, include a carefully
> integrated port of RStudio [3,4] and that could make OpenBSD a very
> attractive developer/researcher platform for this arena.
>
> [3]: <https://www.rstudio.com/>
> [4]: <https://github.com/rstudio/rstudio/>

If I remember correctly RStudio has a ton of included dependencies. It
probably takes a lot of effort to create a port for it.

IMHO: vim + NvimR (https://github.com/jalvesaq/Nvim-R) or emacs + ESS
(https://ess.r-project.org/) work well (enough for me). Most of the
RStudio R packages can be used without RStudio (like
https://github.com/jimhester/lintr) so you have almost the same
functionality.

Best regards,
Ingo

Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD ports: PostgreSQL PL/R

Jeremy Evans
On Tue, Oct 31, 2017 at 3:17 PM, Ingo Feinerer <[hidden email]> wrote:

> On Mon, Oct 30, 2017 at 03:28:23PM -0400, Adam Jensen wrote:
> > Would it be difficult or awkward in any way to include PL/R [1] along
> > with the PostgreSQL and R ports?
> >
> > [1]: <http://www.joeconway.com/doc/doc.html>
>
> (Without having tried) I do not see big obstacles in creating a port for
> it.


Indeed. I worked on a port for PL/R during p2k12, but it never received an
OK and didn't get committed:

https://marc.info/?l=openbsd-ports&m=134987038209838&w=2

If anyone wants to give a shot at updating that port or submitting a new
port for PL/R within a week, I'll be happy to review it.

Thanks,
Jeremy
Reply | Threaded
Open this post in threaded view
|

Re: OpenBSD ports: PostgreSQL PL/R

Ingo Feinerer-2
In reply to this post by Adam Jensen
Jeremy Evans wrote:
> Indeed. I worked on a port for PL/R during p2k12, but it never received an
> OK and didn't get committed:
>
> https://marc.info/?l=openbsd-ports&m=134987038209838&w=2
>
> If anyone wants to give a shot at updating that port or submitting a new
> port for PL/R within a week, I'll be happy to review it.

Based on your existing work it was easy to update (see attachment).

"OK feinerer@" if you want to import it after your review.

Remarks:

- I had to increase openfiles in login.conf (as suggested in the "Tuning for
  busy servers" section of databases/postgresql/pkg/README-server) so that R
  is able to initialize. I do not know if that is worth a pkg/MESSAGE. Your
  original note in your pkg/MESSAGE on pthread seems no issue any longer.

- "make port-lib-depends-check" reports

  Bogus WANTLIB: R.33 (/usr/local/lib/postgresql/plr.so) (NOT REACHABLE)

  I *think* this is fine in this case because of the RPATH mangling (and there
  is a proper LIB_DEPENDS).

Works fine for me on amd64 (tested with "CREATE EXTENSION plr;" and then
several examples from expected/plr.out (located in $WRKDIST after "make extract")).

Best regards,
Ingo

postgresql-plr.tar.gz (1K) Download Attachment