Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
much_cheese
Frequent Visitor

Rcpp can't find compiler on Power BI service

Hello,

 

I'm trying to include some c++ code into a R visual script. I have no problem when doing so on Power BI desktop, but after publihsing to the service, I get the following error, despite Power BI services supposedly supporting the Rcpp library:

Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, :

Error 65535 occurred building shared library.

WARNING: The tools required to build C++ code for R were not found.

Please download and install the appropriate version of Rtools: http://cran.r-project.org/bin/windows/Rtools/

 

From this I understand that Rcpp can't find the c++ compiler. Is there anything I can do to point Rcpp to the compiler (and if so, how/where to point ?)

1 ACCEPTED SOLUTION
much_cheese
Frequent Visitor

Update:

 

I contacted microsoft support and they told me that "Rcpp" package is supported but not the "Rtools" package, on which Rcpp depends to compile c++ code. IMO this should mean that "Rcpp" should be delisted as supported package, as it's really rather pointless without Rtools, but they are very adament about keeping the "Rcpp" listed as a supported package, so there will probably be no change.

In summary, you can't use Rcpp on powerBI service and there is no plan to change that.

 

Best Regards 🙂

View solution in original post

5 REPLIES 5
much_cheese
Frequent Visitor

Update:

 

I contacted microsoft support and they told me that "Rcpp" package is supported but not the "Rtools" package, on which Rcpp depends to compile c++ code. IMO this should mean that "Rcpp" should be delisted as supported package, as it's really rather pointless without Rtools, but they are very adament about keeping the "Rcpp" listed as a supported package, so there will probably be no change.

In summary, you can't use Rcpp on powerBI service and there is no plan to change that.

 

Best Regards 🙂

v-yueyunzh-msft
Community Support
Community Support

Hi , @much_cheese 

According to your description, it work fine in Power BI Desktop but in Service it takes an error.

you can refer to these document to ensure that it meets the prerequisites and there are no restrictions:

viewing-r-visuals-in-the-power-bi-service 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @v-yueyunzh-msft 

It indeed works fine on Power BI Desktop. I've went through the link you sent (again), and still it seems to me all prerequisits are being met. The only thing that catches my attention, is that it's stated that the R scripts are run in a "sandbox environment"

 

The Power BI service applies a sandbox technology to protect users and the service from security risks.

This sandbox approach imposes some restrictions on the R scripts running in the Power BI service, such as accessing the Internet, or accessing to other resources that aren't required to create the R visual.

 

So perhaps this sandbox environment doesn't have access to a c++ compiler. But if this is the case, I feel like the enitre Rcpp library is rendered useless, and therefore should not be listed as supported.


Another thought that crossed my mind, and I'm not entirely sure how Azure is handled in different organisations (like each organisation using the same environments, or does each organisation setup it's own environment ?) is that maybe my organisation doesn't have the environment setup right or something. Could someone mabye run the simple R script from my earlier reply on their Power BI Service, to see if they get the same error ?

much_cheese
Frequent Visitor

@Greg_DecklerNot that I can tell. Even something as basic as this throws the error:

library(Rcpp)

cppFunction("int addCpp(int a, int b) {return a+b;}")
 
The cppFunction R function is already in Rcpp version 1.0.1 (https://www.rdocumentation.org/packages/Rcpp/versions/1.0.1/topics/cppFunction)
Greg_Deckler
Super User
Super User

@much_cheese The Service supports Rcpp version 1.0.1. The current version is 1.0.9, are you using something from a later version?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors