Tron Thomas | 1 May 2010 21:33
Picon

Configure Mac OS X for 32-bit

I am writing a cross platform application using CMake that builds on Mac 
OS X.  I just upgraded to CMake 2.8-1.  When I configure and build my 
project on my Power Mac G5 system running Mac OS X 10.5.8, the project 
builds just fine.

When I try to configure the project on my MacBook Pro running Mac OS X 
10.6.3, I get link errors because the project has been configured to 
build 64-bit applications and some of the needed libraries and 
frameworks the project links with are only 32-bit.

How can I configure my CMake scripts so that the project will build a 
32-bit application on my MacBook Pro?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Mike Jackson | 2 May 2010 01:55
Favicon

Re: Configure Mac OS X for 32-bit

You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
on snow leopard is 64bit where as on leopard it is 32 bit.

-----
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson@...
BlueQuartz Software               Dayton, Ohio

On May 1, 2010, at 15:33, Tron Thomas <tron.thomas@...> wrote:

> I am writing a cross platform application using CMake that builds on
> Mac OS X.  I just upgraded to CMake 2.8-1.  When I configure and
> build my project on my Power Mac G5 system running Mac OS X 10.5.8,
> the project builds just fine.
>
> When I try to configure the project on my MacBook Pro running Mac OS
> X 10.6.3, I get link errors because the project has been configured
> to build 64-bit applications and some of the needed libraries and
> frameworks the project links with are only 32-bit.
>
> How can I configure my CMake scripts so that the project will build
> a 32-bit application on my MacBook Pro?
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
(Continue reading)

Zhuang Song | 2 May 2010 03:40
Picon

installation problem

Hi!
I am trying to install CMake in our Linux server. I follow the three
steps: $ ./bootstrap; make; make install

in running bootstrap, I got the following messages:

***********************************
cmSystemTools.o: In function
`cmSystemTools::RemoveRPath(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>*, bool*)':
cmSystemTools.cxx:(.text+0x3d0): undefined reference to
`cmELF::cmELF(char const*)'
cmSystemTools.cxx:(.text+0x3f9): undefined reference to `cmELF::GetRPath()'
cmSystemTools.cxx:(.text+0x426): undefined reference to `cmELF::GetRunPath()'
cmSystemTools.cxx:(.text+0x4a7): undefined reference to
`cmELF::GetDynamicEntryCount() const'
cmSystemTools.cxx:(.text+0x5a2): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x5dc): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x612): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x6d2): undefined reference to
`cmELF::ReadBytes(unsigned long, unsigned long, char*) const'
cmSystemTools.cxx:(.text+0x766): undefined reference to `cmELF::~cmELF()'
cmSystemTools.cxx:(.text+0x77e): undefined reference to `cmELF::~cmELF()'
cmSystemTools.o: In function
`cmSystemTools::CheckRPath(std::basic_string<char,
(Continue reading)

Tron Thomas | 2 May 2010 03:26
Picon

Re: Configure Mac OS X for 32-bit

I don't want to set the value to architecture set to i386 when I'm 
building on a PowerPC system.  I also only want a single architecture 
for a debug build and universal binary for release builds.

So, I tried doing this in a section of the CMake script that already 
determined it was building on Mac OS X:

if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
     set(OSX_ARCHITECTURES_DEBUG "i386")
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")

However when I go to build a debug target in the project the build 
output indicates that the "-arch x86_64" flag is in use, causing the 
built executable to be 64-bit.

The command:
cmake --help-property OSX_ARCHITECTURES

mentioned something about the CMAKE_OSX_ARCHITECTURES variable, however 
the command:
cmake --help-variable CMAKE_OSX_ARCHITECTURES

complained that CMAKE_OSX_ARCHITECTURES was not a defined variable.

What needs to be applied to get CMake to configure a Snow Leopard system 
as 32-bit?

On 05/01/2010 04:55 PM, Mike Jackson wrote:
> You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
> on snow leopard is 64bit where as on leopard it is 32 bit.
(Continue reading)

Tron Thomas | 2 May 2010 06:11
Picon

Re: Configure Mac OS X for 32-bit

Okay, I think I figured it out.  I used this:

set(CMAKE_OSX_ARCHITECTURES "i386 ppc")

At least on my MacBook Pro that sets the architecture to i386 for debug 
builds.  I'll have to try it on the PowerMac to make sure its 
architecture gets set to ppc for debug builds.

On 05/01/2010 04:55 PM, Mike Jackson wrote:
> You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
> on snow leopard is 64bit where as on leopard it is 32 bit.
>
> -----
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson@...
> BlueQuartz Software               Dayton, Ohio
>
>
> On May 1, 2010, at 15:33, Tron Thomas<tron.thomas@...>  wrote:
>
>    
>> I am writing a cross platform application using CMake that builds on
>> Mac OS X.  I just upgraded to CMake 2.8-1.  When I configure and
>> build my project on my Power Mac G5 system running Mac OS X 10.5.8,
>> the project builds just fine.
>>
>> When I try to configure the project on my MacBook Pro running Mac OS
>> X 10.6.3, I get link errors because the project has been configured
>> to build 64-bit applications and some of the needed libraries and
>> frameworks the project links with are only 32-bit.
(Continue reading)

Tron Thomas | 2 May 2010 08:15
Picon

Re: Configure Mac OS X for 32-bit

It looks like:
set (CMAKE_OSX_ARCHITECTURES "i386 ppc")

will build a universal binary for a debug build on any platform.  How 
can someone configure things so that Xcode will build a platform 
specific debug version that is 32-bit?

On 05/01/2010 04:55 PM, Mike Jackson wrote:
> You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
> on snow leopard is 64bit where as on leopard it is 32 bit.
>
> -----
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson@...
> BlueQuartz Software               Dayton, Ohio
>
>
> On May 1, 2010, at 15:33, Tron Thomas<tron.thomas@...>  wrote:
>
>    
>> I am writing a cross platform application using CMake that builds on
>> Mac OS X.  I just upgraded to CMake 2.8-1.  When I configure and
>> build my project on my Power Mac G5 system running Mac OS X 10.5.8,
>> the project builds just fine.
>>
>> When I try to configure the project on my MacBook Pro running Mac OS
>> X 10.6.3, I get link errors because the project has been configured
>> to build 64-bit applications and some of the needed libraries and
>> frameworks the project links with are only 32-bit.
>>
(Continue reading)

Michael Wild | 2 May 2010 10:55
Picon
Gravatar

Re: installation problem



On Sun, May 2, 2010 at 3:40 AM, Zhuang Song <zhuang.song-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi!
I am trying to install CMake in our Linux server. I follow the three
steps: $ ./bootstrap; make; make install

in running bootstrap, I got the following messages:

***********************************
cmSystemTools.o: In function
`cmSystemTools::RemoveRPath(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>*, bool*)':
cmSystemTools.cxx:(.text+0x3d0): undefined reference to
`cmELF::cmELF(char const*)'
cmSystemTools.cxx:(.text+0x3f9): undefined reference to `cmELF::GetRPath()'
cmSystemTools.cxx:(.text+0x426): undefined reference to `cmELF::GetRunPath()'
cmSystemTools.cxx:(.text+0x4a7): undefined reference to
`cmELF::GetDynamicEntryCount() const'
cmSystemTools.cxx:(.text+0x5a2): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x5dc): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x612): undefined reference to
`cmELF::GetDynamicEntryPosition(int) const'
cmSystemTools.cxx:(.text+0x6d2): undefined reference to
`cmELF::ReadBytes(unsigned long, unsigned long, char*) const'
cmSystemTools.cxx:(.text+0x766): undefined reference to `cmELF::~cmELF()'
cmSystemTools.cxx:(.text+0x77e): undefined reference to `cmELF::~cmELF()'
cmSystemTools.o: In function
`cmSystemTools::CheckRPath(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)':
cmSystemTools.cxx:(.text+0xee6): undefined reference to
`cmELF::cmELF(char const*)'
cmSystemTools.cxx:(.text+0xeef): undefined reference to `cmELF::GetRPath()'
cmSystemTools.cxx:(.text+0xf03): undefined reference to `cmELF::GetRunPath()'
cmSystemTools.cxx:(.text+0xf73): undefined reference to `cmELF::~cmELF()'
cmSystemTools.cxx:(.text+0xf89): undefined reference to `cmELF::~cmELF()'
cmSystemTools.o: In function
`cmSystemTools::ChangeRPath(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*, bool*)':
cmSystemTools.cxx:(.text+0x10d8): undefined reference to
`cmELF::cmELF(char const*)'
cmSystemTools.cxx:(.text+0x1117): undefined reference to `cmELF::GetRPath()'
cmSystemTools.cxx:(.text+0x1155): undefined reference to `cmELF::GetRunPath()'
cmSystemTools.cxx:(.text+0x1698): undefined reference to `cmELF::~cmELF()'
cmSystemTools.cxx:(.text+0x16b0): undefined reference to `cmELF::~cmELF()'
cmSystemTools.o: In function
`cmSystemTools::GuessLibrarySOName(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>&)':
cmSystemTools.cxx:(.text+0x1a91): undefined reference to
`cmELF::cmELF(char const*)'
cmSystemTools.cxx:(.text+0x1aab): undefined reference to
`cmELF::GetSOName(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >&)'
cmSystemTools.cxx:(.text+0x1c6d): undefined reference to `cmELF::~cmELF()'
cmSystemTools.cxx:(.text+0x1c89): undefined reference to `cmELF::~cmELF()'
cmSystemTools.o: In function `cmELF::operator bool() const':
cmSystemTools.cxx:(.text._ZNK5cmELFcvbEv[cmELF::operator bool()
const]+0x11): undefined reference to `cmELF::Valid() const'
collect2: ld returned 1 exit status
gmake: *** [cmake] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake

***********************************

Could anyone let me know what is the problem here?

Thanks,
Zhuang


--
Zhuang Song, Ph.D.
Postdoctoral Fellow
Department of Psychiatry
University of California, San Diego
3350 La Jolla Village Drive (116A)
San Diego, CA  92161

This is just a wild guess, but do you have the binutils package installed?

Michael
 
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Michael Wild | 2 May 2010 10:58
Picon
Gravatar

Re: Configure Mac OS X for 32-bit

Well, setting CMAKE_OSX_ARCHITECTURES to i386 AND ppc is going to get you a universal build, both of the architectures being 32-bit. So, what is it exactly that you want?

Michael Wild

On Sun, May 2, 2010 at 8:15 AM, Tron Thomas <tron.thomas-H+0wwilmMs3R7s880joybQ@public.gmane.org> wrote:
It looks like:

set (CMAKE_OSX_ARCHITECTURES "i386 ppc")

will build a universal binary for a debug build on any platform.  How can someone configure things so that Xcode will build a platform specific debug version that is 32-bit?



On 05/01/2010 04:55 PM, Mike Jackson wrote:
You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
on snow leopard is 64bit where as on leopard it is 32 bit.

-----
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson-o71+U35G4LUGVr8H/5ucqw@public.gmane.org
BlueQuartz Software               Dayton, Ohio


On May 1, 2010, at 15:33, Tron Thomas<tron.thomas-H+0wwilmMs3R7s880joybQ@public.gmane.org>  wrote:

 
I am writing a cross platform application using CMake that builds on
Mac OS X.  I just upgraded to CMake 2.8-1.  When I configure and
build my project on my Power Mac G5 system running Mac OS X 10.5.8,
the project builds just fine.

When I try to configure the project on my MacBook Pro running Mac OS
X 10.6.3, I get link errors because the project has been configured
to build 64-bit applications and some of the needed libraries and
frameworks the project links with are only 32-bit.

How can I configure my CMake scripts so that the project will build
a 32-bit application on my MacBook Pro?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
   
 

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Bill Hoffman | 2 May 2010 15:19
Favicon
Gravatar

Re: installation problem

On 5/2/2010 4:55 AM, Michael Wild wrote:
>
>
> On Sun, May 2, 2010 at 3:40 AM, Zhuang Song <zhuang.song@...
> <mailto:zhuang.song@...>> wrote:
>
>     Hi!
>     I am trying to install CMake in our Linux server. I follow the three
>     steps: $ ./bootstrap; make; make install
>
>     in running bootstrap, I got the following messages:
>
>     ***********************************
>     cmSystemTools.o: In function
>     `cmSystemTools::RemoveRPath(std::basic_string<char,
>     std::char_traits<char>, std::allocator<char> > const&,
>     std::basic_string<char, std::char_traits<char>, std::allocator<char>
>      >*, bool*)':
>     cmSystemTools.cxx:(.text+0x3d0): undefined reference to
>     `cmELF::cmELF(char const*)'
>     cmSystemTools.cxx:(.text+0x3f9): undefined reference to
>     `cmELF::GetRPath()'
>     cmSystemTools.cxx:(.text+0x426): undefined reference to
>     `cmELF::GetRunPath()'
>     cmSystemTools.cxx:(.text+0x4a7): undefined reference to
>     `cmELF::GetDynamicEntryCount() const'
>     cmSystemTools.cxx:(.text+0x5a2): undefined reference to
>     `cmELF::GetDynamicEntryPosition(int) const'
>     cmSystemTools.cxx:(.text+0x5dc): undefined reference to
>     `cmELF::GetDynamicEntryPosition(int) const'
>     cmSystemTools.cxx:(.text+0x612): undefined reference to
>     `cmELF::GetDynamicEntryPosition(int) const'
>     cmSystemTools.cxx:(.text+0x6d2): undefined reference to
>     `cmELF::ReadBytes(unsigned long, unsigned long, char*) const'
>     cmSystemTools.cxx:(.text+0x766): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.cxx:(.text+0x77e): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.o: In function
>     `cmSystemTools::CheckRPath(std::basic_string<char,
>     std::char_traits<char>, std::allocator<char> > const&,
>     std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>     const&)':
>     cmSystemTools.cxx:(.text+0xee6): undefined reference to
>     `cmELF::cmELF(char const*)'
>     cmSystemTools.cxx:(.text+0xeef): undefined reference to
>     `cmELF::GetRPath()'
>     cmSystemTools.cxx:(.text+0xf03): undefined reference to
>     `cmELF::GetRunPath()'
>     cmSystemTools.cxx:(.text+0xf73): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.cxx:(.text+0xf89): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.o: In function
>     `cmSystemTools::ChangeRPath(std::basic_string<char,
>     std::char_traits<char>, std::allocator<char> > const&,
>     std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>     const&, std::basic_string<char, std::char_traits<char>,
>     std::allocator<char> > const&, std::basic_string<char,
>     std::char_traits<char>, std::allocator<char> >*, bool*)':
>     cmSystemTools.cxx:(.text+0x10d8): undefined reference to
>     `cmELF::cmELF(char const*)'
>     cmSystemTools.cxx:(.text+0x1117): undefined reference to
>     `cmELF::GetRPath()'
>     cmSystemTools.cxx:(.text+0x1155): undefined reference to
>     `cmELF::GetRunPath()'
>     cmSystemTools.cxx:(.text+0x1698): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.cxx:(.text+0x16b0): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.o: In function
>     `cmSystemTools::GuessLibrarySOName(std::basic_string<char,
>     std::char_traits<char>, std::allocator<char> > const&,
>     std::basic_string<char, std::char_traits<char>, std::allocator<char>
>      >&)':
>     cmSystemTools.cxx:(.text+0x1a91): undefined reference to
>     `cmELF::cmELF(char const*)'
>     cmSystemTools.cxx:(.text+0x1aab): undefined reference to
>     `cmELF::GetSOName(std::basic_string<char, std::char_traits<char>,
>     std::allocator<char> >&)'
>     cmSystemTools.cxx:(.text+0x1c6d): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.cxx:(.text+0x1c89): undefined reference to
>     `cmELF::~cmELF()'
>     cmSystemTools.o: In function `cmELF::operator bool() const':
>     cmSystemTools.cxx:(.text._ZNK5cmELFcvbEv[cmELF::operator bool()
>     const]+0x11): undefined reference to `cmELF::Valid() const'
>     collect2: ld returned 1 exit status
>     gmake: *** [cmake] Error 1
>     ---------------------------------------------
>     Error when bootstrapping CMake:
>     Problem while running gmake
>
>     ***********************************
>
>     Could anyone let me know what is the problem here?
>
Start with a clean build/source tree, this is a known issue with the 
bootstrap process.   If you run the bootstrap more than once you can get 
this error.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Mr Shore | 2 May 2010 16:20
Picon

How do I tell cmake not to create a console window?

I can achieve this by gcc :

gcc -mwindows -o simple simple.c


But only find this in cmake:

add_executable(simple WIN32 simple.c)

But it's not exactly the same as -mwindows,

this will require the entry point to be WinMain,

while gcc -mwindows doesn't require this.

How should I do it properly?
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Gmane