Using C/C++ Modules in Meteor Tutorial - meteor

Does anyone have a tutorial how to use a C++ module from NPM in Meteor? Running the normal: meteor npm install and importing with the package returns this message.
Error: module.useNode() must succeed for native .node modules

You're probably using an unusual server configuration. Some common problems that break compilation are:
Incorrect permissions for various directories. This may mean you've been running as root for some meteor installation commands, which then prevents the local user's access to those directories for compilation.
A missing or broken compiler toolchain.
A bad package or one that is untested for your hosting platform.
I'd discourage you from trying to run locally on an desktop Linux installation if you're unfamiliar with some of these gotchas. Use a virtual machine for development. I'd recommend Vagrant using IntelliJ's WebStorm for native integration.
Meteor is generally deployed on Linux using the Amazon AMI or Ubuntu on AWS, Galaxy or Modulus.
If you think everything's in order and you're having issues with Galaxy or Modulus, reach out to their support.

Related

Use R / Pyhon from GraalVM on Non-Graal JDK

Is it possible to use R and Python using GraalVM / Truffle in a Java program on a standard OpenJDK / OracleJDK? I am able to run Javascript by simply including org.graalvm.js and org.graalvm.truffle in Maven, but I cannot find packages for R or Python to do the same.
Ideally the application would always run in GrallVM and it wouldn't be an issue, however I do not have any control over which actual VM my customers use for my application. Although I may recommend GraalVM, my customers might have valid reasons for using alternate JVMs since they will generally have to perform their own internal security audits and validations and would therefore accept only the specific VMs that they've certified for use in their environments which may or may not include GraalVM.
In short: GraalVM R and GraalVM Python, unlike GraalVM JavaScript, need more than just a jar file to run: the standard library and in case of R also native libraries. Python can do without native libraries, but using them improves compatibility.
You could bundle all that and configure the right options for your stock JDK, but for the time being this is not a scenario that is actively supported by those projects. Not saying it wouldn't work.
Details: https://github.com/oracle/graalpython/issues/96

Best (standard) way to deploy the libraries for a shiny app to the shiny server?

I'm trying to get a shiny app deployed on Shiny Server. I can do that without any issues, but when trying to deploy an app that has a number of dependencies (remote and local) we keep running into issues.
We used renv to track the dependencies (on the Windows dev box) and rebuild it from scratch on the Linux prod box, but even though the dependencies are rebuilt and some get loaded, others do not. The .Rprofile of the user running the app is pointing to the renv activation script.
For the sake of clarity, we need and want all the R code to be built from the source code on the Linux box.
What is the best or standard way (or even a poor way that works) to deploy the libraries for a shiny app to the shiny server? Is renv even the right tool for this scenario or is there a better tool?
I've tried reading the shiny server documentation and the closes it only mentions that it uses the .Rprofile of the user running the app, but there doesn't seem to be any sort of guide on the best way to deploy dependent libraries.
This renv documentation discusses some reproducibility caveats:
system dependencies, and
changes in CRAN (e.g. a binary no longer being available).
Since you are moving from a Windows to a Linux system your packages may have unmet system dependencies (things that need to be installed outside of R) that you didn't encounter in Windows. For example, rJava is required for some of the Excel-related R packages, and getting its related system dependencies installed and working on Linux can sometime be a challenge. You can use the RStudio Package Manager Website to figure out what system dependencies are required for different R packages for your particular Linux OS. Also, the error messages you get when running these apps on Linux should point you in the right direction. These system dependencies are what you'll have to manage yourself since renv doesn't.
But for a more production-level solution you can try Docker and ShinyProxy. For apps with many dependencies or especially external dependencies (e.g. Python, SQL, etc.) you can guarantee more reproducibility using Docker. ShinyProxy can be used to host apps built into docker images. This is more work, but you ensure the entire system is reproducible, not just the R version and R packages. ShinyProxy also adds additional hosting capabilities like user authentication.

running grails locally with no external network connectivity

I was trying to run grails on a computer with no internet connectivity but was not able to do so. The error I observed is copied below.
Error Resolve error obtaining dependencies - Failed to read artifact descriptor for xalan:serializer:jar:2.7.1
Error Required Grails build dependencies were not found. This is normally due to internet connectivity issues or missing repositories in grails-app/conf/BuildConfig.groovy. Please verify your configuration to continue.
I could not locate any config settings that I could change in BuildConfig.groovy or any other groovy file that would allow me to run a grails app (on Windows) with no internet connectivity. I am sure there must be some settings which allow me to run a grails app without internet connectivity - can anyone possibly shed some light on this?
Thanks
You don't need Internet connectivity to run grails app locally.
But you need to have your app dependencies downloaded in local Ivy cache - so you need Internet connectivity at least for the first run/compile of your app.
After that you should be able to run it without Internet connectivity.
Though Grails does not require internet conncetivity to run, the Grails software relies on other code which is hosted online. You will need to either download all of the dependencies, (I'm not sure where you would even find them all), or connect to the internet for your initial run.
Once you are online, type grails run-app in the console, let that download all the dependencies, then feel free to take it offline!

Configuring CMake to build with Xcode

I am involved in development of a large cross platform project that build for Windows, Linux, and Mac OS X. The build for the software is configured with CMake.
The CMake scripts have been designed to configure successfully for Visual Studio on Windows, and Makefiles are currently used for building on Linux and Mac OS X.
Pretty much all of the development for the project so far has been done with people working on Windows, and a little bit of work on Linux. I am interested in developing for the project using Xcode 4.6 on a Macintosh running Mac OS X 10.7, and I have encountering problems as the CMake files do not seem to configure properly for that development environment.
For non-windows platforms many custom commands have been written to try to configure things such as copying needed files or setting environments that are needed for certain operations such as running unit tests during the build process.
It seems that because Xcode is an integrated development environment simliar to Visual Studio is has this concept of a build configuration, and when software gets build output files in up in a directory path that includes that configuration concept (i.e. many build files end up in a path that ends with folder named something like Debug, Release, etc.)
CMake is supposed to have support for dealing with this build configuration concept and the mechanism utilized work well for Visual Studio. That do no seem to work for Xcode. For example our build engineers have design CMake scripts so that for Windows, many path and whatnot are configured using the CMAKE_CFG_INTDIR value which helps to qualify the build configuration.
The use of CMAKE_CFG_INTDIR is not working for Xcode as the script for Macintosh were written with Makefiles in mind which don't really have the build configuration concept. The use of CMAKE_CFG_INTDIR within custom commands used to configure things fails on the Macintosh as the value resolves to $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME). This values are not define when the custom commands are run, so values are not set properly and build operations fail.
It is unclear what is needed so that the system can successfully configure for Xcode. Searching on the Internet so far has not yielded insight into what should be used to make sure that build configuration can be successful. What resources are available that would help in figuring out how to configure this project to build with Xcode?
If you're talking about custom commands set using add_custom_command, then you should prefer "generator expressions" to avoid issues regarding per-configuration build directories. From the docs for add_custom_command:
Arguments to COMMAND may use "generator expressions" with the syntax "$<...>". Generator expressions are evaluated during build system generation to produce information specific to each build configuration.
For example, the build directory for a target called "MyExe" could be referred to as $<TARGET_FILE_DIR:MyExe>
Generator expressions are available in a few CMake commands, not just add_custom_command.
If you have more specific problems, it's maybe worth asking further question(s) with the relevant details.

Meteor.js on Synology NAS

Is it possible to deploy a meteor-app to a Synology NAS and run it from there? If so, how?
I guess I need a node.js server to run on my NAS, but I do not know what to do when it is up and running.
Since the Synology NAS is built ontop of linux so you could meteor running on it.
Because some of Synology's NAS units use ARM cpu's you would need to compile meteor for ARM (meaning its dependencies such as MongoDB and Node, all of which should be possible).
Have a look at http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have to determine if your nas' CPU is x86 or ARM. If it is ARM you'll have to build the binaries from source. If its x86 you could probably just run curl https://install.meteor.com | sh
Have a look at https://github.com/meteor/meteor#slow-start-for-developers to build a dev bundle on your
unit.
Meteor can also be deployed as a normal node.JS Application with meteor deploy or you can use demeteorizer (https://www.npmjs.com/package/demeteorizer)
For details please check here: https://guide.meteor.com/deployment.html

Resources