For all intents and purposes, we will be using Windows Subsystem for Linux (WSL) to make this work. Any attempt I made to make this run natively has been frustratingly unsuccessful. With that being said, let us begin.
This guide will only cover installation of WSL 1. WSL 2 offers a lot of performance improvements so do check it out also. Full documentation here.
1linkdism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
You can always select another distribution if you like.
Run these commands in your Ubuntu terminal.
1linksudo apt-get update
2linksudo apt-get upgrade
1linksudo apt-get install subversion
1linksudo apt-get install build-essential
1linksudo apt-get install m4
1linksudo apt-get install python3-setuptools python3-dev
1linksudo apt-get install libgmp-dev
1linksudo apt-get -y install flex bison
1linksudo apt-get install libssl-dev
Create a folder named charm_root
in your Windows desktop. This will just simplify things and make the guide easier to
follow.
Download PBC source here. Put in inside charm_root
folder.
Extract PBC files. In your Ubuntu terminal, run:
1linkcd /mnt/c/Users/your_name/Desktop/charm_root
2linktar -xf pbc-0.5.14.tar.gz
3linkcd pbc-0.5.14
info NOTE Double check the path of your charm_root folder. Drive letter is case-sensitive (c instead of C)
Run:
1link./configure LDFLAGS="-lgmp"
2linkmake
3linksudo make install
4linksudo ldconfig
Get the source code here. Click 'Code' then select 'Download ZIP'.
Put in charm_root
folder and then extract.
Run
1linkcd /mnt/c/Users/your_name/Desktop/charm_root/charm-dev/charm-dev
2linksudo ./configure.sh --python=python3
3linksudo make
4linksudo make install
5linksudo ldconfig
info NOTE Double check the path of your charm_root folder. Drive letter is case-sensitive (c instead of C)
1linkpython3
2link>>> import charm
07-Feb-2021