[vtkusers] Migration to VTK6
Arno Klein
binarybottle at gmail.com
Wed Jan 6 18:45:28 EST 2016
Thank you all so much for your kind help. Unfortunately, I am still unable
to compile the C++ code in my project on MacOSX, even after setting the
following in my top-level CMakeLists.txt file:
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.7")
When I type:
$ export VERBOSE=1
$ make
I get the following even though I don't have
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/
but instead have
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
on my computer:
------------------
...
*Scanning dependencies of target TravelDepthMain*
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
travel_depth/CMakeFiles/TravelDepthMain.dir/build.make
travel_depth/CMakeFiles/TravelDepthMain.dir/build
[ 57%] Building CXX object
travel_depth/CMakeFiles/TravelDepthMain.dir/TravelDepthMain.cpp.o
cd /software/install/mindboggle/surface_cpp_tools/bin/travel_depth &&
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)"
-DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)"
-DvtkRenderingFreeType_AUTOINIT="1(vtkRenderingMatplotlib)"
-DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)"
-I/software/install/miniconda2/include/vtk-6.3
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-isystem /software/install/miniconda2/include -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
-o CMakeFiles/TravelDepthMain.dir/TravelDepthMain.cpp.o -c
/software/install/mindboggle/surface_cpp_tools/travel_depth/TravelDepthMain.cpp
make[2]: *** No rule to make target
`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AGL.framework',
needed by `travel_depth/TravelDepthMain'. Stop.
make[1]: *** [travel_depth/CMakeFiles/TravelDepthMain.dir/all] Error 2
make: *** [all] Error 2
-------------------
Cheers,
@rno
On Fri, Dec 11, 2015 at 9:36 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Arno,
>
> I think that I've found out where the AGL link is coming from. It isn't
> via Carbon, it looks like it was linked directly into the VTK that you're
> using. And it looks like a bug within CMake itself.
>
> CMake has a module called FindOpenGL.cmake that VTK uses to find OpenGL.
> It looks for both the OpenGL.framework and for the obsolete AGL.framework
> (which is only for Carbon, and is deprecated by Apple). If it finds both
> (e.g. with an older SDK and XCode 6 or earlier), then it uses both, even
> though AGL.framework is really not needed for any modern software.
>
> This means that a VTK that is built with (for example) Xcode 6 and its
> SDKs becomes linked to AGL, because AGL.framework is present in those older
> SDKs. It's a private link, though, so I'm surprised that it would cause
> the error. But you are building with Xcode 7 and you are seeing an
> error... that much is indisputable.
>
> I suggest that you enable verbose error reporting so that you can see
> exactly what is being linked when the error occurs:
>
> export VERBOSE=1
> make
> ...
>
> Use "unset VERBOSE" to turn off the verbosity.
>
> - David
>
>
> On Fri, Dec 11, 2015 at 3:57 PM, Arno Klein <binarybottle at gmail.com>
> wrote:
>
>> I tried again, and am still getting the AGL.framework error even when I
>> set to 10.9 and the SDK to 10.11 (see:
>> https://github.com/nipy/mindboggle/blob/master/surface_cpp_tools/CMakeLists.txt
>> ):
>>
>> > [ 57%] Building CXX object
>> travel_depth/CMakeFiles/TravelDepthMain.dir/TravelDepthMain.cpp.o
>> > make[2]: *** No rule to make target
>> `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AGL.framework',
>> needed by `travel_depth/TravelDepthMain'. Stop.
>> > make[1]: *** [travel_depth/CMakeFiles/TravelDepthMain.dir/all] Error 2
>> > make: *** [all] Error 2
>>
>> Could you please tell me how to ensure that there are no calls to Carbon
>> APIs?
>>
>> By the way, I am tracking this as an issue on Github:
>> https://github.com/nipy/mindboggle/issues/69
>>
>> Cheers,
>> @rno
>>
>>
>> On Fri, Dec 11, 2015 at 5:27 AM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>>
>>> Hi Arno,
>>>
>>> Using the macosx10.11 SDK is fine as long as it allows you to set this
>>> desired deployment target. So if you are able to compile with the
>>> following settings, then the result should run on OS X 10.7:
>>>
>>> CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7
>>> CMAKE_OSX_SYSROOT:STRING=macosx10.11
>>>
>>> I'm not sure how far back you can set the deployment target with this
>>> SDK, but if the 10.7 target doesn't compile, you can try 10.8 or 10.9.
>>>
>>> If if gives errors for the AGL.framework, then make sure that your code
>>> has no calls to Carbon APIs.
>>>
>>> - David
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160106/ff5fcbc2/attachment.html>
More information about the vtkusers
mailing list