Torch dependencies when installing from source

I have installed PyTorch from source using an Anaconda environment.

I did setup CMAKE_PREFIX_PATH to point to anaconda’s root directory. After installation it seems that Torch dependencies are linked to system shared libraries, and not to those in anaconda3/lib/. Is this normal?

More precisely, should be linked to [...]/anaconda3/lib/ and/or should be linked to [...]/anaconda3/lib/ instead of /usr/lib/x86_64-linux-gnu/

$ ldd torch/lib/ =>  (0x00007fffeebe7000) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/ (0x00007fb1aac3a000) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/ (0x00007fb1a8289000) => /home/tudor/pytorch/torch/lib/ (0x00007fb1a7c92000) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/ (0x00007fb1a3d29000) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/ (0x00007fb1a121a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fb1a0e98000) => /lib/x86_64-linux-gnu/ (0x00007fb1a0b8f000) => /lib/x86_64-linux-gnu/ (0x00007fb1a0978000) => /lib/x86_64-linux-gnu/ (0x00007fb1a05af000)
	/lib64/ (0x0000562627347000) => /lib/x86_64-linux-gnu/ (0x00007fb1a03ab000) => /lib/x86_64-linux-gnu/ (0x00007fb1a018d000) => /lib/x86_64-linux-gnu/ (0x00007fb19ff85000) => not found => not found => not found => not found => /usr/lib/x86_64-linux-gnu/ (0x00007fb19fd61000)
1 Like

Which libgomp will be used depends on the compiler you used to build PyTorch. If you install gcc from anaconda, it will be linked with /anaconda3/lib/, if you use a system compiler, it will be linked with a system-wide lib dir. Both ways should work ok.

1 Like