My notes on compiling LiteX-CNC on linuxCNC

More
4 years 1 month ago #252524 by DePrutser
I'm on branch main:
cedric@mill:~/LiteX-CNC$ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

pydantic is in requirements.txt, but it has no end of line:
cedric@mill:~/LiteX-CNC$ cat requirements.txt
click~=8.0
pydanticcedric@mill:~/LiteX-CNC$

pip has not been run:
$ pip install -r requirements.txt
bash: pip: command not found

pip3 is available:
cedric@mill:~/LiteX-CNC$ pip3 install -r requirements.txt
Collecting click~=8.0 (from -r requirements.txt (line 1))
Downloading files.pythonhosted.org/packages/c2/f1/df...1.3-py3-none-any.whl (96kB)
100% |████████████████████████████████| 102kB 5.0MB/s
Collecting pydantic (from -r requirements.txt (line 2))
Downloading files.pythonhosted.org/packages/d4/ec/23...0.2-py3-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 6.8MB/s
Collecting importlib-metadata; python_version < "3.8" (from click~=8.0->-r requirements.txt (line 1))
Downloading files.pythonhosted.org/packages/d2/a2/8c...2.0-py3-none-any.whl
Collecting typing-extensions>=4.1.0 (from pydantic->-r requirements.txt (line 2))
Downloading files.pythonhosted.org/packages/ed/d6/2a...3.0-py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->click~=8.0->-r requirements.txt (line 1))
Downloading files.pythonhosted.org/packages/f0/36/63...8.1-py3-none-any.whl
Installing collected packages: typing-extensions, zipp, importlib-metadata, click, pydantic
Successfully installed click-8.1.3 importlib-metadata-4.12.0 pydantic-1.10.2 typing-extensions-4.3.0 zipp-3.8.1

It does not solve the problem though:
cedric@mill:~/LiteX-CNC$ python -m firmware examples/5a-75e.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "firmware/__init__.py", line 20, in <module>
from .soc import LitexCNC_Firmware
File "firmware/soc.py", line 32
baseclass: Type = Field(
^
SyntaxError: invalid syntax


cedric@mill:~/LiteX-CNC$ git checkout stepgen_improvement
Branch 'stepgen_improvement' set up to track remote branch 'stepgen_improvement' from 'origin'.
Switched to a new branch 'stepgen_improvement'

cedric@mill:~/LiteX-CNC$ python -m firmware examples/5a-75e.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "firmware/__init__.py", line 19, in <module>
from . import boards
File "firmware/boards/__init__.py", line 1, in <module>
from .rv901t import RV901T
File "firmware/boards/rv901t.py", line 8, in <module>
from litex.build.generic_platform import *
ImportError: No module named litex.build.generic_platform

So far, not so good :-)

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #252526 by DePrutser
On further investigation, the error message has changed.
Does it matter where I run the script "python3 litex_setup.py --init --install --config=standard --gcc=riscv"? I have run it without first creating a folder for it, polluting my home folder.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago - 4 years 1 month ago #252652 by DePrutser
New attempt:
Reinstall linuxcnc (roll back to that snapshot)

$ sudo apt-get install wget
$ sudo apt-get install python3-pip
$ sudo apt-get install git
$ pip3 install --user meson ninja

$ mkdir LiteX
$ cd LiteX
$ wget raw.githubusercontent.com/enjoy-digital/...aster/litex_setup.py
$ python3 litex_setup.py --init --install --config=standard --gcc=riscv
$ cd ..

$ wget github.com/YosysHQ/oss-cad-suite-build/r...nux-x64-20220920.tgz
$ tar -xvf oss-cad-suite-linux-x64-20220920.tgz
$ mkdir -p ~/bin
$ ln -s ~/oss-cad-suite/bin/* ~/bin/
#start a new bash, so ~/bin is added to the PATH
$ bash --login

$ git clone github.com/Peter-van-Tol/LiteX-CNC.git
$ cd LiteX-CNC
$ git checkout stepgen_improvement
$ pip3 install -r requirements.txt

$ python -m firmware examples/5a-75e.json

Nope:
cedric@mill:~/LiteX-CNC$ python -m firmware examples/5a-75e.json
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "firmware/__init__.py", line 19, in <module>
    from . import boards
  File "firmware/boards/__init__.py", line 1, in <module>
    from .rv901t import RV901T
  File "firmware/boards/rv901t.py", line 8, in <module>
    from litex.build.generic_platform import *
ImportError: No module named litex.build.generic_platform

I think now there's only something missing from the PATH or something small like that:
cedric@mill:~$ echo $PATH
/home/cedric/.local/bin:/home/cedric/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

 
Last edit: 4 years 1 month ago by DePrutser. Reason: needed to restore the virtual machine for the next attempt

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #252753 by vit74vit
try this:
export PATH="~/oss-cad-suite/bin/:$PATH"

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #252782 by DePrutser
Thanks, but that was not it:
cedric@mill:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
cedric@mill:~$ export PATH="~/oss-cad-suite/bin/:$PATH"
cedric@mill:~$ echo $PATH
~/oss-cad-suite/bin/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
cedric@mill:~$ cd LiteX-CNC
cedric@mill:~/LiteX-CNC$ python -m firmware examples/5a-75e.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "firmware/__init__.py", line 19, in <module>
from . import boards
File "firmware/boards/__init__.py", line 1, in <module>
from .rv901t import RV901T
File "firmware/boards/rv901t.py", line 8, in <module>
from litex.build.generic_platform import *
ImportError: No module named litex.build.generic_platform
cedric@mill:~/LiteX-CNC$

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #252783 by DePrutser
I have found generic platform.py:

cedric@mill:~/LiteX-CNC$
cedric@mill:~/LiteX-CNC$ ls /home/cedric/LiteX/litex/litex/build/
altera __init__.py quicklogic
anlogic io.py sim
dfu.py lattice tools.py
efinix microsemi xilinx
generic_platform.py nextpnr_wrapper.py yosys_nextpnr_toolchain.py
generic_programmer.py openfpgaloader.py yosys_wrapper.py
generic_toolchain.py openocd.py
gowin osfpga
cedric@mill:~/LiteX-CNC$
cedric@mill:~/LiteX-CNC$
cedric@mill:~/LiteX-CNC$ cd /home/cedric/LiteX/litex/
cedric@mill:~/LiteX/litex$ ls
CHANGES doc litex litex_setup.py README.md test
CONTRIBUTORS LICENSE litex.egg-info MANIFEST.in setup.py
cedric@mill:~/LiteX/litex$

Please Log in or Create an account to join the conversation.

Moderators: PCW, jmelson
Time to create page: 0.280 seconds
Powered by Kunena Forum