Saturday, July 3, 2010

Compiling the HotOcean deformer for the MAYA2008



This is operation i use for compiling HotOcean plugin writed by Igor Žanić
source code of HotOcean located: http://sites.google.com/site/igorvfxsite/igorfx


OS - OpenSuse11.2
Maya2008
GCC4.1 compiler


So compiling:
g++-4.1 -c -I. -I.. -I/usr/autodesk/maya2008-x64/include -I/usr/include/OpenEXR -I/usr/X11R6/include -DBits64_ -m64 -DUNIX -D_BOOL -DLINUX -DFUNCPROTO -D_GNU_SOURCE -DLINUX_64 -fPIC -fno-strict-aliasing -DREQUIRE_IOSTREAM -Wno-deprecated -O3 -Wall -Wno-multichar -Wno-comment -Wno-sign-compare -funsigned-char -Wno-reorder -fno-gnu-keywords -ftemplate-depth-25 -pthread  -Wno-deprecated -fno-gnu-keywords hotOcean.cpp

and linking:
g++-4.1 -DBits64_ -m64 -DUNIX -D_BOOL -DLINUX -DFUNCPROTO -D_GNU_SOURCE -DLINUX_64 -fPIC -fno-strict-aliasing -DREQUIRE_IOSTREAM -Wno-deprecated -O3 -Wall -Wno-multichar -Wno-comment -Wno-sign-compare -funsigned-char -Wno-reorder -fno-gnu-keywords -ftemplate-depth-25 -pthread  -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic  -shared -o hotOcean.so hotOcean.o -L/usr/lib64/ -lfftw3f -lm -lblitz -lImath -L/usr/autodesk/maya2008-x64/lib -lOpenMaya -lFoundation -lOpenMayaAnim


After loading hotOcean.so in Maya I use by Igor Žanić video.

HOT for Maya - ocean spray - basic tutorial from Igor Zanic on Vimeo.

24 comments:

  1. Hey Alex

    This looks great, is there any chance you could provide a little more instruction for this compile please?

    I'm attempting to run it under Fedora 11 64bit and am getting errors regarding:

    Ocean.h:73:19: error: fftw3.h: No such file or directory
    Ocean.h:84:25: error: blitz/array.h: No such file or directory
    Ocean.h:87:25: error: ImathRandom.h: No such file or directory

    I have installed blitz and fftw so not sure where to go from here.

    Any help appreciated

    Regards

    Craig

    ReplyDelete
  2. Hi Craig!
    Sorry, I planned to write a step by step instructions but not found the time....
    Tomorrow I will write that will remember :)

    Best Regards
    Alex

    ReplyDelete
  3. Hi Craig!
    So, let's look.
    1. Libraries
    You said - blitz and fftw is instaled on your Fedora.
    Just remember about OpenEXR library - ImathRandom.h thence.

    Ok, then check it locations
    - for COMPILING
    /usr/local/include/fftw3.h - there located fftw3 header
    /usr/local/include/blitz/ - there located blitz library headers
    /usr/include/OpenEXR/ - there located OpenEXR library headers

    - for LINKING
    /usr/local/lib - there located: libblitz.a, libblitz.la, libfftw3.a, libfftw3.la ( I found in /usr/lib64 libfftw3.a, libfftw3.la too)
    /usr/lib64 - there located EXR libs: libIlmImf.so and other libIlm* (*.so *.la, *.a - files)

    2. Code
    I dont programmer and long tormented - move declaration from "hotOcean.h" to "hotOcean.cpp".
    I know it violates main rules programming. But this plugin is not very complicated.
    "Ocean.h" - I moved to root of project.

    So, I upload zipped archive with code and compiled plugin. I am not sure in working compiled plugin on Fedora, but You try it.

    Best regards!
    Alex

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Sorry, I've been away for a few days, this look's great, going to try it now and will report back to you!

    Thanks very much

    Craig

    ReplyDelete
  6. Hi Alex, Thanks for your explanation. But it seems im to stupid to get the compile working on Fedora 11. I'm getting a load of blitz errors which don't make any sense to me. Would it be possbile to reupload the compile you did for Craig? The hotfile link seems dead...
    Thanks a lot,

    cheers, Koen

    ReplyDelete
  7. Hi Koen!
    I reupload compiled version
    http://www.4shared.com/file/Jq8RvqR_/HotOcean.html.
    Write me pls about any problems with this files. I think you may be need other lib files. But it is assumption :)

    Best regards, Alex

    ReplyDelete
  8. Hi Alex!
    thanks for the upload, seems to work great! Funny but just after I've downloaded your file, my college got the compile to work :).
    But thanks alot!

    cheers, Koen

    ReplyDelete
  9. Hi Koen! I glad about your solution this work!!
    cheerrs, Alex!

    ReplyDelete
  10. Hey Alex, after all that time and no response I'm back again!

    We ended up not using the plugin in our last production and I was so busy it plain disappeared from my mind, so massive apologies for not comign back and letting you know how I got on.

    I'm now trying to do a compile of this plugin against Maya2011 64 bit on Fed 11 and am coming up with the following error when running command g++ hotOcean.cpp:

    (.text+0x20): undefined reference to `main'

    Any ideas?

    Cheers

    C

    ReplyDelete
  11. Just to update, I've created the hotocean.o file no problem, the issue seems to be with the version of g++ I'm using.

    Trying to source a 4.1 version.

    Will update further when I know more!

    Cheers

    Craig

    ReplyDelete
  12. Hi, sorry for my delayed response.
    I am not big expert in С++, but I consider - g++ needs using it with some keys like in my post. And you must checking g++ symlink. It must to point to g++-4.1. Maya API work with GCC4.1 only. It's sad because my new OpenSuse11.4 does not have this compiler - 4.4 only.
    So I can not yet compile it under Maya 2011-2012.
    Alex

    ReplyDelete
  13. Thanks Alex

    It works to create the .o file but then when I try linking it falls over and looks like not having 4.1 is the issue.

    I'm going to setup an old box and see if I can do it.

    Will keep you posted!

    Regards

    Craig

    ReplyDelete
  14. Hey did you also compile the mentalray shader?

    ReplyDelete
  15. I managed to compile the mentalray shader but I get a crash when I render the shader...

    ReplyDelete
  16. Hi Robbert. I newer develop mental ray shaders so I have no practice with compiling it. Unfortunately I am very busy soon. But I think practice with compiling MR shaders would good for me. Which version MR you are using?

    ReplyDelete
  17. That would be very cool!! I am using mentalray 3.8.1.26 for maya 2011.

    ReplyDelete