Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: APoloG13 on December 23, 2016, 03:20:23 pm

Title: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 03:20:23 pm
Hi everyone,

I'm opening this post because i want some help to write a program in C for the TI Nspire (actually I have in mind a few programs... ) but first thing first... How it's done?

How do you do to write a C program for the Nspire? (I started trying to install the Ndless SDK but ended on a big failure and I don't know how to do it properly :banghead:)

Thanks omnimaga community
Title: Re: How to create a C program for Nspire CX CAS?
Post by: mdr1 on December 23, 2016, 03:43:22 pm
Hello APoloG13,

You can find the tutorial here: https://github.com/ndless-nspire/Ndless/wiki/Ndless-SDK:-C-and-assembly-development-introduction

What failure do you get and at which step?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 03:48:29 pm
Also, what OS are you using?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 03:58:47 pm
i'm using Windows10 and the problem is when you have to Run the SDK's build_toolchain.sh script,

cd ndless-sdk/toolchain/
./build_toolchain.sh

look:
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 04:09:27 pm
https://hackspire.org/index.php/C_and_assembly_development_introduction#On_Windows (https://hackspire.org/index.php/C_and_assembly_development_introduction#On_Windows)

You have to install the dependencies listed:
Quote
php (5.6+), libboost-devel, libboost_program_options*, binutils, gcc-core, gcc-g++, git, mpfr, mpfr-devel, gmp, libgmp-devel, libmpc3, libmpc-devel, openssl-dev, make, texinfo, zlib-devel, wget
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 04:10:37 pm
So now i have to re-install Cygwin ?  :banghead: :banghead:
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 04:14:43 pm
No, you just have to install the extra packages. To do that, you have to run the Cygwin installer again. But it won't get rid of your installation, it will just add whatever you tell it to add.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 04:15:58 pm
And what dependence are? Because i'm writing and didn't find it
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 04:16:40 pm
These ones:
php (5.6+), libboost-devel, libboost_program_options*, binutils, gcc-core, gcc-g++, git, mpfr, mpfr-devel, gmp, libgmp-devel, libmpc3, libmpc-devel, openssl-dev, make, texinfo, zlib-devel, wget
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 04:19:49 pm
These ones:
php (5.6+), libboost-devel, libboost_program_options*, binutils, gcc-core, gcc-g++, git, mpfr, mpfr-devel, gmp, libgmp-devel, libmpc3, libmpc-devel, openssl-dev, make, texinfo, zlib-devel, wget

The missing ones... Sorry my question wasn't accurate enough  ;D
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 04:22:42 pm
I don't understand your question, those are the packages you have to install. What difficulties are you running into?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 05:16:01 pm
I'm reinstalling right now so I hope i don't miss any of them. Thanks for helping me i know it's not easy



Ok now it's a half success, I ended with this  ??? ???

Edit (Eeems): Merged double post
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 06:01:10 pm
If you run "ls -a" what do you get?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 06:10:40 pm
.                .downloaded    build               gcc-6.2.0  newlib-2.4.0
..               .gitignore     build_toolchain.sh  gdb-7.12
.built_binutils  binutils-2.27  download            install

that is what i get
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 06:13:52 pm
OK, so it failed on GCC step 1. If you cd to build and run "make all-gcc" what is the output?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 06:20:12 pm
pc@   /cygdrive/f/Ndless/ndless-sdk/toolchain
$ make all-gcc
make: *** No hay ninguna regla para construir el objetivo 'all-gcc'.  Alto.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 06:20:43 pm
cd to build before running that.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 06:24:37 pm
The same

pc@ /cygdrive/f/Ndless/ndless-sdk/toolchain/build
$ make all-gc
make: *** No hay ninguna regla para construir el objetivo 'all-gc'.  Alto.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 06:25:27 pm
all-gcc, not all-gc
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 06:58:30 pm
Ok, all-gcc ended with:

6.2.0/gcc/doc/gccint.texi; \
fi
if [ xinfo = xinfo ]; then \
        makeinfo --split-size=5000000 --no-split -I ../../gcc-6.2.0/gcc/doc \
                -I ../../gcc-6.2.0/gcc/doc/include -o doc/gccinstall.info ../../                 gcc-6.2.0/gcc/doc/install.texi; \
fi
if [ xinfo = xinfo ]; then \
        makeinfo --split-size=5000000 --no-split -I . -I ../../gcc-6.2.0/gcc/doc                  \
                -I ../../gcc-6.2.0/gcc/doc/include -o doc/cppinternals.info ../.                 ./gcc-6.2.0/gcc/doc/cppinternals.texi; \
fi
echo timestamp > gcc.pod
perl ../../gcc-6.2.0/gcc/../contrib/texi2pod.pl ../../gcc-6.2.0/gcc/doc/invoke.t                 exi > gcc.pod
echo timestamp > doc/gcc.1
(pod2man --center="GNU" --release="gcc-6.2.0" --date=2016-08-22 --section=1 gcc.                 pod > doc/gcc.1.T$$ && \
        mv -f doc/gcc.1.T$$ doc/gcc.1) || \
        (rm -f doc/gcc.1.T$$ && exit 1)
cp doc/gcc.1 doc/g++.1
rm gcc.pod
make[1]: se sale del directorio '/cygdrive/f/Ndless/ndless-sdk/toolchain/build/g                 cc'

now?
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 07:01:21 pm
Run make install-gcc && cd .. && rm -rf build/* && touch .built_gcc_step1.

Then go to the toolchain directory and run ./build_toolchain.sh
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 07:05:39 pm
pc@ /cygdrive/f/Ndless/ndless-sdk/toolchain/build
$ install-gcc && cd .. && rm -rf build/* && touch .built_gcc_step1
-bash: install-gcc: no se encontrĂ³ la orden
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 07:08:03 pm
Code: [Select]
make install-gcc && cd .. && rm -rf build/* && touch .built_gcc_step1
You forgot the make.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 07:13:48 pm
Done. What's next? after runing ./build_toolchain.sh (you will end killing me jajaja)
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 07:18:36 pm
Did build_toolchain.sh finish successfully? I doubt it finished that quickly.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 07:42:35 pm
It ended with two blue screen the two time i did it XD
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 07:56:51 pm
I have never done this on Windows myself, so I don't know what to do if you get a BSOD from running that script.
This stuff is very easy to configure on GNU/Linux, if you have an installation somewhere.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: APoloG13 on December 23, 2016, 08:00:01 pm
Only have W10... so I will try for the 3rd time hope no more BSOD...
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Legimet on December 23, 2016, 08:03:09 pm
You can file an issue at https://github.com/ndless-nspire/Ndless/issues. I think @Vogtinator has an actual Windows machine, so he might be able to help you better than I can.
Title: Re: How to create a C program for Nspire CX CAS?
Post by: Vogtinator on December 24, 2016, 07:10:58 am
I don't have a windows VM anymore, but you could try running WSL: https://msdn.microsoft.com/de-de/commandline/wsl/install_guide