How to resolve "C++ standard version definition detected in environment variable."?

Since the GPU on my target machine is of compute capability 3.5, I am trying to compile pytorch from source. I’m following the standard installation steps given on the Github.

I have done all the steps right but I keep getting this warning.

(old) [akshaypaygude@node07 pytorch]$ python setup.py install
Building wheel torch-2.0.0a0+gitUnknown
– Building version 2.0.0a0+gitUnknown
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_ARGS=-DCMAKE_LINKER=/home/akshaypaygude/anaconda3/envs/old/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/home/akshaypaygude/anaconda3/envs/old/bin/x86_64-conda-linux-gnu-strip -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/akshaypaygude/pytorch/torch -DCMAKE_PREFIX_PATH=/home/akshaypaygude/anaconda3/envs/old/lib/python3.10/site-packages;/home/akshaypaygude/anaconda3/envs/old:/home/akshaypaygude/anaconda3/envs/old/x86_64-conda-linux-gnu/sysroot/usr -DPYTHON_EXECUTABLE=/home/akshaypaygude/anaconda3/envs/old/bin/python -DPYTHON_INCLUDE_DIR=/home/akshaypaygude/anaconda3/envs/old/include/python3.10 -DPYTHON_LIBRARY=/home/akshaypaygude/anaconda3/envs/old/lib/libpython3.10.a -DTORCH_BUILD_VERSION=2.0.0a0+gitUnknown -DUSE_NUMPY=True /home/akshaypaygude/pytorch
– The CXX compiler identification is GNU 11.2.0
– The C compiler identification is GNU 11.2.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /home/akshaypaygude/anaconda3/envs/old/bin/x86_64-conda-linux-gnu-c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /home/akshaypaygude/anaconda3/envs/old/bin/x86_64-conda-linux-gnu-cc - skipped
– Detecting C compile features
– Detecting C compile features - done
CMake Warning at CMakeLists.txt:36 (message):
*** C++ standard version definition detected in environment variable.PyTorch***
*** requires -std=c++17. Please remove -std=c++ settings in your environment.***

Although, the installation will continue with the warning but I suspect later it will throw errors.
Please help.