following the guide on command line scripting [www.sidefx.com] has worked very well for me in the past. However, with the recent Houdini 17 update, changing the HFS variable from 16.5 to 17.0 as indicated below, results in the following error:
WARNING: JE Malloc not configured. Excessive memory fragmentation and poor performance may result. If this is intentional, set HOUDINI_DISABLE_JEMALLOCTEST=1 to remove this warning. double free or corruption (out) Aborted
I am running Debian Buster and I have libjemalloc installed. Any suggestions what might cause the error or how I can load Houdini-17 files in an external python script?
Thanks in advance,
#!/usr/bin/pythondefenableHouModule():'''Set up the environment so that "import hou" works.'''importsys,os#import platform# Importing hou will load in Houdini's libraries and initialize Houdini.# In turn, Houdini will load any HDK extensions written in C++. These# extensions need to link against Houdini's libraries, so we need to# make sure that the symbols from Houdini's libraries are visible to# other libraries that Houdini loads. So, we adjust Python's dlopen# flags before importing hou.ifhasattr(sys,"setdlopenflags"):old_dlopen_flags=sys.getdlopenflags()importDLFCNsys.setdlopenflags(old_dlopen_flags|DLFCN.RTLD_GLOBAL)try:importhouexceptImportError:# Add $HFS/houdini/python2.7libs to sys.path so Python can find the# hou module.# works for 16.5, fails for 17.0 or 17.0.352 HFS="/opt/hfs17.0"sys.path.append(HFS+"/houdini/python%d.%dlibs"%sys.version_info[:2])importhoufinally:ifhasattr(sys,"setdlopenflags"):sys.setdlopenflags(old_dlopen_flags)enableHouModule()
Starting from version 17 Houdini doesn't use systems Python anymore. I'd imagine that trying to use Houdini's libraries from the external interpreter could lead to all sorts of issues. Unless you absolutely must using system's Python for some reason, stick to Hython instead.
Aleksei Rusev Sr. Graphics Tools Engineer @ Nvidia
Then if you run external python as suggested importing Hou module won't error about jemalloc. As of writing this latest jemalloc is 5.2.1 so worth getting latest and changing bash commands appropriately: