View Full Version : Linux Dynamic Library (.so) linking problems with Mental Ray custom shader?

August 13th, 2012, 15:43

I have writtten a mental ray shader ocean.so that is linked to another .so file placed at a perticular location on my Linux system which is a FFT library (http://www.fftw.org/) . I am running my shader in maya 2012 on a Centos system . I dont know how to get maya to link with the FFT library. My shader compiles properly but crashes when made to run in Maya. Please help !!!

Thanks a million in advance for all your help!!

P.S:Let me know if you need me to give you any more details.

August 13th, 2012, 21:37
put it in the same folder of your mr shader, create an alias or whatever is called in linux or add the path to your libs to system. For stuff like this if that's avail you may wanna compile it statically probably.

August 14th, 2012, 07:34
thanks maxt but I have done that and it doesn't work . But I have found the SOLUTION .
For thouse who do come accross the same problem where they have a dynamic library(eg. a scientific library) linked to another dynamic library(eg. coustom mental ray shader) to your program(eg. maya) on linux .
You need to set the environment variable "LD_LIBRARY_PATH" to access the scientific library and then run your program .
$ LD_LIBRARY_PATH=/usr/local/fftw/3.3.2-gcc/lib

Hope this helps anyone whos got as fried over such a simple thing like me :)

cheers and thanks

August 14th, 2012, 17:56
that's the third option I gave you, add your path to the sys. eventually take care that LD_LIBRARY_PATH should be used only for dev/test, http://xahlee.info/UnixResource_dir/_/ldpath.html :twisted: