-
Notifications
You must be signed in to change notification settings - Fork 392
Add Conda environment setup and dependency installation script #2023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# --- Colors --- | ||
RED='\033[0;31m' | ||
YELLOW='\033[1;33m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Color | ||
|
||
|
||
# --- Check if the script is sourced --- | ||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
echo -e "${YELLOW}Please run this script as:" | ||
echo -e " ${NC}source $(basename "${BASH_SOURCE[0]}")" | ||
echo -e "Otherwise, '${YELLOW}conda activate${NC}' won't persist in your current shell." | ||
return 0 2>/dev/null || exit 0 | ||
fi | ||
|
||
# --- Check if Miniconda exists --- | ||
if [ ! -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then | ||
echo -e "${RED}Miniconda not found at ~/miniconda3.${NC}" | ||
echo -e "Please install Miniconda before running this script" | ||
echo -e "${YELLOW}Important:${NC} During installation, decline any PATH modifications." | ||
echo -e "This script activates the environment per session using 'source'." | ||
return 0 2>/dev/null || exit 0 | ||
else | ||
# Load Conda | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
|
||
# Create OSL environment if it doesn't exist | ||
if ! conda info --envs | grep -q "osl-env"; then | ||
echo "Creating osl-env Conda environment..." | ||
conda create -y -n osl-env | ||
|
||
# Activate the environment | ||
conda activate osl-env | ||
|
||
# Install dependencies | ||
echo "Installing dependencies in osl-env..." | ||
conda install -y -c conda-forge \ | ||
cmake \ | ||
llvmdev=20.1.8 clangdev clangxx_linux-64 libcxx \ | ||
python=3.12 numpy pybind11 \ | ||
openimageio=2.5 imath flex bison pugixml zlib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's pretty old. Can we use at least OpenImageIO 3.0 by default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like conda-forge has up to Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What we could do is, download from the OpenImageIO repo binaries and install them directly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenImageIO repo does not currently provide pre-built binaries. However, this OSL repo already has a src/build-scripts/build_openimageio.bash that can build OIIO from scratch. |
||
else | ||
echo -e "${GREEN}osl-env environment already exists.${NC}" | ||
|
||
# Activate the environment | ||
conda activate osl-env | ||
fi | ||
|
||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the customary copyright notice here.