robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
143 stars 31 forks source link

Easier installation, use python3 #18

Closed Chiff closed 3 years ago

Chiff commented 3 years ago

I have spent few hours figuring out how to make pysimCoder run. In this PR, I fixed installation scripts (*.py) and switched to python3 because the Slycot library dropped python2 in version v0.3.3 and because of that make command would fail. Also, there were some problems with including pyblock.h file and something was messed up with python2/python3 libraries.

After my changes, I managed to install and run pysimCoder in few minutes on fresh Debian installation.

Feel free to close this PR if there was something in my installation process I have missed. However, in that case, I would like to see some steps on how to install pysimCoder without my changes.

Thanks, Martin

robertobucher commented 3 years ago

Hi Cliff Many many thanks for your improvements! This is important for me, in particular because pysimCoder is developed only by me in my spare time, and I need more feedback to find out all the problems!

Thanks again! Roberto

Chiff commented 3 years ago

Hi @robertobucher

thank you for your quick reply.

debian@debian:~/Desktop/pysimCoder/CodeGen/LinuxRT/devices$ make all

cc -c -g -I/CodeGen/Common/include -I../include  comedi_digital_input.c
comedi_digital_input.c:21:10: fatal error: pyblock.h: No such file or directory
 #include <pyblock.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:45: comedi_digital_input.o] Error 1
allfiles:
    PYSUPSICTRL=$(PYSUPSICTRL)
    COMMON_DIR=$(COMMON_DIR)
    GENERIC_INC=$(GENERIC_INC)

it outputs

root@debian:/home/debian/Desktop/pysimCoder# make

...

cd CodeGen/LinuxRT/devices; make all
make[1]: Entering directory '/home/debian/Desktop/pysimCoder/CodeGen/LinuxRT/devices'
PYSUPSICTRL= ## <- my tmp change to log variable
COMMON_DIR=/CodeGen/Common ## <- my tmp change log variable
GENERIC_INC=/CodeGen/Common/include ## <- my tmp change log variable
cc -c -g -I/CodeGen/Common/include -I../include  comedi_digital_input.c
comedi_digital_input.c:21:10: fatal error: pyblock.h: No such file or directory
 #include <pyblock.h>
          ^~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:48: comedi_digital_input.o] Error 1
make[1]: Leaving directory '/home/debian/Desktop/pysimCoder/CodeGen/LinuxRT/devices'
make: *** [Makefile:33: full_lib] Error 2

I hope it helps you enough to fix this

Martin

Chiff commented 3 years ago

TLDR; for pyblock.h

running command cc -c -g -I/CodeGen/Common/include -I../include comedi_digital_input.c has incorrect path /CodeGen/Common and that's a reason why is copied that file to LinuxRT/include - there is relative path ../include