Re: [osg-users] Compilation error with MSVC 2015
Hello again, On Mon, Jul 4, 2016 at 4:29 PM, Robert Osfieldwrote: > Weird. I have just had a look t the source file the compiler is > complaining about and it looks pretty standard. > > The gles plugin on Linux is not particularly large either. I can't see > any obvious reasons why there would be any need for some special > options. > > This is what the doc says about /bigobj: https://msdn.microsoft.com/en-us/library/ms173499.aspx My suspicion is that as that optimizer code works over all possible OSG nodes, it is possible it is trying to instantiate ton of templates (e.g. osg::ref_ptr<>), pushing the number of sections over 64k in my particular case, with my set of self-compiled dependencies. It seems that adding /bigobj should be safe, only compilers older than MSVC 2005 wouldn't be able to deal with such object files - which is a non-issue, because one cannot really mix C++ object files/libs between MSVC versions safely anyway. J. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compilation error with MSVC 2015
Hello, On Mon, Jul 4, 2016 at 4:29 PM, Robert Osfieldwrote: > Hi Jan, > > On 4 July 2016 at 14:12, Jan Ciger wrote: > > It was a fresh checkout from Github master from a few minutes ago. I have > > modified the main CMakeLists.txt and added /bigobj, as mentioned in the > > error message, to CMAKE_CXX_FLAGS for MSVC and now the same code seems to > > build fine,so that doesn't look like a corrupted file. I was building a > > debug build when I have got that error, not sure whether it has any > > relevance. > > Weird. I have just had a look t the source file the compiler is > complaining about and it looks pretty standard. > > The gles plugin on Linux is not particularly large either. I can't see > any obvious reasons why there would be any need for some special > options. > > What size are the object files and resulting osgdb_gles.dll? > The OpenGLESGeometryOptimizer.obj is 4.84MB in Release and 28.81MB in Debug, the remaining files are few hundred kB (Release), few megs (in Debug). The DLL is 770kB in release and 3.84MB in debug. I have noticed that the incremental linking was off in the CMakeLists.txt for MSVC, that could perhaps have an impact. Can the option just been added to the gles pugin if absolutely required? > Yes, possibly. However, it may be that the build would break elsewhere too - I didn't have time to rebuild the whole mess several times today, so I have put it only globally. I don't think that the GLES code is somehow special. > > Right now, it seems pretty odd that the gles plugin would break some > compiler limits that we've never hit before in any other module or > plugins, so I'm inclined to think there is something specific going > on, perhaps a bug with the compiler that is throwing things off. > Yes, I wouldn't be surprised. Or it could be triggering generation of ton of code in 2015 that exceeds the limits. MSVC 2015 broke a lot of code that was compiling before, because it is both stricter and updated for newer C++ standard. So when rebuilding older C++ code I am now often troubleshooting compilation failures about code referencing deleted functions, template problems, you name it. J. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compilation error with MSVC 2015
Hi Jan, On 4 July 2016 at 14:12, Jan Cigerwrote: > It was a fresh checkout from Github master from a few minutes ago. I have > modified the main CMakeLists.txt and added /bigobj, as mentioned in the > error message, to CMAKE_CXX_FLAGS for MSVC and now the same code seems to > build fine,so that doesn't look like a corrupted file. I was building a > debug build when I have got that error, not sure whether it has any > relevance. Weird. I have just had a look t the source file the compiler is complaining about and it looks pretty standard. The gles plugin on Linux is not particularly large either. I can't see any obvious reasons why there would be any need for some special options. What size are the object files and resulting osgdb_gles.dll? > I have yet to see whether the extra flag will have any runtime consequences. Can the option just been added to the gles pugin if absolutely required? Right now, it seems pretty odd that the gles plugin would break some compiler limits that we've never hit before in any other module or plugins, so I'm inclined to think there is something specific going on, perhaps a bug with the compiler that is throwing things off. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compilation error with MSVC 2015
Hello, On Mon, Jul 4, 2016 at 2:29 PM, Robert Osfieldwrote: > Hi Jan, > > The gles plugin is a tool to aid conversion of fixed function pipeline > scene graphs across to shader based ones compatible with GLES2, it's > not specifically tied to GLES though and should happily compile and > work with a normal OpenGL build. > OK. > > The error you report looks like a compiler bug/error rather than a > code error. The only other thing I can think of that for some reason > your OpenGLESGeometryOptimizer.cpp file has got corrupted. > > You don't specify which version of the OSG you are using so can't > check to see if the file is actually OK. > It was a fresh checkout from Github master from a few minutes ago. I have modified the main CMakeLists.txt and added /bigobj, as mentioned in the error message, to CMAKE_CXX_FLAGS for MSVC and now the same code seems to build fine,so that doesn't look like a corrupted file. I was building a debug build when I have got that error, not sure whether it has any relevance. I have yet to see whether the extra flag will have any runtime consequences. Regards, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compilation error with MSVC 2015
Hi Jan, The gles plugin is a tool to aid conversion of fixed function pipeline scene graphs across to shader based ones compatible with GLES2, it's not specifically tied to GLES though and should happily compile and work with a normal OpenGL build. The error you report looks like a compiler bug/error rather than a code error. The only other thing I can think of that for some reason your OpenGLESGeometryOptimizer.cpp file has got corrupted. You don't specify which version of the OSG you are using so can't check to see if the file is actually OK. Cheers, Robert. On 4 July 2016 at 13:23, Jan Cigerwrote: > Hello, > > I am updating my OSG at work and when building with the MSVC 2015, I am > getting this: > > 72>C:\R\Dependencies-x64-2015\OpenSceneGraph\src\osgPlugins\gles\OpenGLESGeometryOptimizer.cpp > : fatal error C1128: number of sections exceeded object file format limit: > compile with /bigobj > > And the build fails. > > What is strange is that why is it even trying to build that file - I have > all GLES options off. Has anyone seen this error before? > > J. > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org