π
<-
Chat plein-écran
[^]

Can´t compile KhiCas| gmp.h missing?

C, C++, ASM...

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby SuperXX » 16 Jun 2021, 17:23

parisse wrote:Did you unarchive the file?

Yes I had. I've extracted it and copied the ndless-sdk folder that was inside the archive on my ndless-sdk. I've checked and the additional files at the toolchain folder were there.

Here are some screenshots from the directories, so you can confirm if everything is all right:
Image
Image
Image
Image
Image
User avatar
SuperXX
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 57.1%
 
Posts: 40
Joined: 15 May 2021, 10:25
Gender: Male
Calculator(s):

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby parisse » 17 Jun 2021, 10:58

Maybe, add explicitly the paths in the Makefile.nspire file with -I in CXXFLAGS/CFLAGS (-Iinclude_path) and -L in LDFLAGS (-Llib_path)
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 24.6%
 
Posts: 2483
Joined: 13 Dec 2013, 16:35
Gender: Not specified

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby SuperXX » 18 Jun 2021, 14:37

parisse wrote:Maybe, add explicitly the paths in the Makefile.nspire file with -I in CXXFLAGS/CFLAGS (-Iinclude_path) and -L in LDFLAGS (-Llib_path)


Ok, so I've tried to edit the file to modify the directory specified on the makefile from this:
Code: Select all
GCCFLAGS = -g -Os -marm  -I/Users/parisse/Ndless-r2015/ndless-sdk/toolchain/install/include  -fno-strict-aliasing -DHAVE_CONFIG_H -I. -I..   -DIN_GIAC -DTIMEOUT -DNSPIRE_NEWLIB-DKHICAS -DNO_PHYSICAL_CONSTANTS -DSTATIC_BUILTIN_LEXER_FUNCTIONS -DGIAC_BINARY_ARCHIVE -DNO_UNARY_FUNCTION_COMPOSE -DTIMEOUT -DNO_STDEXCEPT -fno exceptions -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-11-08\" -DCONFIG_BIGNUM  $(FLTO)  -DMICROPY_LIB  -DQUICKJS  # -DBF2GMP # -DNSPIRE_LED #-DGIAC_GENERIC_CONSTANTS -ffunction-sections -fdata-sections

LDFLAGS = -g -Wl,--nspireio,--gc-sections -L/Users/parisse/Ndless-r2015/ndless-sdk/toolchain/install/lib $(FLTO) -lmicropy -lmpfi -lmpfr -lgmp  #


To this:
Code: Select all
GCCFLAGS = -g -Os -marm  -I/home/anonymous/Ndless/ndless-sdk/toolchain/install/include  -fno-strict-aliasing -DHAVE_CONFIG_H -I. -I..   -DIN_GIAC -DTIMEOUT -DNSPIRE_NEWLIB -DKHICAS -DNO_PHYSICAL_CONSTANTS -DSTATIC_BUILTIN_LEXER_FUNCTIONS -DGIAC_BINARY_ARCHIVE -DNO_UNARY_FUNCTION_COMPOSE -DTIMEOUT -DNO_STDEXCEPT -fno-exceptions -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-11-08\" -DCONFIG_BIGNUM  $(FLTO)  -DMICROPY_LIB  -DQUICKJS  # -DBF2GMP # -DNSPIRE_LED # -DGIAC_GENERIC_CONSTANTS -ffunction-sections -fdata-sections
LDFLAGS = -g -Wl,--nspireio,--gc-sections -L/home/anonymous/Ndless/ndless-sdk/toolchain/install/lib $(FLTO) -lmicropy -lmpfi -lmpfr -lgmp  #


Which has the directories of my user and the Ndless-sdk


But, it still gives me the same error. But I think Iḿ doing this right. Can you check if what's wrong right?

Image
Image

Full Makefile.nspire code:
Code: Select all
# arm-none-eabi-gdb -i=mi -ex "target remote localhost:3333" giac.elf
# Makefile for nspire
# for CX II activate --use-lcd-blit true, for CX HW-W do not activate
# ?? try --mthumb-interwork -mthumb
# adjust path to your install and
# make sure you have done
# /bin/cp config.h.nspire config.h
# before compiling with make -f Makefile.nspire
GCC = nspire-gcc
CXX = nspire-g++
LD = nspire-ld
FLTO = # -flto
# FLTO =
# with -DKHICAS check that kdisplay.o kadd.o k_csdk.o are in GIACOBJS
#GCCFLAGS = -g -Os -marm -I/Users/parisse/Ndless/ndless-sdk/toolchain/install/include  -fno-strict-aliasing -DHAVE_CONFIG_H -I. -I..  -DIN_GIAC -DTIMEOUT -DNSPIRE_NEWLIB  -DNO_PHYSICAL_CONSTANTS -DNO_STDEXCEPT -DSTATIC_BUILTIN_LEXER_FUNCTIONS -DGIAC_BINARY_ARCHIVE -DNO_UNARY_FUNCTION_COMPOSE -DTIMEOUT -fno-exceptions # -DGIAC_GENERIC_CONSTANTS -ffunction-sections -fdata-sections
GCCFLAGS = -g -Os -marm  -I/home/anonymous/Ndless/ndless-sdk/toolchain/install/include  -fno-strict-aliasing -DHAVE_CONFIG_H -I. -I..   -DIN_GIAC -DTIMEOUT -DNSPIRE_NEWLIB -DKHICAS -DNO_PHYSICAL_CONSTANTS -DSTATIC_BUILTIN_LEXER_FUNCTIONS -DGIAC_BINARY_ARCHIVE -DNO_UNARY_FUNCTION_COMPOSE -DTIMEOUT -DNO_STDEXCEPT -fno-exceptions -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-11-08\" -DCONFIG_BIGNUM  $(FLTO)  -DMICROPY_LIB  -DQUICKJS  # -DBF2GMP # -DNSPIRE_LED # -DGIAC_GENERIC_CONSTANTS -ffunction-sections -fdata-sections
LDFLAGS = -g -Wl,--nspireio,--gc-sections -L/home/anonymous/Ndless/ndless-sdk/toolchain/install/lib $(FLTO) -lmicropy -lmpfi -lmpfr -lgmp  #
#GCCFLAGS =  -marm -I~/Ndless/ndless-sdk/include -Os -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -DHAVE_CONFIG_H -I. -I..  -DIN_GIAC -DNO_PHYSICAL_CONSTANTS -DHAVE_CONFIG_H -DNO_STDEXCEPT -DSTATIC_BUILTIN_LEXER_FUNCTIONS -DGIAC_BINARY_ARCHIVE -DNO_UNARY_FUNCTION_COMPOSE -DTIMEOUT -DNO_TEMPLATE_MULTGCD -DUSE_GMP_REPLACEMENTS -DNSPIRE_NEWLIB
#LDFLAGS = -Wl,--nspireio,--gc-sections -ltommath
GENZEHN = genzehn

EXE = luagiac.luax.tns

OBJS = sym2poly.o gausspol.o threaded.o maple.o ti89.o mathml.o moyal.o misc.o permu.o desolve.o input_parser.o symbolic.o index.o modpoly.o modfactor.o ezgcd.o derive.o solve.o intg.o intgab.o risch.o lin.o series.o subst.o vecteur.o sparse.o csturm.o tex.o global.o ifactor.o alg_ext.o gauss.o isom.o help.o plot.o plot3d.o rpn.o prog.o pari.o cocoa.o unary.o usual.o identificateur.o gen.o input_lexer.o tinymt32.o first.o quater.o kdisplay.o k_csdk.o kadd.o quickjs.o libregexp.o libunicode.o cutils.o quickjs-libc.o libbf.o qjscalcjs.o caseval.o graphic.o tijs.o qjsgiac.o # sha256.o
# sha256 is already available in micropython (struct SHA256_CTX renamed as CRYAL_SHA256_CTX)
DISTDIR = .
vpath %.tns $(DISTDIR)

all: $(EXE) khicaslua.tns khicas.tns khicas.zip

.cc.o:
   $(CXX) $(GCCFLAGS") -c $<

.c.o:
   $(GCC) $(GCCFLAGS) -c $<

tijs.o: tijs.js
   arm-none-eabi-objcopy --input binary --output arm-none-eabi --binary-architecture arm $< $@

qjscalcjs.o: qjscalcjs.js
   arm-none-eabi-objcopy --input binary --output arm-none-eabi --binary-architecture arm $< $@

luagiac.o: luagiac.c
   $(GCC) -Os -Wall -W -marm -c $<

missing.o: missing.c
   $(GCC) -Os -Wall -W -marm -c $<

luagiac.luax.elf: $(OBJS)  luagiac.o luabridge.o
   $(LD) $^ -o $(DISTDIR)/$@ $(LDFLAGS")

luagiac.luax.tns.zehn: luagiac.luax.elf
   $(GENZEHN) --compress --input $(DISTDIR)/$^ --output $(DISTDIR)/$@ --name "luagiac"  --uses-lcd-blit true # --240x320-support true
#   $(GENZEHN)  --input $(DISTDIR)/$^ --output $(DISTDIR)/$@ --name "luagiac" --uses-lcd-blit true

luagiac.luax.tns: luagiac.luax.tns.zehn
   make-prg $(DISTDIR)/$^ $(DISTDIR)/$@
   genzehn --info --input luagiac.luax.tns 
   /bin/cp luagiac.luax.tns khicas.tns  /shared/ndless/ti/ndless
   echo "Run buildsha ndless/* to update sha256 fingerprint keys"

clean:
   rm -f *.o luagiac.luax.*

khicaslua.tns: khicas.lua
   luna khicas.lua khicaslua.tns
   /bin/cp khicaslua.tns /shared/ndless/ti/ndless

ptt.tns: ptt.o
   nspire-ld -o ptt.elf ptt.o $(LDFLAGS)
   $(GENZEHN) --compress --input ptt.elf --output ptt.tns.zehn --name "giac"  --uses-lcd-blit true #--240x320-support  true
# without compression
#   $(GENZEHN) --input giac.elf --output khicas.tns.zehn --name "giac"  --uses-lcd-blit true
   make-prg ptt.tns.zehn ptt.tns
   genzehn --info --input ptt.tns
   /bin/cp ptt.tns /shared/ndless/ti/ndless

# run make twice, def/undef FIREBIRDEMU in k_csdk.c and copy to khicas.tns/khicasemu.tns
khicas.tns:   $(OBJS) giacnspire.o #missing.o
   nspire-ld -o giac.elf giacnspire.o $(OBJS) $(LDFLAGS)
   $(GENZEHN) --compress --input giac.elf --output khicas.tns.zehn --name "giac"  --uses-lcd-blit true #--240x320-support  true
# without compression
#   $(GENZEHN) --input giac.elf --output khicas.tns.zehn --name "giac"  --uses-lcd-blit true --240x320-support true
   make-prg khicas.tns.zehn khicas.tns
   genzehn --info --input khicas.tns
   /bin/cp khicas.tns /shared/ndless/ti/ndless/khicas.tns
   /bin/cp luagiac.luax.tns khicas.tns  /shared/ndless/ti/ndless
   firebird-send khicas.tns /ndless
   echo "Run buildsha ndless/* to update sha256 fingerprint keys"
# Warning: if the size of khicas.tns is too large, debugging does not work
# the limit should be changed in  Ndless/ndless/src/resources/ndless.h
# recompile (make clean && make) and send ndless to the emulator
# firebird-send calcbin/ndless_installer_4.5.0.tns /ndless
# firebird-send calcbin/ndless_resources.tns /ndless


libgiac.a:   $(OBJS)
   arm-none-eabi-ar rcs libgiac.a $(OBJS)
   arm-none-eabi-ranlib libgiac.a

khicas.zip: luagiac.luax.tns khicas.tns
   zip khicas.zip luagiac.luax.tns khicas.tns khicas.lua
User avatar
SuperXX
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 57.1%
 
Posts: 40
Joined: 15 May 2021, 10:25
Gender: Male
Calculator(s):

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby parisse » 18 Jun 2021, 15:44

Makefile.nspire is not the default Makefile, you must call
Code: Select all
make -f Makefile.nspire
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 24.6%
 
Posts: 2483
Joined: 13 Dec 2013, 16:35
Gender: Not specified

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby SuperXX » 18 Jun 2021, 16:42

Nop. The same.

Maybe it's kali fault. Later this day I must try this on Ubuntu and see if it works.

Not even adding the toolchain directories to "PATH" worked

Image
User avatar
SuperXX
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 57.1%
 
Posts: 40
Joined: 15 May 2021, 10:25
Gender: Male
Calculator(s):

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby Adriweb » 18 Jun 2021, 17:02

It's not your distro's fault. I mean, you're mixing up a lot of things here. Why did you put things inside the ndless-sdk folder? That's for ... the ndless sdk, not external projects. And even more, its src folder. You shouldn't touch those.

So I suggest wiping everything off, following the ndless installation tutorial exactly (including the steps where you have to adjust the PATH after the toolchain installation), then not mix up ndless and external projects.
Also, adding built libs/headers like gmp/mfpr should be done in the install folder of the ndless toolchain, where other libs (.a files) and headers are, already. Your screenshots above show that you've put them in some other places....? Why ?

I've confirmed that all this works fine with a KhiCAS build.
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 57.9%
 
Posts: 13459
Images: 1101
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby parisse » 18 Jun 2021, 19:58

There is something strange, because make -f Makefile.nspire should not run the simple command nspire-g++ -c sym2poly.cc, it should run a more complex command with all the options, including the -I... option.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 24.6%
 
Posts: 2483
Joined: 13 Dec 2013, 16:35
Gender: Not specified

Re: Can´t compile KhiCas

Unread postby SuperXX » 19 Jun 2021, 11:11

So, after what @Adriweb said, I´ve decided to do what he said and try that on my Ubuntu VM, even thought that yes, doesn´t make sense being the distro´s fault, but still I waited to try it on my Ubuntu VM

And after changing the toolchain directories on the Makefile.nspire, I finally got a new error (It´s an error but finally it´s something different):

Code: Select all
gen.h:59:10: fatal error: gmpxx.h: No such file or directory
   59 | #include <gmpxx.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:32: sym2poly.o] Error 1


Now that the file changed, as I can understand it´s now reading the ".../toolchain/install/include" folder. So in that time, I had the idea to download every single file that appeared as missing. But a lot of files later I´ve understand how much time this would cost to me. Isn´t there a more quicker solution then what I´m doing? Or maybe I´m so blind that I don´t find it on the readme files.

I´ve stopped downloading every singles file in this error:
Code: Select all
home/ubuntu/Ndless/ndless-sdk/toolchain/install/include/FL/Enumerations.H:44:10: fatal error: FL/abi-version.h: No such file or directory
   44 | #include <FL/abi-version.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile.nspire:32: sym2poly.o] Error 1


Anyways, here is a screenshot, as usual:
Image
Note:It´s appearing just "make" because I changed the file from Makefile.nspire to just Makefile. But in the newest tries I´ve changed it back to normal and I´m doing the same as parisse said later. But as far as I can understand, it doesn´t affect anything

P.S:Oh, one more thing. @parisse, it seems that "https://www-fourier.ujf-grenoble.fr/~parisse/install_en" is down.

And thanks for everything until now.
User avatar
SuperXX
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 57.1%
 
Posts: 40
Joined: 15 May 2021, 10:25
Gender: Male
Calculator(s):

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby parisse » 19 Jun 2021, 12:49

I think I know why it fails. Try to
Code: Select all
cp config.h.nspire config.h
in the src directory.
I guess you have run configure in the top-level source directory of giac, and a config.h file has been generated for the x86 host.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 24.6%
 
Posts: 2483
Joined: 13 Dec 2013, 16:35
Gender: Not specified

Re: Can´t compile KhiCas| gmp.h missing?

Unread postby SuperXX » 19 Jun 2021, 13:58

parisse wrote:I think I know why it fails. Try to
Code: Select all
cp config.h.nspire config.h
in the src directory.
I guess you have run configure in the top-level source directory of giac, and a config.h file has been generated for the x86 host.


It worked, no more "No Such File or Directory" errors.

But Now it ends up with this:
Code: Select all
arm-none-eabi-ld: cannot find -lmicropy
collect2: error: ld returned 1 exit status
make: *** [Makefile.nspire:50: luagiac.luax.elf] Error 1


Well, I guess errors like me
User avatar
SuperXX
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 57.1%
 
Posts: 40
Joined: 15 May 2021, 10:25
Gender: Male
Calculator(s):

PreviousNext

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 4 guests

-
Search
-
Social
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Remplace ton ancienne fx-92 Collège ou Graph 35 par la Graph 90+E couleur. Pour tout achat, Casio te rembourse 10€ en cas de retour de ta fx-92 Collège, ou 15€ en cas de retour de ta Graph 35. Etiquette de retour fournie, pas de frais de port à payer, même les anciens modèles et machines non fonctionnelles sont acceptées. En partenariat avec les Restos du coeur.
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 30 Septembre 2021
Reprise de ton ancienne fx-92 Collège à 5€ ou Graph 35 à 10€. Même non fonctionnelle ou ancien modèle. Etiquette de retour fournie, pas de frais de port à payer. En partenariat avec les Restos du coeur.
25€ remboursés par Casio sur l'achat de ta calculatrice fx-CP400 d'ici le 31 Octobre 2021
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2021
Coque NumWorks édition limitée Août 2021 à gagner.
Découvre les nouvelles fonctionnalités en Python de l'OS 5.5 pour la 83PCE/84+C-T Python Edition
Découvre les nouvelles fonctionnalités en Python de l'OS 5.2 pour les Nspire CX II
Omega, le fork étendant les capacités de ta NumWorks, même en mode examen !
12345678910
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
638 utilisateurs:
>619 invités
>13 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)

-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)