which compiler for H12?

   13171   12   0
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
Hi there, per the docs for 12:

—- SNIP —-
You need to determine which compiler built the version of Houdini that you are using. On Linux and Mac OSX, Houdini is built with the GNU compiler (gcc). The gcc version is embedded in the build's filename (i.e. houdini-X.Y.ZZZ-linux-x86_64-gcc4.1.tar.gz). It is not always required, though recommended, to build your HDK projects with the exact gcc version. For example, if Houdini is built with gcc 4.1 and you are using gcc 4.2, chances are your compiled HDK code will work perfectly with Houdini. However, if Houdini is built with gcc 3.4 and your HDK tools with gcc 4.3, then you may run into problems. You should check the GNU website to see which gcc versions are compatible and which are not.

On Windows, it is absolutely important that you compile your HDK code using the same compiler version that built Houdini. Here is a quick list of the available Houdini Windows versions and which compiler is used to build each one:

win32-vc7 -> built by the Microsoft Visual C++ .NET 2003 compiler
win32-vc8 -> built by the Microsoft Visual C++ 2005 compiler
win64 -> built by the Microsoft Visual C++ 2005 compiler
—- SNIP —-

From here:
http://www.sidefx.com/docs/hdk12.0/hdk_intro_compiling.html [sidefx.com]

It says I need VS 2005 to build plug-ins. However, when I do, I get an error saying that it was built with an older compiler. Doing some googling, it seems that we should be using VS 2008, is this right?

cheers,
Ez3s
User Avatar
Member
98 posts
Joined: Jan. 2008
Offline
vc9 is part of visual studio 2008 so from Houdini 12 on you can use visual studio 2008. As far as my experience goes this combination works fine.
User Avatar
Member
7715 posts
Joined: July 2005
Offline
Yes, Visual Studio 2008 is the only compiler used on Windows for Houdini 12. I've updated the HDK documentation to reflect the new Visual C++ compilers.
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
edward
Yes, Visual Studio 2008 is the only compiler used on Windows for Houdini 12. I've updated the HDK documentation to reflect the new Visual C++ compilers.

Okay, the reason I ask is because I'm trying to make a VS 2008 project for the SOP_Star plug-in. Now, I thought I had the right settings, I copied them from the command line (hcustom -d foo.c), but when I load the compiled plug-in into Houdini, the application crashes.

I should note that I have VS 2008 SP1, I'm hoping that doesn't matter.
User Avatar
Member
678 posts
Joined: July 2005
Offline
Are you sure your VisualStudio project is set correctly ? Just tested it on my computer and it works. VS is fully updated.
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
mantragora
Are you sure your VisualStudio project is set correctly ? Just tested it on my computer and it works. VS is fully updated.

Well, there's every chance I goofed somewhere, but where? Can you send me your VS 2008 project? I'll do a diff and compare what's missing. What workflow did you use? This is what I did:

- start a new project
- Win32, dll, empty project
- run “hcustom -d SOP_Star.c” > compileflags.txt
- copy the compile and link flags from txt file to Visual Studio 2008 project config.

These are the flags I copied over (compile):
-TP
-Zc:forScope
-DVERSION=“12.0.543.9”
-DI386
-DWIN32
-DSWAP_BITFIELDS
-D_WIN32_WINNT=0x0501
-DWINVER=0x0501
-DNOMINMAX
-I .
-I “CProgram Files (x86)/Microsoft Visual Studio 9.0/VC/include”
-I “CProgram Files/Microsoft SDKs/Windows/v6.0A/Include”
-I “CPROGRA~2/SIDEEF~1/HOUDIN~1.9/toolkit/include”
-Ox
-MD
-EHsc
-GR
-DSESI_LITTLE_ENDIAN
-DNEED_SPECIALIZATION_STORAGE
-DSIZEOF_VOID_P=4
-DMAKING_DSO

and these are the linking flags:

-LD
-link /libpath:“CProgram Files (x86)/Microsoft Visual Studio 9.0/VC/lib”
/libpath:“CProgram Files/Microsoft SDKs/Windows/v6.0A/Lib”
“CPROGRA~2/SIDEEF~1/HOUDIN~1.9/custom/houdini/dsolib/*.a”
“CPROGRA~2/SIDEEF~1/HOUDIN~1.9/custom/houdini/dsolib/*.lib”
-out:“CUsers/jagannr/Documents/houdini12.0/dso/SOP_Star.dll”

It's not clear to me what I'm missing, but it has to be something in the setup of the project. The ‘hcustom’ method uses the same compiler, the same libraries, so the only option has to be the setup, but what about the setup am I missing? That, I'm not sure.

Thoughts?
User Avatar
Member
98 posts
Joined: Jan. 2008
Offline
Maybe set the additional include directories in the c++ / general tab to something like “C:\Program Files\Side Effects Software\Houdini 12.0.543.9\toolkit\include” if you haven't yet.

You might also want to set the Target Machine (linker / advanced) to MachineX64. Also make sure what Configuration you are setting these properties in and with which ones you build your project.
User Avatar
Member
678 posts
Joined: July 2005
Offline
easythrees
Can you send me your VS 2008 project? I'll do a diff and compare what's missing. What workflow did you use?

Here it is: http://www.mediafire.com/?dcudei85x3xcujx [mediafire.com]

I got couple of my custom environment variables set.


VS2008_PATH - points to “C:\Program Files (x86)\Microsoft Visual Studio 9.0”

H12_VERSION - sets Houdini version build I want to compile for. For example “12.0.552”

H12_PATH - points to “C:\Program Files\Side Effects Software\Houdini %H12_VERSION%”


Note that H12_PATH contains H12_VERSION variable in its path.
Why this way ? Thanks to this if you install different H12 build and you want to compile for it, you don't have to change anything in your VS solution settings. You just change H12_VERSION variable build number and thats it. Remember that if you change environment variable value when Visual Studio is on, you have to restart VS so it could update project paths to math change in variable.
If you look closely in project settings you see that I use those variables in couple places instead of direct paths.
For example here:
-DVERSION=“$(H12_VERSION)”
-I “$(H12_PATH)/toolkit/include”
“$(H12_PATH)/custom/houdini/dsolib/*.a”
“$(H12_PATH)/custom/houdini/dsolib/*.lib”
I also use there rest of those custom variables.

Output “*.dll” file is created outside Solution folder. There is “houdini_bin” folder created and there you'll find your plugin. Again, this is made to simplify acces so you don't have to touch anything inside Solution folder.

To change name of plugin, rename it after creation or just change project name before compilation.

Basically, if you set those three variables in your system, this solution should work without modyfing anything.
Edited by - May 11, 2013 18:29:27
User Avatar
Member
7715 posts
Joined: July 2005
Offline
easythrees
Okay, the reason I ask is because I'm trying to make a VS 2008 project for the SOP_Star plug-in. Now, I thought I had the right settings, I copied them from the command line (hcustom -d foo.c), but when I load the compiled plug-in into Houdini, the application crashes.

Crashes where? Run houdini.exe from Visual Studio and look at the messages in the Output Window. It might be a CRT mismatch thing. Ensure you have all system updates,
User Avatar
Member
17 posts
Joined: May 2009
Offline
Hello,

I am having a similar problem, I analysed things a bit, I didn't find a solution but I came across a few things that might shed some light on the problem.

I am compiling a SOP, that is working fine for me in H11, and I recently did the migration to H12.

# when I compile a debug version :
-if I use the MDd option, in my cookMySop I will find a gdp that is not initialzed and this causes a core dump later on.
-if I use the MD option, the gdp will be alright, but for some reason, a vector that I am declaring simply as vector<int> myVar; will not be initialzed correctly (myVar will have a size of -1854757…). and if I am not mistaken, because of boost, I can't use any of the RTC options.

# when I compile a release version :
- if I use the MD option, I will not get a crash, but my SOP won't cook outputting an error, that I can not debug due to the above mentioned problems.

I tried a few things , to no avail.
Didn't try to compile my linux version yet though.

I hope this could help analyse this problem, and that someone could help finding the solution for it, and pinpoint what we are doing wrong or the bug in case there is one.


Cheers
Eye of an artist, Mind of an engineer
User Avatar
Member
128 posts
Joined: July 2005
Offline
It is permanent issue, when plug-ins compiled with debug info don't run properly, I saw it very often with 11.0/11.1 (I developed about 40 different extensions last year only - almost all of them were without debug info), with VS2005SP1, VS2008 or VS2010. Btw, with h11.0/h11.1 it was possible to build and get working almost any plug-in compiled with MSVS2010, but H12 has a lot of fun with this process and plug-in fails during execution, with or without debug info - deeply in houdini guts.

Thank you!
Anything that flies
User Avatar
Member
7715 posts
Joined: July 2005
Offline
You should:
- Use VS2008
- Make sure you're using the 64-bit compiler if using a 64-bit build of Houdini
- Compile with -MD
- Compile with -D_HAS_ITERATOR_DEBUGGING=0
- Make sure you're using the other right compiler options. See the Makefile.win
User Avatar
Member
17 posts
Joined: May 2009
Offline
I solved my problem, following a few suggestions from support, thought it might help someone.
it was just a matter of compiling with /MD and not /MDd, and without any of the /RTC options.
Now the debug and release versions are fine.
Eye of an artist, Mind of an engineer
  • Quick Links