fish does not read ~/.bashrc, so also write ~/.config/fish/conf.d/ndless.fish when ~/.config/fish exists. Ignore the Ndless/ clone created when running from the repo folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| NdlessSDK_AutoInstall.py | ||
| README.md | ||
Ndless SDK Automated Installer
A Python script that installs the Ndless SDK on Debian or Ubuntu. It builds everything you need to write C/C++ programs for the TI-Nspire.
By default, it installs Ndless r2023.
What the script does
- Installs the build dependencies with
apt. - Clones Ndless at the chosen version, with its git submodules.
- Builds the ARM toolchain (binutils, gcc, newlib, gdb) with
build_toolchain.sh. - Adds the toolchain and SDK to your
PATHin~/.bashrc, and in~/.config/fish/conf.d/ndless.fishif you use fish. - Builds the SDK and Ndless.
- Checks that
nspire-gcc,genzehnandmake-prgwork.
The toolchain build can take from several minutes to a few hours, depending on your machine.
Requirements
- Debian, Ubuntu or another distribution based on them (tested package names: Ubuntu 26.04).
- Python 3.
sudorights.- Several GB of free disk space for the toolchain build.
- A path without spaces.
Usage
Go to the folder where you want the Ndless/ folder to be created, then run:
sudo python3 NdlessSDK_AutoInstall.py
Run it with sudo from your normal user account, not from a root shell.
Only apt runs as root. The clone and the build belong to your user.
Options
| Option | Description | Default |
|---|---|---|
--version VERSION |
Ndless git tag or branch to install, for example r2022 or master |
r2023 |
--dir DIR |
Folder where Ndless/ is cloned |
current folder |
-j N, --jobs N |
Number of parallel build jobs | number of CPU cores |
-y, --yes |
Do not ask for confirmation | off |
Examples:
# Install r2023 in ~/dev with 8 build jobs, without confirmation
sudo python3 NdlessSDK_AutoInstall.py --dir ~/dev -j 8 -y
# Install the latest development code
sudo python3 NdlessSDK_AutoInstall.py --version master
Running it again
You can run the script again on an existing install.
It reuses the Ndless/ folder, switches it to the chosen version, and only rebuilds what changed.
It does not add the PATH line to ~/.bashrc twice.
After the installation
Open a new terminal, or reload your shell config:
source ~/.bashrc # bash
source ~/.config/fish/conf.d/ndless.fish # fish
fish cannot read ~/.bashrc. The script writes the fish file only if ~/.config/fish exists.
Check the compiler:
nspire-gcc --version
To start a project, copy a sample from Ndless/ndless-sdk/samples, or create one in an empty folder:
nspire-tools new myproject # creates a Makefile that builds myproject.tns
nspire-tools main # creates an empty main.c
make
The files to send to the calculator (ndless_installer_*.tns, ndless_resources.tns) are in Ndless/ndless/calcbin.
See the Ndless README to pick the right installer for your OS version.
Troubleshooting
- "this script must run as root": start it with
sudo. - "run this script through sudo from your normal user account": you started it from a root shell. Exit the root shell and use
sudofrom your user. - "your path contains blank characters": the Ndless build does not support spaces in paths. Use
--dirto choose another folder. - The toolchain build fails: read the output above the error. It is often a missing package or a network problem while downloading the sources. Run the script again: the steps that already finished are skipped.
- Out of memory during the build: lower the number of jobs, for example
-j 4.
Credits
- Original script by trueToastedCode.
- Ndless by the Ndless team.