Skip to content

Commit 5a2222a

Browse files
author
Vincent Moens
committed
[Setup] Making tensordict pytorch-agnostic
ghstack-source-id: 5499541 Pull Request resolved: #1256
1 parent 6d8119c commit 5a2222a

File tree

16 files changed

+181
-52
lines changed

16 files changed

+181
-52
lines changed

.github/scripts/linux-post-script.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/bash
22

3-
yum update gcc
4-
yum update libstdc++
3+
if [ "$(uname)" != "Darwin" ]; then
4+
yum update gcc
5+
yum update libstdc++
6+
else
7+
brew update
8+
brew upgrade gcc
9+
fi

.github/scripts/linux-pre-script.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
if [ "$(uname)" != "Darwin" ]; then
4+
yum update gcc
5+
yum update libstdc++
6+
else
7+
echo $(gcc --version)
8+
echo $(clang --version)
9+
brew update
10+
brew upgrade gcc
11+
brew upgrade clang
12+
13+
# For OSX
14+
# export CXXFLAGS="-march=armv8-a+fp16+sha3"
15+
export CMAKE_OSX_ARCHITECTURES=arm64
16+
fi
17+
18+
${CONDA_RUN} conda install -c conda-forge pybind11 -y

.github/scripts/version_script.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
set TENSORDICT_BUILD_VERSION=0.8.0
33
echo TENSORDICT_BUILD_VERSION is set to %TENSORDICT_BUILD_VERSION%
44

5+
if "%CONDA_RUN%"=="" (
6+
echo CONDA_RUN is not set. Please activate your conda environment or set CONDA_RUN.
7+
exit /b 1
8+
)
9+
10+
:: Run the pip install command
11+
%CONDA_RUN% conda install -c conda-forge pybind11 -y
12+
513
@echo on
614

715
set VC_VERSION_LOWER=17

.github/scripts/version_script.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
#!/bin/bash
22

33
export TENSORDICT_BUILD_VERSION=0.8.0
4+
5+
if [ "$(uname)" == "Darwin" ]; then
6+
# For OSX
7+
echo $(gcc --version)
8+
echo $(clang --version)
9+
brew update
10+
brew install gcc
11+
brew install clang-build-analyzer
12+
brew install --cask clay
13+
brew install llvm
14+
# brew upgrade gcc
15+
# brew upgrade clang
16+
# export CXXFLAGS="-march=armv8-a+fp16+sha3"
17+
export CMAKE_OSX_ARCHITECTURES=arm64
18+
fi
19+
20+
${CONDA_RUN} conda install -c conda-forge pybind11 -y

.github/scripts/win-pre-script.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
:: Check if CONDA_RUN is set, if not, set it to a default value
3+
if "%CONDA_RUN%"=="" (
4+
echo CONDA_RUN is not set. Please activate your conda environment or set CONDA_RUN.
5+
exit /b 1
6+
)
7+
8+
:: Run the pip install command
9+
%CONDA_RUN% conda install -c conda-forge pybind11 -y
10+
11+
:: Check if the installation was successful
12+
if errorlevel 1 (
13+
echo Failed to install cmake and pybind11.
14+
exit /b 1
15+
) else (
16+
echo Successfully installed cmake and pybind11.
17+
)

.github/unittest/linux/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ dependencies:
1919
- coverage
2020
- h5py
2121
- orjson
22+
- ninja
2223
- numpy<2.0.0

.github/unittest/linux/scripts/setup_env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ pip install pip --upgrade
5353

5454
conda env update --file "${this_dir}/environment.yml" --prune
5555

56+
conda install anaconda::cmake -y
57+
conda install -c conda-forge pybind11 -y
58+
5659
#if [[ $OSTYPE == 'darwin'* ]]; then
5760
# printf "* Installing C++ for OSX\n"
5861
# conda install -c conda-forge cxx-compiler -y

.github/unittest/rl_linux_optdeps/scripts/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ dependencies:
1616
- pyyaml
1717
- scipy
1818
- orjson
19+
- ninja
1920
- numpy<2.0.0

.github/unittest/rl_linux_optdeps/scripts/setup_env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ pip install pip --upgrade
6060

6161
conda env update --file "${this_dir}/environment.yml" --prune
6262

63+
conda install anaconda::cmake -y
64+
conda install -c conda-forge pybind11 -y
65+
6366
#yum makecache
6467
#yum -y install glfw-devel
6568
#yum -y install libGLEW

.github/workflows/build-wheels-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
include:
3434
- repository: pytorch/tensordict
3535
smoke-test-script: test/smoke_test.py
36+
pre-script: .github/scripts/linux-pre-script.sh
3637
post-script: .github/scripts/linux-post-script.sh
3738
package-name: tensordict
3839
name: pytorch/tensordict

0 commit comments

Comments
 (0)