Debug build not working

I am trying to get my debug version of my C++ to work with OpenUSD. I have made a release build of OpenUSD and that works in release mode in my project but in debug it does not work. I looked around and came to the conclusion that I should make a debug build of OpenUSD. When I tried to make the debug build, I got the error below.

Any idea what I might be doing wrong? Do I need to make a debug build at all?

To debug , you definitely need debug symbols which means either building in debug or release with debug.

Could you share more about how you’re building, the command you run, the Python version etc that you’re using?

1 Like


I am building the project using visual studio 2019. As for building the debug version of Open USD I am using the build_usd.py script and I ran the following in command prompt. (I left in the visual studio errors in case anyone wanted to see some of those.) I am using Python 3.12.1.


Better screenshot of the command I used

It’s quite difficult to parse screenshots. Would you be able to post the text or actual log files going forward?

In this case, both your original and new screenshot show different issues so it’s hard to find a theme based on what’s presented. I would recommend deleting your build folder, and doing a fresh build to make sure there are no conflicts, and then posting the build logs once done.

It would also help to know what version of OpenUSD you are building just to make sure it’s recent.

OpenUSD 25.5 just released a release candidate as well, and might help resolve some build issues potentially.

1 Like

log.txt (636 Bytes)
Here is the log file for the build errors. I wont try to send anything related to my project build since it is now clear that it is distracting and will likely be fixed by having the debug versions of OpenUSD files. I am going to make a fresh build now and post the results.

log.txt (368 Bytes)
Attempted a fresh build but it couldnt download the boost files. I got around this when I build the first time by downloading the files manually. I didn’t do that this time. The version I am working with is 24.8

Doing more reserach, I found out I had the issue described here: Failed to extract archive boost_1_78_0.zip ¡ Issue #2900 ¡ PixarAnimationStudios/OpenUSD ¡ GitHub. I did the recommended fix (switching the URL to download boost with something that is up right now) and that fixed part of it. I now have a new issue, which is one of the numpy files wont compile. Here is the exact error:

compile-c-c++ C:\Users\donov\Desktop\OpenUSD-Folder\OpenUSD-release\OpenUSD-debug\build\boost\bin.v2\libs\python\build\msvc-14.2\debug\python-3.12\threading-multi\numpy\dtype.obj
dtype.cpp
libs\python\src\numpy\dtype.cpp(101): error C2039: ‘elsize’: is not a member of ‘_PyArray_Descr’
C:\Users\donov\AppData\Local\Programs\Python\Python312\Lib\site-packages\numpy_core\include\numpy\ndarraytypes.h(622): note: see declaration of ‘_PyArray_Descr’

call "C:\Users\donov\Desktop\OpenUSD-Folder\OpenUSD-release\OpenUSD-debug\build\boost\bin.v2\standalone\msvc\msvc-14.2\msvc-setup.bat"  >nul

cl /Zm800 -nologo “libs\python\src\numpy\dtype.cpp” -c -Fo"C:\Users\donov\Desktop\OpenUSD-Folder\OpenUSD-release\OpenUSD-debug\build\boost\bin.v2\libs\python\build\msvc-14.2\debug\python-3.12\threading-multi\numpy\dtype.obj" -TP /wd4675 /EHs /GR /Zc:throwingNew /Z7 /Od /Ob0 /W3 /MDd /Zc:forScope /Zc:wchar_t /Zc:inline /favor:blend -DBOOST_ALL_NO_LIB=1 -DBOOST_NUMPY_SOURCE “-I.” “-IC:\Users\donov\AppData\Local\Programs\Python\Python312\Include” “-IC:\Users\donov\AppData\Local\Programs\Python\Python312\Lib\site-packages\numpy_core\include”

…failed compile-c-c++ C:\Users\donov\Desktop\OpenUSD-Folder\OpenUSD-release\OpenUSD-debug\build\boost\bin.v2\libs\python\build\msvc-14.2\debug\python-3.12\threading-multi\numpy\dtype.obj…

I have also attached the build log below. I will keep trying to fix this in the meantime and update any results here.
log.txt (4.4 MB)

looks like the file
pxr\external\boost\python\numpy\dtype.hpp is malformed
you should try delete boost folder inside usd_build/src and try again

1 Like

I tried doing the above and deleting the boost folder from the debug build folder and that didn’t work. I deleted the include folder and than the boost folder again and that didn’t work ether. Looking to the error more, it looks like is a version conflict here where the version USD is expecting is not the same as the version being built. That is weird though because it should be getting the right version. Going to figure out if I am downloading the right version of boost. (I have the log of the latest attempt but it is the same as the one before essentially)
log.txt (351 Bytes)

Edit: Here are the links which lead me to the conclusion above:

Since there is a change in how PyArray_Descr is organized between versions, it would make sense then that if the versions are being mixed, that is where the error would come from.

I downgraded my numpy version from 2.2.2 to 1.26.4 and that has seemed to have fixed the build errors with boost. I was able to generate a successful debug build after that. Now I can take these files and use them to get my debug build working for my project. Going to mark this as solved since I now know that I need a debug version of OpenUSD for debug builds and I have been able to fix the issues I was having with generating my debug build. Thank you to everyone who helped me.