Skip to content

Commit

Permalink
add shellcheck to pre-commit-config.yaml (facebookresearch#509)
Browse files Browse the repository at this point in the history
* add shellcheck to pre-commit-config.yaml
* Remove troublesome shell script from pre-commit check
* Fix remaining ddppo issues
Co-authored-by: Aaron Gokaslan <[email protected]>
  • Loading branch information
eundersander authored Nov 12, 2020
1 parent 3d33da2 commit 9f80414
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ repos:
- 'isort==5.4.2'
always_run: false
language: python

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.7.1.1
hooks:
- id: shellcheck
exclude: ^habitat_baselines/slambased/
3 changes: 2 additions & 1 deletion habitat_baselines/rl/ddppo/multi_node_slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
export GLOG_minloglevel=2
export MAGNUM_LOG=quiet

export MASTER_ADDR=$(srun --ntasks=1 hostname 2>&1 | tail -n1)
MASTER_ADDR=$(srun --ntasks=1 hostname 2>&1 | tail -n1)
export MASTER_ADDR

set -x
srun python -u -m habitat_baselines.run \
Expand Down
2 changes: 1 addition & 1 deletion habitat_baselines/rl/ddppo/single_node.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash

export GLOG_minloglevel=2
export MAGNUM_LOG=quiet
Expand Down
54 changes: 27 additions & 27 deletions habitat_baselines/slambased/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,61 @@

DIR1=$(pwd)
MAINDIR=$(pwd)/3rdparty
mkdir ${MAINDIR}
cd ${MAINDIR}
mkdir "${MAINDIR}"
cd "${MAINDIR}" || exit
#conda create -y -n "HandcraftedAgents" python=3.6
source activate HandcraftedAgents
conda install opencv -y
conda install pytorch torchvision -c pytorch -y
conda install -c conda-forge imageio -y
conda install ffmpeg -c conda-forge -y
cd ${MAINDIR}
cd "${MAINDIR}" || exit
mkdir eigen3
cd eigen3
cd eigen3 || exit
wget http://bitbucket.org/eigen/eigen/get/3.3.5.tar.gz
tar -xzf 3.3.5.tar.gz
cd eigen-eigen-b3f3d4950030
cd eigen-eigen-b3f3d4950030 || exit
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${MAINDIR}/eigen3_installed/
cd build || exit
cmake .. -DCMAKE_INSTALL_PREFIX="${MAINDIR}"/eigen3_installed/
make install
cd ${MAINDIR}
cd "${MAINDIR}" || exit
wget https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip
unzip glew-2.1.0.zip
cd glew-2.1.0/
cd build
cmake ./cmake -DCMAKE_INSTALL_PREFIX=${MAINDIR}/glew_installed
cd glew-2.1.0/ || exit
cd build || exit
cmake ./cmake -DCMAKE_INSTALL_PREFIX="${MAINDIR}"/glew_installed
make -j4
make install
cd ${MAINDIR}
cd "${MAINDIR}" || exit
#pip install numpy --upgrade
rm Pangolin -rf
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
cd Pangolin || exit
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=${MAINDIR}/glew_installed/ -DCMAKE_LIBRARY_PATH=${MAINDIR}/glew_installed/lib/ -DCMAKE_INSTALL_PREFIX=${MAINDIR}/pangolin_installed
cd build || exit
cmake .. -DCMAKE_PREFIX_PATH="${MAINDIR}"/glew_installed/ -DCMAKE_LIBRARY_PATH="${MAINDIR}"/glew_installed/lib/ -DCMAKE_INSTALL_PREFIX="${MAINDIR}"/pangolin_installed
cmake --build .
cd ${MAINDIR}
cd "${MAINDIR}" || exit
rm ORB_SLAM2 -rf
rm ORB_SLAM2-PythonBindings -rf
git clone https://github.com/ducha-aiki/ORB_SLAM2
git clone https://github.com/ducha-aiki/ORB_SLAM2-PythonBindings
cd ${MAINDIR}/ORB_SLAM2
cd "${MAINDIR}"/ORB_SLAM2 || exit
sed -i "s,cmake .. -DCMAKE_BUILD_TYPE=Release,cmake .. -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR=${MAINDIR}/eigen3_installed/include/eigen3/ -DCMAKE_INSTALL_PREFIX=${MAINDIR}/ORBSLAM2_installed ,g" build.sh
ln -s ${MAINDIR}/eigen3_installed/include/eigen3/Eigen ${MAINDIR}/ORB_SLAM2/Thirdparty/g2o/g2o/core/Eigen
ln -s "${MAINDIR}"/eigen3_installed/include/eigen3/Eigen "${MAINDIR}"/ORB_SLAM2/Thirdparty/g2o/g2o/core/Eigen
./build.sh
cd build
cd build || exit
make install
cd ${MAINDIR}
cd ORB_SLAM2-PythonBindings/src
ln -s ${MAINDIR}/eigen3_installed/include/eigen3/Eigen Eigen
cd ${MAINDIR}/ORB_SLAM2-PythonBindings
cd "${MAINDIR}" || exit
cd ORB_SLAM2-PythonBindings/src || exit
ln -s "${MAINDIR}"/eigen3_installed/include/eigen3/Eigen Eigen
cd "${MAINDIR}"/ORB_SLAM2-PythonBindings || exit
mkdir build
cd build
CONDA_DIR=$(dirname $(dirname $(which conda)))
cd build || exit
CONDA_DIR="$(dirname $(dirname \"$(which conda)\"))"
sed -i "s,lib/python3.5/dist-packages,${CONDA_DIR}/envs/HandcraftedAgents/lib/python3.6/site-packages/,g" ../CMakeLists.txt
cmake .. -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")/libpython3.6m.so -DPYTHON_EXECUTABLE:FILEPATH=`which python` -DCMAKE_LIBRARY_PATH=${MAINDIR}/ORBSLAM2_installed/lib -DCMAKE_INCLUDE_PATH=${MAINDIR}/ORBSLAM2_installed/include;${MAINDIR}/eigen3_installed/include/eigen3 -DCMAKE_INSTALL_PREFIX=${MAINDIR}/pyorbslam2_installed
cmake .. -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")/libpython3.6m.so -DPYTHON_EXECUTABLE:FILEPATH=$(which python) -DCMAKE_LIBRARY_PATH="${MAINDIR}"/ORBSLAM2_installed/lib -DCMAKE_INCLUDE_PATH="${MAINDIR}"/ORBSLAM2_installed/include;"${MAINDIR}"/eigen3_installed/include/eigen3 -DCMAKE_INSTALL_PREFIX="${MAINDIR}"/pyorbslam2_installed
make
make install
cp ${MAINDIR}/ORB_SLAM2/Vocabulary/ORBvoc.txt ${DIR1}/data/
cp "${MAINDIR}"/ORB_SLAM2/Vocabulary/ORBvoc.txt "${DIR1}"/data/

0 comments on commit 9f80414

Please sign in to comment.