warp icon indicating copy to clipboard operation
warp copied to clipboard

Building from source with conda

Open jc211 opened this issue 1 year ago • 4 comments

In a conda environment, the current build scripts do not find the appropriate CUDA headers required to compile. Its somewhat difficult to debug since the build scripts are custom.

jc211 avatar May 04 '24 23:05 jc211

Hi @jc211, can you provide some information to help us reproduce it? What OS are you on? What does your environment.yml file look like? You probably will need to set --cuda_path to an appropriate location.

shi-eric avatar May 07 '24 16:05 shi-eric

@alberthli and I are hitting this same issue -- and made some headway on reproducing/debugging it.

Here's some code to set up a vanilla conda env + try to build warp:

$ conda create -n warp-test python=3.10
$ conda install -c nvidia/label/cuda-12.2.2 cuda # install cuda toolkit
$ python build_lib.py # errors due to linking issues

We found if you run conda install -c conda-forge cxx-compiler it's able to find the headers (sometimes we had to run export CUDA_PATH=$CONDA_PREFIX).

However, we still are getting build errors -- specifically, during the clang/llvm portion, we get:

warp/_build/host-deps/llvm-project/release-x86_64/include/llvm/Object/SymbolicFile.h:48:30: error: expected ')' before 'PRIxPTR'
   48 |   OS << "(" << format("0x%08" PRIxPTR, D.p) << " (" << format("0x%08x", D.d.a)

So it still looks like some of the macros aren't getting linked properly. We can still build/use the library by passing --no_standalone to build_lib.py but aren't sure if this will cause issues down the line. Thanks!!

pculbertson-bdai avatar Jun 25 '24 21:06 pculbertson-bdai

I think you're on the right track with conda install -c conda-forge cxx-compiler. Can you tell me what version of GCC this installs? You may also need a newer glibc version. Try installing a specific version like conda install -c conda-forge libstdcxx-ng=9.5.

c0d1f1ed avatar Jul 02 '24 17:07 c0d1f1ed

In case anyone is interested in this, we have some patches and build scripts in https://github.com/conda-forge/warp-lang-feedstock/tree/main/recipe to build warp with conda-forge dependencies.

traversaro avatar Oct 02 '24 22:10 traversaro