ToniRV / NeRF-SLAM

NeRF-SLAM: Real-Time Dense Monocular SLAM with Neural Radiance Fields. https://arxiv.org/abs/2210.13641 + Sigma-Fusion: Probabilistic Volumetric Fusion for Dense Monocular SLAM https://arxiv.org/abs/2210.01276
BSD 2-Clause "Simplified" License
1.2k stars 149 forks source link

Error building the gtsam branch #51

Open behnamasadi opened 1 year ago

behnamasadi commented 1 year ago

I got an error during building the project on gtsam (the branch that has been used for this project on the line cmake --build build_gtsam --config RelWithDebInfo) I got the following error:

#0 3.429 pyparsing.exceptions.ParseException: Expected string_end, found 'namespace'  (at char 1249), (line:46, col:1)
#0 3.450 make[2]: *** [python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/build.make:76: python/gtsam_unstable.cpp] Error 1
#0 3.450 make[1]: *** [CMakeFiles/Makefile2:32340: python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/all] Error 2

and if it continues:

#0 50.92 /NeRF-SLAM/thirdparty/gtsam/gtsam/sfm/DsfTrackGenerator.cpp: In function 'gtsam::gtsfm::DSFMapIndexPair gtsam::gtsfm::generateDSF(const MatchIndicesMap&)':
#0 50.92 /NeRF-SLAM/thirdparty/gtsam/gtsam/sfm/DsfTrackGenerator.cpp:41:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'Eigen::Index' {aka 'long int'} [-Wsign-compare]
#0 50.92    41 |     for (size_t k = 0; k < corr_indices.rows(); k++) {
#0 50.92       |                        ~~^~~~~~~~~~~~~~~~~~~~~

so I containerized the project to avoid dependencies problem, below is my docker image:


MAINTAINER Behnam Asadi behnam.asadi@gmail.com

# this is for timezone config
ENV DEBIAN_FRONTEND=noninteractive 
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#RUN apt-get update && apt upgrade -y
RUN apt-get update

# 1) Dependencies
RUN echo "************************ Dependencies ************************"
RUN apt-get install -y build-essential cmake git openssh-server apt-utils libgoogle-glog-dev libgflags-dev pip libssl-dev openssl xorg-dev libglew-dev libboost-all-dev

# 2) Installing latest version of CMake

RUN echo "************************ Installing latest version of CMake ************************"
WORKDIR "/"
RUN cd /
RUN git clone https://github.com/Kitware/CMake/
RUN cd CMake
WORKDIR "/CMake"
RUN ./bootstrap && make -j18 && make install
WORKDIR "/"
RUN cd /

# 3) CUDA 11.3
RUN echo "************************ CUDA 11.3 ************************"
RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113

# 4) Pip install 
RUN echo "************************ cloning NeRF-SLAM  ************************"
RUN git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules
RUN cd /NeRF-SLAM
WORKDIR "/NeRF-SLAM"
RUN git submodule update --init --recursive

# 5) Pip install 
RUN echo "************************ Pip install ************************"
RUN cd /NeRF-SLAM
WORKDIR "/NeRF-SLAM"
RUN pip install -r requirements.txt
RUN pip install -r ./thirdparty/gtsam/python/requirements.txt

# 6) Pip install 
RUN echo "************************ Compile ngp ************************"
RUN cmake ./thirdparty/instant-ngp -B build_ngp
RUN cmake --build build_ngp --config RelWithDebInfo -j18

# 7) Compile gtsam and enable the python wrapper:
RUN echo "************************ Compile gtsam and enable the python wrapper ************************"
RUN cmake ./thirdparty/gtsam -DGTSAM_BUILD_PYTHON=1 -B build_gtsam 
RUN cmake --build build_gtsam --config RelWithDebInfo -j18
RUN cd build_gtsam
RUN make python-install
JoseMFloresG commented 9 months ago

Can you share with us the complete docker image?