Shop OBEX P1 Docs P2 Docs Learn Events
P2 Install flexprop on a Linux computer. — Parallax Forums

P2 Install flexprop on a Linux computer.

Hello I have a small problem. :(

Abort at:
src/flexprop_native.c:23:10: fatal error: tk.h: file or directory not found
#include "tk.h"

Comments

  • You'll have to install the tcl and tk development libraries. There's a section called "Building from source" in README.md, and it suggests doing the following to install on Ubuntu (for other Linux distros you may have to adjust the package names and use the appropriate package manager, like yum for fedora):

    cd $HOME
    mkdir -p src
    cd src
    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install bison
    sudo apt-get install git
    sudo apt-get install tk8.6-dev
    sudo apt-get install texlive-latex-recommended
    sudo apt-get install pandoc
    git clone --recursive https://github.com/totalspectrum/flexprop
    cd flexprop
    make install
    
  • Despite the 2 errors, it is now running.
    I only had to look for flexprop.tcl and include it in a starter.

    The description I had last time was still missing
    sudo apt-get install texlive-latex-recommended
    sudo apt-get install pandoc.

    Thank you.

    pic18f2550@T:~/src/flexprop$ make install
    cpp -xc++ -DTCL_SRC < version.inp > src/version.tcl
    make -C spin2cpp
    make[1]: Verzeichnis „/home/pic18f2550/src/flexprop/spin2cpp“ wird betreten
    mkdir -p ./build
    bison -Wno-deprecated -D parse.error=verbose -D api.prefix={spinyy} -t -b ./build/spin -d frontends/spin/spin.y
    frontends/spin/spin.y: Warnung: 27 Schiebe/Reduzier-Konflikte [-Wconflicts-sr]
    frontends/spin/spin.y: Warnung: 2 Reduzier/Reduzier-Konflikte [-Wconflicts-rr]
    bison -Wno-deprecated -D parse.error=verbose -D api.prefix={basicyy} -t -b ./build/basic -d frontends/basic/basic.y
    frontends/basic/basic.y: Warnung: 20 Schiebe/Reduzier-Konflikte [-Wconflicts-sr]
    bison -Wno-deprecated -D parse.error=verbose -D api.prefix={cgramyy} -t -b ./build/cgram -d frontends/c/cgram.y
    frontends/c/cgram.y: Warnung: 3 Schiebe/Reduzier-Konflikte [-Wconflicts-sr]
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/lexer.o -c frontends/lexer.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/symbol.o -c symbol.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/ast.o -c ast.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/expr.o -c expr.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/dofmt.o -c util/dofmt.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/flexbuf.o -c util/flexbuf.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/lltoa_prec.o -c util/lltoa_prec.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/strupr.o -c util/strupr.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/strrev.o -c util/strrev.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/strdupcat.o -c util/strdupcat.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/to_utf8.o -c util/to_utf8.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/from_utf8.o -c util/from_utf8.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/preprocess.o -c preprocess.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/testlex testlex.c build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o -lm
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/common.o -c frontends/common.c
    frontends/common.c: In function ‘DoPropellerPostprocess’:
    frontends/common.c:1122:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(buffer,len,1,f);
             ^~~~~~~~~~~~~~~~~~~~~
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/case.o -c frontends/case.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/spinc.o -c spinc.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/functions.o -c functions.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/cse.o -c cse.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/loops.o -c loops.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/hloptimize.o -c frontends/hloptimize.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/types.o -c frontends/types.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/pasm.o -c pasm.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outdat.o -c backends/dat/outdat.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outlst.o -c backends/dat/outlst.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outobj.o -c backends/objfile/outobj.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/spinlang.o -c frontends/spin/spinlang.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/basiclang.o -c frontends/basic/basiclang.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/clang.o -c frontends/c/clang.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outasm.o -c backends/asm/outasm.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/assemble_ir.o -c backends/asm/assemble_ir.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/optimize_ir.o -c backends/asm/optimize_ir.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/inlineasm.o -c backends/asm/inlineasm.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/compress_ir.o -c backends/asm/compress_ir.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outbc.o -c backends/bytecode/outbc.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/bcbuffers.o -c backends/bcbuffers.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/bcir.o -c backends/bytecode/bcir.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/bc_spin1.o -c backends/bytecode/bc_spin1.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outnu.o -c backends/nucode/outnu.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/nuir.o -c backends/nucode/nuir.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/nupeep.o -c backends/nucode/nupeep.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outcpp.o -c backends/cpp/outcpp.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/cppfunc.o -c backends/cpp/cppfunc.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/outgas.o -c backends/cpp/outgas.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/cppexpr.o -c backends/cpp/cppexpr.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/cppbuiltin.o -c backends/cpp/cppbuiltin.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/directive.o -c mcpp/directive.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/expand.o -c mcpp/expand.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/mbchar.o -c mcpp/mbchar.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/mcpp_eval.o -c mcpp/mcpp_eval.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/mcpp_main.o -c mcpp/mcpp_main.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/mcpp_system.o -c mcpp/mcpp_system.c
    mcpp/mcpp_system.c: In function ‘do_options’:
    mcpp/mcpp_system.c:336:5: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
         getcwd( cur_work_dir, PATHMAX);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    mcpp/mcpp_system.c: In function ‘NormalizePath’:
    mcpp/mcpp_system.c:917:5: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
         getcwd(curpath, PATHMAX);
         ^~~~~~~~~~~~~~~~~~~~~~~~
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/mcpp_support.o -c mcpp/mcpp_support.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -DGITREV=v5.9.6 -DGITBRANCH=HEAD -o build/version.o -c version.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/becommon.o -c backends/becommon.c
    gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/brkdebug.o -c backends/brkdebug.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/spin.tab.o -c build/spin.tab.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/basic.tab.o -c build/basic.tab.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/cgram.tab.o -c build/cgram.tab.c
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/spin2cpp spin2cpp.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outbc.o build/bcbuffers.o build/bcir.o build/bc_spin1.o build/outnu.o build/nuir.o build/nupeep.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/becommon.o build/brkdebug.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/flexspin flexspin.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outbc.o build/bcbuffers.o build/bcir.o build/bc_spin1.o build/outnu.o build/nuir.o build/nupeep.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/becommon.o build/brkdebug.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    gcc -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/flexcc flexcc.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outbc.o build/bcbuffers.o build/bcir.o build/bc_spin1.o build/outnu.o build/nuir.o build/nupeep.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/becommon.o build/brkdebug.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    make[1]: Verzeichnis „/home/pic18f2550/src/flexprop/spin2cpp“ wird verlassen
    mkdir -p bin
    cp spin2cpp/build/flexspin bin/flexspin
    mkdir -p board
    cp loadp2/board/P2ES_flashloader.spin2 board/P2ES_flashloader.spin2
    bin/flexspin -2 -o board/P2ES_flashloader.bin board/P2ES_flashloader.spin2
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2021 Total Spectrum Software Inc.
    Version 5.9.6-HEAD-v5.9.6 Compiled on: Dec  1 2021
    P2ES_flashloader.spin2
    P2ES_flashloader.spin2
    Done.
    Program size is 32800 bytes
    mkdir -p board
    cp -r loadp2/board/sdcard board
    (make -C board/sdcard P2CC="`pwd`/bin/flexspin -2 -I`pwd`/spin2cpp/include")
    make[1]: Verzeichnis „/home/pic18f2550/src/flexprop/board/sdcard“ wird betreten
    /home/pic18f2550/src/flexprop/bin/flexspin -2 -I/home/pic18f2550/src/flexprop/spin2cpp/include -o sdboot.binary sdboot.c ff.c sdmm.c
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2021 Total Spectrum Software Inc.
    Version 5.9.6-HEAD-v5.9.6 Compiled on: Dec  1 2021
    sdboot.c
    ff.c
    sdmm.c
    posixio.c
    fputs.c
    bufio.c
    fmt.c
    errno.c
    sdboot.p2asm
    Done.
    Program size is 29612 bytes
    make[1]: Verzeichnis „/home/pic18f2550/src/flexprop/board/sdcard“ wird verlassen
    rm -f board/sdcard/*.p2asm
    mv board/sdcard/sdboot.binary board/P2ES_sdcard.bin
    tclsh src/makepandoc.tcl spin2cpp/Flexspin.md > pandoc.yml
    pandoc --metadata-file=pandoc.yml -s --toc -f gfm -t latex -o spin2cpp/Flexspin.pdf spin2cpp/Flexspin.md
    pandoc: unrecognized option `--metadata-file=pandoc.yml'
    Try pandoc --help for more information.
    Makefile:189: recipe for target 'spin2cpp/Flexspin.pdf' failed
    make: *** [spin2cpp/Flexspin.pdf] Error 2
    pic18f2550@T:~/src/flexprop$
    
  • Which linux distribution are you using?

  • I first had Ubuntu 22.04 LTS 64 bit on the disk.
    It ran too slowly on the i3 and was just annoying.

    Now I have Linux Mint 19.04.3, the latest 32-bit version.
    Now the box is running again.
    The support ends next year, then there will be no more 32 bit support. Too bad.

  • @pic18f2550 said:
    I first had Ubuntu 22.04 LTS 64 bit on the disk.
    It ran too slowly on the i3 and was just annoying.

    Now I have Linux Mint 19.04.3, the latest 32-bit version.
    Now the box is running again.
    The support ends next year, then there will be no more 32 bit support. Too bad.

    Don't use a 32 bit OS if you can run 64 bit. There is literally zero point to it and it will make everything slower.

  • @Wuerfel_21 said:

    Don't use a 32 bit OS if you can run 64 bit. There is literally zero point to it and it will make everything slower.

    Normally correct, though 32-bit code takes somewhat less RAM, so 32-bit can be better on memory-starved systems. If you have >1GB RAM, you definitely want a 64-bit OS build.

  • I've had several 64 bit systems on it but they all failed to get out of the pots.
    And I didn't want XP.
    A 64 bit CPU is no guarantee for speed, the rest of the hardware has to fit, otherwise it won't work.
    A 64 bit CPU needs twice as much data transfer to the memory as a 32 bit CPU.
    (Milky Way calculation) a 64 bit CPU can load two 32 bit instructions at the same time.
    Loading and saving to the main memory is what slows down the most. But this is not about 64 or 32 bits, it is about flexprop. :) And I don't need an i3 to drink coffee.

    Translated with www.DeepL.com/Translator (free version)

  • 4 GByte should actually be enough.
    My memory utilisation is at 5%.
    The swap file 0%

Sign In or Register to comment.