martedì 24 maggio 2011

Maya 2012 x64 on Ubuntu 11.04

Maya 2012 x64 is incredibly fast on Ubuntu 11.04. Unfortunately Autodesk doesn't support Ubuntu and the packages we can download are rpms. Anyway, I'm trying Maya now and it works very well on ubuntu 11.04. Here the steps I followed to install Maya 2012 Hotfix 1:

First of all, we have to install required packages (packages in red should be already installed, orange packages are optional):

 stefano@SERVER:~$ sudo apt-get install csh tcsh libglw1-mesa libglw1-mesa-dev mesa-utils libaudiofile-dev libaudiofile0 libaudiofile0-dbg elfutils gamin libxp6 libxpm4 libxt6 libxp6 libxmu6 libxau6 libxinerama1 libxprintapputil1 libxprintutil1 xfs xfstt ttf-liberation ttf-mscorefonts-installer xfonts-100dpi xfonts-75dpi alien

We can unpack Maya wherever we want. I will unpack Maya in my home directory, then I will rename the folder as Maya2012. The following command will create the deb packages for Ubuntu. It will allow us to install/uninstall Maya easily.

 stefano@SERVER:~$ for i in *.rpm; do sudo alien -cv $i; done

Now, we can install the packages (I won't install dmm plugin and Backburner because I don't need them):

 stefano@SERVER:~$ sudo dpkg -i adlmapps4_4.0.35-1_amd64.deb

 stefano@SERVER:~$ sudo dpkg -i adlmflexnetserver_4.0.35-1_amd64.deb

 stefano@SERVER:~$ sudo dpkg -i adlmflexnetclient_4.0.35-1_amd64.deb

 stefano@SERVER:~$ sudo dpkg -i maya2012-0-64_2012.0-236_amd64.deb

 stefano@SERVER:~$ sudo dpkg -i composite-2012_2012.0-2503_amd64.deb

 stefano@SERVER:~$ sudo dpkg -i matchmover2012-0-64_2012.0-623_amd64.deb

Now we can create a temporary folder for Maya:

 stefano@SERVER:~$ sudo mkdir /usr/tmp

 stefano@SERVER:~$ sudo chmod 777 /usr/tmp

The following command should fix an old gui bug. It will add a line like this:

‘setenv LC_ALL en_US.UTF-8′

at the end of /usr/autodesk/maya/bin/maya2012.
I'm not sure this step is still important for Maya 2012. For example, in my case, I don't need it. (I have an Italian keyboard layout).

 stefano@SERVER:~$ sudo sh -c “echo ‘setenv LC_ALL en_US.UTF-8′ >> /usr/autodesk/maya2012-x64/bin/maya2012″

Let's think about the licensing system now:

 stefano@SERVER:~$ /usr/autodesk/maya2012-x64/bin/licensechooser /usr/autodesk/maya2012-x64/ standalone unlimited

Now we have to export a couple of variables.

 stefano@SERVER:~$ sudo -i

 root@SERVER:~$ export MAYA_LOCATION=/usr/autodesk/maya2012-x64

 root@SERVER:~$ export LD_LIBRARY_PATH=/opt/Autodesk/Adlm/R4/lib64/

Now we can pass the serial number and the product key to Maya:

 root@SERVER:~$ /usr/autodesk/maya2012-x64/bin/adlmreg -i S 657D1 657D1 2012.0.0.F serial_number /var/opt/Autodesk/Adlm/Maya2012/MayaConfig.pit

Let's navigate to our Maya2012 folder:

 root@SERVER:~$ cd /home/stefano/maya2012

to run setup (we have to follow the instructions, I have disabled dmm and backburner). Setup will create install.env in /var/opt/Autodesk/Adlm/Maya2012.

Note (feel free to skip this step): some site suggests to create a file named mayaInstall.c in Maya2012.  This file will avoid errors when setup will try to install rpms. We know that a rpm file cannot be installed on Ubuntu and setup would return errors. How does it work? Create a file named mayaInstall.c (name isn't important) wherever you want, open it with your text editor and paste this line:

int main (void) {return 0;}

save and compile it with this command:

gcc mayainstall.c

now you should have a file called a.out. Backup your /usr/bin/rpm with this command:

sudo mv /usr/bin/rpm /usr/bin/rpm_backup

and replace rpm with a.out:

sudo cp a.out /usr/bin/rpm

in this way, when the installer will try to call /usr/bin/rpm, the process won't return errors and the exit status will be succesful (return 0;). At the end of the process, you have to delete this fake rpm and replace it with the real rpm program.

 root@SERVER:~$ ./setup

We can navigate to our Maya's lib folder to fix the last dependencies:

 root@SERVER:~$ cd /usr/autodesk/maya2012-x64/lib/

First of all, we need dependent OpenGL libraries (NVidia, AMD). If you have an NVidia card, you'll find in /usr/lib/nvidia-current and libGLw (from mesa-libGLw) in /usr/lib. Check them out.

Maya still needs New default location for* in a 64 bit box is /usr/lib64/x86_64-linux-gnu. We don't need to recompile it from source:
 root@SERVER:~$ ln -s /usr/lib64/x86_64-linux-gnu/ /usr/lib/

If there are no system** libraries, we can manually create local symbolic links

 root@SERVER:~$ ln -s /usr/lib/

 root@SERVER:~$ ln -s /usr/lib/

the very last step (needed if you haven't an English keyboard layout):

Open /usr/autodesk/maya2012-x64/bin/maya2012 with a text editor and add the command

setenv LC_ALL C

after this line



Now it's possible to run Maya. Enjoy this wonderful program.

Best regards.