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

2015-10-31 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

On 28/10/2015 15:07, Radu Popescu wrote:
> We are using OSG for a cross-platform application that runs on Windows, Linux 
> and Mac
> OS X (10.10 and 10.11).
> 
> The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches to 
> get this 
> setup working. We maintain a public Git clone, based on the GitHub mirror of
> OpenSceneGraph. ... Here is a patch that could help with the compilation:
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt index ce2815b..3e496c1 100644 ---
> a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,7 +180,13 @@ IF(APPLE) 
> STRING(REPLACE
> "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME}) LIST(GET MACOS_VERSION_LIST 0
> MACOS_VERSION_MAJOR) LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR) -
> LIST(GET
> MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) + +LIST(LENGTH 
> MACOS_VERSION_LIST
> MACOS_VERSION_LIST_LENGTH) +IF(MACOS_VERSION_LIST_LENGTH EQUAL "3") +
> LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) +ELSE() +
> SET(MACOS_VERSION_PATCH "0") +ENDIF()
> 
> SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

- From what I could grep, MACOS_VERSION_PATCH isn't used anywhere.
Should we maybe remove it instead of adding code for something that's not used?

Cheers,
/ulrich

- -- 
Public Key - 0227 8EE1 2C64 8EF4 DA11  9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJWNLJnAAoJEP8WARS52jMYU0UIANJrUOwKsl+anVIeHosqxPal
W9Oww/DVFnlwF8T0o8ZqWzhLqqHiwBgMuDSB16ZS20F+avj5UD+za4oxFNDoS9Du
HbUBa+qfiEu5So6B40mG7ofZlTuh4Sjz/PoNsONVNVxUXCnELvnIexmWmch63FxH
vzLcMvu+dgJTBEyx2BlsETcpNp0/PIHgUwcK7w3yhrOOdLgEswAI4W8KoEwowbPf
u9YMkw04FPCCvWCn2TwizwjTDMnoxDnQCcframN+EwnmiTP3ulgJa9Ahr5EdTlB2
MO2aTuw7943LXDi+qqQlT8PhgEBZ3e/fOT4gxbbQwUxPk9SMfIcmWPQcCUjuEhg=
=RdbZ
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-10-29 Thread Radu Popescu
Hi,

We are using OSG for a cross-platform application that runs on Windows, Linux 
and Mac OS X (10.10 and 10.11).

The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches to get 
this setup working. We maintain a public Git clone, based on the GitHub mirror 
of OpenSceneGraph.

I don't have enough posts on this forum to include a link to the repo. I can 
share it by private messages or some other way, if anybody is interested.

We are using this Git clone internally and we haven't had the time to clean it 
up and submit these changes back upstream (we're not even sure all the changes 
we've made are general enough to be integrated upstream).

Here is a patch that could help with the compilation:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce2815b..3e496c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -180,7 +180,13 @@ IF(APPLE)
 STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
 LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
 LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
-LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
+
+LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
+IF(MACOS_VERSION_LIST_LENGTH EQUAL "3")
+LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
+ELSE()
+SET(MACOS_VERSION_PATCH "0")
+ENDIF()
 
 SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")



Additionally, here are the CMake configuration flags we are using to compile 
OSG:

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOPENGL_PROFILE="GLCORE" \
-DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
-DCMAKE_MODULE_LINKER_FLAGS="-stdlib=libc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DOSG_WINDOWING_SYSTEM="Cocoa" \
-DDESIRED_QT_VERSION=4 \
-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake \
-DDYNAMIC_OPENSCENEGRAPH=OFF \
-DDYNAMIC_OPENTHREADS=OFF


I hope this helps!

Best regards,
Radu

--
Radu Popescu
Software Engineer
Pix4D SA

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65477#65477





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2015-10-29 Thread Robert Osfield
Hi Radu,

What errors do you see with your build when you don't include the
IF(MACOS_VERSION_LIST_LENGTH EQUAL "3") block to avoid querying the
MACOS_VERSION_PATCH?

With this block I'd be inclined to use GREATER 2, rather than EQUAL 3 just
in case the MACOS implementation adds a forth element to the list.

Robert.

On 28 October 2015 at 14:07, Radu Popescu  wrote:

> Hi,
>
> We are using OSG for a cross-platform application that runs on Windows,
> Linux and Mac OS X (10.10 and 10.11).
>
> The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches
> to get this setup working. We maintain a public Git clone, based on the
> GitHub mirror of OpenSceneGraph.
>
> I don't have enough posts on this forum to include a link to the repo. I
> can share it by private messages or some other way, if anybody is
> interested.
>
> We are using this Git clone internally and we haven't had the time to
> clean it up and submit these changes back upstream (we're not even sure all
> the changes we've made are general enough to be integrated upstream).
>
> Here is a patch that could help with the compilation:
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index ce2815b..3e496c1 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -180,7 +180,13 @@ IF(APPLE)
>  STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
>  LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
>  LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
> -LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
> +
> +LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
> +IF(MACOS_VERSION_LIST_LENGTH EQUAL "3")
> +LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
> +ELSE()
> +SET(MACOS_VERSION_PATCH "0")
> +ENDIF()
>
>  SET(OSG_OSX_SDK_NAME
> "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
>
>
>
> Additionally, here are the CMake configuration flags we are using to
> compile OSG:
>
> cmake \
> -DCMAKE_BUILD_TYPE=Release \
> -DOPENGL_PROFILE="GLCORE" \
> -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
> -DCMAKE_MODULE_LINKER_FLAGS="-stdlib=libc++" \
> -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" \
> -DCMAKE_OSX_ARCHITECTURES="x86_64" \
> -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
> -DOSG_WINDOWING_SYSTEM="Cocoa" \
> -DDESIRED_QT_VERSION=4 \
> -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake \
> -DDYNAMIC_OPENSCENEGRAPH=OFF \
> -DDYNAMIC_OPENTHREADS=OFF
>
>
> I hope this helps!
>
> Best regards,
> Radu
>
> --
> Radu Popescu
> Software Engineer
> Pix4D SA
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65477#65477
>
>
>
>
>
> ___
> 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


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

2015-10-29 Thread Robert Osfield
Hi Guys,

I don't have an OSX system to test against, but I've gone ahead and had a
bash at implementing what I think might be appropriate.  I need it tested
by OSX users though before I check it into svn/trunk and OSG-3.4 branch.
I've used Radu's suggest change to CMake to avoid checking the 3 entry in
the MACOS_VERSION_LIST if it doesn't exist, and changed the OSX version
check to use > 10.7 rather than one of 10.8, 10.9 and 10.10.  This should
provide support for future rev's of OSX till it hit's 11.x.

Could you guys these it out and let me know?

Cheers,
Robert

~/OpenSceneGraph$ svn diff CMakeLists.txt
Index: CMakeLists.txt
===
--- CMakeLists.txt  (revision 15172)
+++ CMakeLists.txt  (working copy)
@@ -180,8 +180,14 @@
 STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
 LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
 LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
-LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

+LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
+IF(MACOS_VERSION_LIST_LENGTH GREATER "2")
+LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
+ELSE()
+SET(MACOS_VERSION_PATCH "0")
+ENDIF()
+
 SET(OSG_OSX_SDK_NAME
"macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

 # Trying to get CMake to generate an XCode IPhone project, current
efforts are to get iphoneos sdk 3.1 working
@@ -1109,7 +1115,7 @@
 # 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")
+IF(${MACOS_VERSION_MAJOR} EQUAL "10" AND
${MACOS_VERSION_MINOR} "7")
 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)


On 29 October 2015 at 09:38, Robert Osfield 
wrote:

> Hi Radu,
>
> What errors do you see with your build when you don't include the
> IF(MACOS_VERSION_LIST_LENGTH EQUAL "3") block to avoid querying the
> MACOS_VERSION_PATCH?
>
> With this block I'd be inclined to use GREATER 2, rather than EQUAL 3 just
> in case the MACOS implementation adds a forth element to the list.
>
> Robert.
>
> On 28 October 2015 at 14:07, Radu Popescu  wrote:
>
>> Hi,
>>
>> We are using OSG for a cross-platform application that runs on Windows,
>> Linux and Mac OS X (10.10 and 10.11).
>>
>> The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches
>> to get this setup working. We maintain a public Git clone, based on the
>> GitHub mirror of OpenSceneGraph.
>>
>> I don't have enough posts on this forum to include a link to the repo. I
>> can share it by private messages or some other way, if anybody is
>> interested.
>>
>> We are using this Git clone internally and we haven't had the time to
>> clean it up and submit these changes back upstream (we're not even sure all
>> the changes we've made are general enough to be integrated upstream).
>>
>> Here is a patch that could help with the compilation:
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index ce2815b..3e496c1 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -180,7 +180,13 @@ IF(APPLE)
>>  STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
>>  LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
>>  LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
>> -LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
>> +
>> +LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
>> +IF(MACOS_VERSION_LIST_LENGTH EQUAL "3")
>> +LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
>> +ELSE()
>> +SET(MACOS_VERSION_PATCH "0")
>> +ENDIF()
>>
>>  SET(OSG_OSX_SDK_NAME
>> "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
>>
>>
>>
>> Additionally, here are the CMake configuration flags we are using to
>> compile OSG:
>>
>> cmake \
>> -DCMAKE_BUILD_TYPE=Release \
>> -DOPENGL_PROFILE="GLCORE" \
>> -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_MODULE_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_OSX_ARCHITECTURES="x86_64" \
>> -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
>> -DOSG_WINDOWING_SYSTEM="Cocoa" \
>> -DDESIRED_QT_VERSION=4 \
>> -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake \
>> -DDYNAMIC_OPENSCENEGRAPH=OFF \
>> -DDYNAMIC_OPENTHREADS=OFF
>>
>>
>> I hope this helps!
>>
>> Best regards,
>> Radu
>>
>> --
>> Radu Popescu
>> Software Engineer
>> Pix4D SA
>>
>> 

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

2015-10-28 Thread Robert Osfield
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  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
>