jupyter-xeus / xeus-r

Jupyter kernel for the R programming language
Other
41 stars 5 forks source link

use `FindR.cmake`, reborrowed from `xtensor-stack/xtensor-r` #1

Closed romainfrancois closed 11 months ago

romainfrancois commented 11 months ago

This borrows FindR.cmake from xtensor-stack/xtensor-r so that we can have find_package(R REQUIRED) and include_directories(${R_INCLUDE_DIR} SYSTEM) in CMakeLists.txt

I'm not sure this is the way, but at least that gives me access to R include files, e.g. R_ext/Constants.h so that in xinterpreter.cpp I can have pub_data["text/plain"] = M_PI;

image

Again, this probably isn't the way, but I have some cmake + condo tech debt :/

I'll follow up with linking to the R libs and calling some code.

romainfrancois commented 11 months ago

... now grabbing some more information in FindR.cmake, ultimately will need to pull in RInside:::CxxFlags() too but at the moment I can't get it to install with mamba:

% mamba install r-rinside

Looking for: ['r-rinside']

conda-forge/noarch                                  12.1MB @  28.2MB/s  0.4s
conda-forge/osx-arm64                                6.7MB @  14.6MB/s  0.5s

Pinned packages:
  - python 3.10.*

Could not solve for environment specs
The following package could not be installed
└─ r-rinside does not exist (perhaps a typo or a missing channel).
SylvainCorlay commented 11 months ago

r-inside has not been packaged for apple silicon on conda-forge:

Screenshot 2023-10-03 at 19 09 08

I will look at why tonight.

romainfrancois commented 11 months ago

Merging this now, and will fix the windows issue in a follow up ...