mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.19k stars 138 forks source link

[Installation] installing Google's sparse hashmap without root #271

Closed hdacnw closed 9 months ago

hdacnw commented 10 months ago

Is there an existing issue for this?

Have you followed all the steps in the FAQ?

Current Behavior

I've installed sparse hashmap in ~/.local/lib following https://github.com/mit-han-lab/torchsparse/issues/15 How do I reference it?

Error Line

No such file or directory #include <sparsehash/internal/sparseconfig.h>

Environment

- GCC:
- NVCC:
- PyTorch:
- PyTorch CUDA:

Full Error Log

Error Log [PUT YOUR ERROR LOG HERE]
zhijian-liu commented 9 months ago

Could you please try installing TorchSparse with PyPI:

python -c "$(curl -fsSL https://raw.githubusercontent.com/mit-han-lab/torchsparse/master/install.py)"
ys-2020 commented 9 months ago

Hi @hdacnw, please refer to this file for the installation of Google Sparse Hash. https://github.com/sparsehash/sparsehash/blob/master/INSTALL

ioeddk commented 9 months ago

If you want to simply install google-sparsehash to build your Torchsparse in developer mode, you can install sparsehash with conda. Please refer to here. And in setup.py, add a gcc compile flag to include the sparsehash pointing to its Conda installation.

hdacnw commented 9 months ago

I added in library_dirs=['<CUSTOM_DIR>/lib'], include_dirs['<CUSTOM_DIR>/include'] in setup.py and was able to install. Thanks!