mirror of https://github.com/VLSIDA/OpenRAM.git
Add optional $CONDA_HOME environment variable
This commit is contained in:
parent
26a082f44d
commit
8ac95c19a4
11
__init__.py
11
__init__.py
|
|
@ -22,17 +22,22 @@ if "OPENRAM_HOME" not in os.environ.keys():
|
||||||
__path__.insert(0, OPENRAM_HOME)
|
__path__.insert(0, OPENRAM_HOME)
|
||||||
|
|
||||||
|
|
||||||
# Find the conda installation directory
|
# Find the conda installer script
|
||||||
if os.path.exists(OPENRAM_HOME + "/install_conda.sh"):
|
if os.path.exists(OPENRAM_HOME + "/install_conda.sh"):
|
||||||
|
CONDA_INSTALLER = OPENRAM_HOME + "/install_conda.sh"
|
||||||
CONDA_HOME = OPENRAM_HOME + "/miniconda"
|
CONDA_HOME = OPENRAM_HOME + "/miniconda"
|
||||||
elif os.path.exists(OPENRAM_HOME + "/../install_conda.sh"):
|
elif os.path.exists(OPENRAM_HOME + "/../install_conda.sh"):
|
||||||
|
CONDA_INSTALLER = OPENRAM_HOME + "/../install_conda.sh"
|
||||||
CONDA_HOME = os.path.abspath(OPENRAM_HOME + "/../miniconda")
|
CONDA_HOME = os.path.abspath(OPENRAM_HOME + "/../miniconda")
|
||||||
# Add CONDA_HOME to environment variables
|
# Override CONDA_HOME if it's set as an environment variable
|
||||||
|
if "CONDA_HOME" in os.environ.keys():
|
||||||
|
CONDA_HOME = os.environ["CONDA_HOME"]
|
||||||
|
# Add CONDA_HOME to environment variables just in case
|
||||||
try:
|
try:
|
||||||
os.environ["CONDA_HOME"] = CONDA_HOME
|
os.environ["CONDA_HOME"] = CONDA_HOME
|
||||||
except:
|
except:
|
||||||
from openram import debug
|
from openram import debug
|
||||||
debug.warning("Couldn't find install_conda.sh")
|
debug.warning("Couldn't find conda setup directory.")
|
||||||
|
|
||||||
|
|
||||||
# Import everything in globals.py
|
# Import everything in globals.py
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,8 @@ def install_conda():
|
||||||
|
|
||||||
debug.info(1, "Creating conda setup...");
|
debug.info(1, "Creating conda setup...");
|
||||||
|
|
||||||
from openram import CONDA_HOME
|
from openram import CONDA_INSTALLER
|
||||||
subprocess.call("./install_conda.sh", cwd=os.path.abspath(CONDA_HOME + "/.."))
|
subprocess.call(CONDA_INSTALLER)
|
||||||
|
|
||||||
|
|
||||||
def setup_bitcell():
|
def setup_bitcell():
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
CONDA_INSTALLER_URL="https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh"
|
CONDA_INSTALLER_URL="https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh"
|
||||||
CONDA_INSTALLER_FILE="miniconda_installer_py38.sh"
|
CONDA_INSTALLER_FILE="miniconda_installer_py38.sh"
|
||||||
CONDA_BASE="miniconda"
|
CONDA_HOME="${CONDA_HOME:-miniconda}"
|
||||||
|
|
||||||
TOOLS="klayout magic netgen ngspice trilinos xyce"
|
TOOLS="klayout magic netgen ngspice trilinos xyce"
|
||||||
|
|
||||||
# Install miniconda if not installed
|
# Install miniconda if not already installed
|
||||||
if [ ! -d "miniconda" ]
|
if [[ ! -d "${CONDA_HOME}/bin" ]]
|
||||||
then
|
then
|
||||||
curl -s -o ${CONDA_INSTALLER_FILE} ${CONDA_INSTALLER_URL}
|
curl -s -o ${CONDA_INSTALLER_FILE} ${CONDA_INSTALLER_URL}
|
||||||
/bin/bash ${CONDA_INSTALLER_FILE} -b -p ${CONDA_BASE}
|
/bin/bash ${CONDA_INSTALLER_FILE} -b -p ${CONDA_HOME}
|
||||||
rm ${CONDA_INSTALLER_FILE}
|
rm ${CONDA_INSTALLER_FILE}
|
||||||
source ${CONDA_BASE}/bin/activate
|
source ${CONDA_HOME}/bin/activate
|
||||||
|
|
||||||
# Prioritize channels to prevent version conflicts
|
# Prioritize channels to prevent version conflicts
|
||||||
conda config --add channels conda-forge
|
conda config --add channels conda-forge
|
||||||
|
|
@ -28,7 +28,7 @@ then
|
||||||
|
|
||||||
# Install required Python packages
|
# Install required Python packages
|
||||||
# (This step isn't required but used to prevent possible issues)
|
# (This step isn't required but used to prevent possible issues)
|
||||||
pip3 install -r requirements.txt
|
python3 -m pip install -r requirements.txt
|
||||||
|
|
||||||
conda deactivate
|
conda deactivate
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue