Skip to content

Compile NodeJS for RoboRio using cross compiler

Blake Bourque edited this page Dec 16, 2018 · 5 revisions

Building NodeJS from source (10.14.2) On Linux Mint 18.1 (Ubuntu 16.04)

Step 1: Install the cross compiler tool chains from http://first.wpi.edu/FRC/roborio/toolchains/

  1. sudo add-apt-repository ppa:wpilib/toolchain
  2. sudo apt-get update
  3. sudo apt install frc-toolchain

Step 2: Acquire NodeJS source code https://nodejs.org/en/download/

  1. wget https://nodejs.org/dist/v10.14.2/node-v10.14.2.tar.gz
  2. tar xf node-v10.14.2.tar.gz
  3. cd node-v10.14.2

Step 3: Dependencies

  1. sudo apt-get install gcc-multilib g++-multilib libc6-dev-i386

Step 4: Build


CC=arm-frc-linux-gnueabi-gcc CXX=arm-frc-linux-gnueabi-g++ \
CC_host="gcc -m32" CXX_host="g++ -m32" \
 ./configure --prefix=../install --dest-cpu=arm --cross-compiling --dest-os=linux \
 --with-arm-float-abi=softfp --with-arm-fpu=vfpv3

//Based on Chris Lea's work: https://chrislea.com/2018/08/20/cross-compiling-node-js-for-arm-on-ubuntu/ Step 5: Success

admin@roboRIO-VM:~/node-v10.14.2/bin# ./node --version
v10.14.2

possibly of interest (but old) https://gist.github.com/Gioyik/7895192

Clone this wiki locally