configparser module error when installing Pulpissimo SDK
#1
I have tried to install the Pulpissimo SDK, but without success. I have searched in the Forum for a similar problem, but I couldn't find it. Therefore, I'm posting here the sequence of commands I'm issuing and the final result. Any help will be appreciated.

I'm working on a clean Linux 16.04.06 Install. Following the information available in GitHub, here is the sequence I'm following:

1 - sudo apt install git python3-pip gawk texinfo libgmp-dev libmpfr-dev libmpc-dev swig3.0 libjpeg-dev lsb-core doxygen python-sphinx sox graphicsmagick-libmagick-dev-compat libsdl2-dev libswitch-perl libftdi1-dev cmake scons libsndfile1-dev

2 - sudo pip3 install twisted prettytable pyelftools openpyxl xlsxwriter pyyaml numpy configparser pyvcd

3 - sudo pip3 install configparser

4 - cd /opt

5 - sudo mkdir riscv

6 - cd riscv

7 - git clone https://github.com/pulp-platform/pulp-ri...-toolchain

8 - cd pulp-riscv-gnu-toolchain

9 - git submodule update --init --recursive

10 - sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev

11 - sudo ./configure --prefix=/opt/riscv --with-arch=rv32imc --with-cmodel=medlow --enable-multilib

12 - make

13 - export PULP_RISCV_GCC_TOOLCHAIN=‘/opt/riscv’

14 - cd /opt/riscv

15 - sudo git clone https://github.com/pulp-platform/pulp-builder.git

16 - cd pulp-builder

17 - source configs/pulpissimo.sh

18 - sudo ./scripts/build-gvsoc

This last command fails with the following error:

...
make: Entering directory '/opt/riscv/pulp-builder/archi'
scons
scons: Reading SConscript files ...
ImportError: No module named configparser:
  File "/opt/riscv/pulp-builder/archi/SConstruct", line 4:
    import pulp_config as plpconfig
  File "/opt/riscv/pulp-builder/install/ws/python/pulp_config.py", line 23:
    import configparser
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 2
make: Leaving directory '/opt/riscv/pulp-builder/archi'

I get exactly the same result if, instead of command 18 i issues the following three commands:

./scripts/clean
./scripts/update-runtime
./scripts/build-runtime

Since module configparser was apparently installed in step 3 I don't know what may be wrong.

Thank you very much in advance for your help.
Reply
#2
Hello, 

This is from an internal discussion:

I think the issue comes from step #3, it should have been

Code:
 sudo pip2 install configparser

Depending on your Linux distrib, this may actually be:

Code:
sudo pip install configparser

What is important is to get this module installed for the python version used by scons, which is failing.
Visit pulp-platform.org and follow us on twitter @pulp_platform
Reply
#3
Hello,

Thank you so much for your prompt answer. I used pip3 instead of pip2 or pip because in the first machine I tried the installation I got the message that the command was not found.
After properly installing configparser for pip2 I now get the following error:

scons: Reading SConscript files ...
FATAL ERROR: Configurations must e given either through PULP_CURRENT_CONFIG or PULP_CONFIGS

CalledProcessError: Command '['plpfiles', 'copy', '--item=archi_files']' returned non-zero exit status 255:
File "/opt/riscv/pulp-builder/archi/SConstruct", line 20:
files += subprocess.check_output(shlex.split('plpfiles copy --item=archi_files')).decode('UTF-8').split()
File "/usr/lib/python2.7/subprocess.py", line 574:
raise CalledProcessError(retcode, cmd, output=output)
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 2
make: Leaving directory '/opt/riscv/pulp-builder/archi'

The value of the PULP_CURRENT_CONFIG environment variable is pulpissimo@config_file=chips/pulpissimo/pulpissimo.json, which is the value set by ./scripts/pulpissimo.sh which is invoked just before issuing build-gvsoc

Do you know what may happen now?

Thank you very much in advance for your help.
Reply
#4
There is something wrong in your environment, this error normally happens when PULP_CURRENT_CONFIG is not defined. Could you try from scratch from a fresh terminal ?
Reply
#5
As you can see in the attached image (terminal started just after Ubuntu is launched), in principle all the environment variables needed for PULP are set and correct, but I still get the error.


Attached Files Thumbnail(s)
   
Reply
#6
I can't reproduce that, do you use any particular Python environment ?
Reply
#7
(11-06-2019, 07:52 AM)germain_haugou Wrote: I can't reproduce that, do you use any particular Python environment ?

No, I'm starting from a clean Ubuntu 16.04.6 install. Actually, I have done the installation twice (both Ubuntu and Pulpissimo SDK), but I always get stuck at the same point. If you think a specific Python environment may help, please let me know.
Thank you very much in advance for your help.
Reply
#8
Ah I think I understood the issue, you are building with sudo:
sudo ./scripts/build-gvsoc
This is creating a new shell with a new environment, which explains why the config is not set.
Just execute it like that:
./scripts/build-gvsoc
Reply
#9
(11-06-2019, 08:04 AM)germain_haugou Wrote: Ah I think I understood the issue, you are building with sudo:
sudo ./scripts/build-gvsoc
This is creating a new shell with a new environment, which explains why the config is not set.
Just execute it like that:
./scripts/build-gvsoc
The problem now is that without sudo the process stops because lack of write permissions. This is what I get:

moreno@moreno-VirtualBox:/opt/riscv/pulp-builder$ ./scripts/build-gvsoc
+ install_dir=/opt/riscv/pulp-builder/install
+ doc_install_dir=/opt/riscv/pulp-builder/install/doc
+ ws_install_dir=/opt/riscv/pulp-builder/install/ws
+ build_dir=/opt/riscv/pulp-builder/build
+ export PATH=/opt/riscv/pulp-builder/install/ws/bin:/home/moreno/bin:/home/moreno/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
+ PATH=/opt/riscv/pulp-builder/install/ws/bin:/home/moreno/bin:/home/moreno/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
+ export PYTHONPATH=/opt/riscv/pulp-builder/install/ws/python:
+ PYTHONPATH=/opt/riscv/pulp-builder/install/ws/python:
+ export PULP_CONFIGS_PATH=/opt/riscv/pulp-builder/install/ws/configs
+ PULP_CONFIGS_PATH=/opt/riscv/pulp-builder/install/ws/configs
+ make -C json-tools all install BUILD_DIR=/opt/riscv/pulp-builder/build/json-tools INSTALL_DIR=/opt/riscv/pulp-builder/install/ws
make: Entering directory '/opt/riscv/pulp-builder/json-tools'
#### Building in /opt/riscv/pulp-builder/build/json-tools
#### Release type is RelWithDebInfo
#### Installing to /opt/riscv/pulp-builder/install/ws
( cd /opt/riscv/pulp-builder/build/json-tools ; \
  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/riscv/pulp-builder/install/ws \
/opt/riscv/pulp-builder/json-tools/ )
-- Configuring done
CMake Error: Cannot open file for write: /opt/riscv/pulp-builder/build/json-tools/CMakeCache.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. /opt/riscv/pulp-builder/build/json-tools/CMakeCache.txt
CMake Error: : System Error: Permission denied
Makefile:58: recipe for target '/opt/riscv/pulp-builder/build/json-tools/CMakeCache.txt' failed
make: *** [/opt/riscv/pulp-builder/build/json-tools/CMakeCache.txt] Error 1
make: Leaving directory '/opt/riscv/pulp-builder/json-tools'
Reply
#10
Yes you have to execute it in your own home folder where you have write permissions and then if you want you can move the directory with sudo to another folder.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)