Skip to content

Commit 0a5e326

Browse files
authored
Packaging setup (#237)
1 parent 225f92f commit 0a5e326

File tree

13 files changed

+754
-108
lines changed

13 files changed

+754
-108
lines changed

.circleci/config.yml

Lines changed: 227 additions & 91 deletions
Large diffs are not rendered by default.

.circleci/unittest/linux/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ dependencies:
2525
- mujoco_py
2626
- hydra-core
2727
- pyrender
28+
- tensorboard

.circleci/unittest/linux/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pip install "git+https://github.com/pytorch/functorch.git"
5353
python -c "import functorch"
5454

5555
printf "* Installing torchrl\n"
56-
pip install -e .
56+
python setup.py develop
5757

5858
if [[ $OSTYPE == 'darwin'* ]]; then
5959
PRIVATE_MUJOCO_GL=glfw

.circleci/unittest/linux_optdeps/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pip install "git+https://github.com/pytorch/functorch.git"
5353
python -c "import functorch"
5454

5555
printf "* Installing torchrl\n"
56-
pip install -e .
56+
python setup.py develop
5757

5858
# smoke test
5959
python -c "import torchrl"

.circleci/unittest/linux_stable/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ dependencies:
2626
- mujoco_py
2727
- hydra-core
2828
- pyrender
29+
- tensorboard

.circleci/unittest/linux_stable/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ printf "* Installing torchrl\n"
5252
printf "g++ version: "
5353
gcc --version
5454

55-
pip install -e .
55+
python setup.py develop
5656

5757
if [[ $OSTYPE == 'darwin'* ]]; then
5858
PRIVATE_MUJOCO_GL=glfw

packaging/build_wheels.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
5+
. "$script_dir/pkg_helpers.bash"
6+
7+
export BUILD_TYPE=wheel
8+
setup_env
9+
setup_wheel_python
10+
pip_install numpy pyyaml future ninja
11+
pip_install --upgrade setuptools
12+
setup_pip_pytorch_version
13+
python setup.py clean
14+
15+
# Copy binaries to be included in the wheel distribution
16+
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
17+
python_exec="$(which python)"
18+
bin_path=$(dirname $python_exec)
19+
env_path=$(dirname $bin_path)
20+
if [[ "$(uname)" == Darwin ]]; then
21+
# Install delocate to relocate the required binaries
22+
pip_install "delocate>=0.9"
23+
else
24+
cp "$bin_path/Library/bin/libpng16.dll" torchvision
25+
cp "$bin_path/Library/bin/libjpeg.dll" torchvision
26+
fi
27+
else
28+
# Install auditwheel to get some inspection utilities
29+
pip_install auditwheel
30+
31+
# Point to custom libraries
32+
export LD_LIBRARY_PATH=$(pwd)/ext_libraries/lib:$LD_LIBRARY_PATH
33+
fi
34+
35+
if [[ "$OSTYPE" == "msys" ]]; then
36+
echo "ERROR: Windows installation is not supported yet." && exit 100
37+
else
38+
python setup.py bdist_wheel
39+
if [[ "$(uname)" != Darwin ]]; then
40+
rename "linux_x86_64" "manylinux1_x86_64" dist/*.whl
41+
fi
42+
fi
43+
44+
#if [[ "$(uname)" == Darwin ]]; then
45+
# pushd dist/
46+
# python_exec="$(which python)"
47+
# bin_path=$(dirname $python_exec)
48+
# env_path=$(dirname $bin_path)
49+
# for whl in *.whl; do
50+
# DYLD_FALLBACK_LIBRARY_PATH="$env_path/lib/:$DYLD_FALLBACK_LIBRARY_PATH" delocate-wheel -v --ignore-missing-dependencies $whl
51+
# done
52+
#else
53+
# if [[ "$OSTYPE" == "msys" ]]; then
54+
# "$script_dir/windows/internal/vc_env_helper.bat" python $script_dir/wheel/relocate.py
55+
# else
56+
# LD_LIBRARY_PATH="/usr/local/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" python $script_dir/wheel/relocate.py
57+
# fi
58+
#fi

0 commit comments

Comments
 (0)