AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Mozilla Public License 2.0
2.62k stars 647 forks source link

[BUILD] OpenVDB fails to build #1809

Closed BenceGattyan closed 4 months ago

BenceGattyan commented 4 months ago

Environment

Operating System: Windows 11 Version / Commit SHA: 11.0.0 CMake Version: 3.29.3 Compiler: MinGW GCC 6.3.0

Describe the problem

Example code won't compile.

To Reproduce

I followed the instructions in the readme file. Was installing it on a onedrive folder but it is stored locally so I don't think that'd cause issues

Additional context

Start of the code: `#include

include <C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\openvdb.h>

//using namespace std;

int main() {`

The error I get

`PS C:\Users\User\OneDrive\School\BachelorProject\cpp> g++ main.cpp -o main In file included from C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\openvdb.h:8:0, from main.cpp:2: C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\Types.h:7:21: fatal error: version.h: No such file or directory

include "version.h"

                 ^

compilation terminated.`

What I tried so far:

I noticed that version.h was actually version.h.in so I tried changing it to versio.h Then it gave same missing error but with "openvdb/math/Half.h" mentioned in Types.h and so on.

The building process was also full of some errors but it did finish so I'm not sure if they matter: buld process.txt

I tried building it multiple times, initially I was trying to do it with the most recent version. Each time I got the same issue however one time an OpenVDB folder appeared in ProgramFiles that also had the openvdb.h file, but the compilation also failed with that one.

Idclip commented 4 months ago

You're including the headers directly from the source repository which is typically not the correct way to use header when compiling a project from source. You need to include the headers from the install location of your build process. It looks like your build process failed entirely and did not install

C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\tree\InternalNode.h(2014,1): error C1060: compiler is out of heap space [C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\build\openvdb\openvdb\openv db_shared.vcxproj]

I suggest you try disabling -DUSE_EXPLICIT_INSTANTIATION=OFF to reduce memory consumption during compilation.

C:\Users\User\OneDrive\School\BachelorProject\cpp> g++ main.cpp -o main In file included from C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\openvdb.h:8:0, from main.cpp:2: C:\Users\User\OneDrive\School\BachelorProject\openvdb-11.0.0\openvdb\openvdb\Types.h:7:21: fatal error: version.h: No such file or directory #include "version.h" ^ compilation terminated.

The way you're trying to build your project against VDB will also not work as you will need to pass compile defines/options/interface link libraries that VDB needs. I suggest you use a package manager (such as vcpkg on Windows) to help you with this process if you are not familiar with building OSS.