[osg-users] [build] Xocde 7.1 with osgDB compiler error

Robert Osfield robert.osfield at gmail.com
Wed Oct 28 05:17:15 PDT 2015


Hi Daniel,

I don't have an OSX system to test against so have to defer to OSX users
for maintaining the build, I can only provide general guidance.

>From the look of the error line:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/cdefs.h:707:2:
error: Unsupported architecture
#error Unsupported architecture

It looks to me like part of the 10.11 SDK doesn't support build under all
architectures.  You'll need to go into Cmake and select change the
architecture this is built against. Have a look at the
CMAKE_OSX_ARCHITECTURES value.

Just look at the OpenSceneGraph/CMakeLists.txt lines where it sets
CMAKE_OSX_ARCHITECTURES It has the following:

        # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on
10.4
        # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't
support.

        # These are just defaults/recommendations, but how we want to build
        # out of the box. But the user needs to be able to change these
options.
        # So we must only set the values the first time CMake is run, or we
        # will overwrite any changes the user sets.
        # FORCE is used because the options are not reflected in the UI
otherwise.
        # Seems like a good place to add version specific compiler flags
too.
        IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
            IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR
${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL
"macosx10.10")
                SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING
"Forced imageio default image plugin for OSX" FORCE)
                # 64 Bit Works, i386,ppc is not supported any more
                SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build
architectures for OSX" FORCE)
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-mmacosx-version-min=10.8 -fvisibility-inlines-hidden" CACHE STRING "Flags
used by the compiler during all build types." FORCE)
            ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7")
                SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING
"Forced imageio default image plugin for OSX" FORCE)
                # 64 Bit Works, PPC is not supported any more
                SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING
"Build architectures for OSX" FORCE)
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-mmacosx-version-min=10.7 -fvisibility-inlines-hidden" CACHE STRING "Flags
used by the compiler during all build types." FORCE)
            ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR
${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
                SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING
"Forced imageio default image plugin for OSX" FORCE)
                # 64-bit compiles are not supported with Carbon.
                SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build
architectures for OSX" FORCE)
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
            ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.4")
                SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE
STRING "Forced imageio default image plugin for OSX" FORCE)
                SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build
architectures for OSX" FORCE)
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
            ELSE()
                # No Universal Binary support
                # Should break down further to set the -mmacosx-version-min,
                # but the SDK detection is too unreliable here.
            ENDIF()
        ENDIF()

Note, the line :

   IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME}
STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")

Doesn't include the 10.11, so try adding this into the list.

Robert.



Robert.


On 28 October 2015 at 08:42, Daniel Lee <daniel.lee at datangle.com> wrote:

> Hi,
>
> During the compilation of "ALL_BUILD" process, Xcode 7.1 generated a error
> as below:
>
>
> Code:
>
> In file included from
> /Users/daniellee/Documents/ARToolkit/OpenSceneGraph/OpenSceneGraph-3.4.0/src/osgDB/AuthenticationMap.cpp:14:
> In file included from
> /Users/daniellee/Documents/ARToolkit/OpenSceneGraph/OpenSceneGraph-3.4.0/include/osgDB/AuthenticationMap:17:
> In file included from
> /Users/daniellee/Documents/ARToolkit/OpenSceneGraph/OpenSceneGraph-3.4.0/include/osg/Referenced:21:
> In file included from
> /Users/daniellee/Documents/ARToolkit/OpenSceneGraph/OpenSceneGraph-3.4.0/include/OpenThreads/Atomic:21:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libkern/OSAtomic.h:27:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stddef.h:64:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_types.h:32:
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/cdefs.h:707:2:
> error: Unsupported architecture
> #error Unsupported architecture
>
>
>
>
> I have no issue to build libosg.a or libosgUtil.a. However, when to
> compile the osgDB project, the error as showed.
>
> Need your help to resolve above macro issue. Is it an bug with Xcode 7.1
> only?
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65472#65472
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151028/29546126/attachment-0003.htm>


More information about the osg-users mailing list