Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Olivier Pierard
Mathieu Malaterre wrote:
 On Fri, Dec 4, 2009 at 4:39 PM, Olivier Pierard
 olivier.pier...@cenaero.be wrote:
   
 Dear all,

 In order to perform 32 bits compilation on 64 bits platform, how can I
 tell that all find_libraries for which no path is specified to look in
 /usr/lib instead of /usr/lib64 ?  Is there a configuration variable for
 cmake platform or a default searching directories variable ?

 

 This is called CMAKE_FIND_ROOT_PATH

 See for example:

 http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/Toolchain-gcc-m32.cmake?view=markup
   
Thank you Mathieu.

Problem is that cmake appends '(/usr)/lib64' automatically to the
CMAKE_FIND_ROOT_PATH.  And since I want to switch between '/usr/lib' and
'/usr/lib64', setting the ROOT_PATH to '/usr' or '/' always ends up with
libraries found in /usr/lib64. Setting it to '/usr/lib' seems to be
ignored because there is nothing in /usr/lib/lib64.

Olivier
 You man need to read:
 http://www.cmake.org/Wiki/CMake_Cross_Compiling

 Cheers
   


-- 
Olivier Pierard

CENAERO, Virtual Manufacturing Group

Bâtiment EOLE, 1er étage
Rue des Frères Wright, 29
B-6041 Gosselies
BELGIUM 

Tel: +32.(0)71.919374
Fax: +32.(0)71.919370

http://www.cenaero.be/

+-+-+- Disclaimer +-+-+-

http://www.cenaero.be/disclaimer

___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Marcel Loose
Hi Olivier,

I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
to OFF.

BTW, I disagree with Mathieu that building 32-bit libraries/executables
on a 64-bit system is cross-compilation. These binaries can be run
without a problem on the host system. So, IMHO, you don't need a
toolchain file. The only thing you have to do is instruct gcc/g++ to
generate 32-bit objects/binaries, using the -m32 option, and tell CMake
to look in lib instead of lib64 by setting the aforementioned property.

Hope this helps. Best regards,
Marcel Loose.


On Mon, 2009-12-07 at 10:09 +0100, Olivier Pierard wrote:
 Mathieu Malaterre wrote:
  On Fri, Dec 4, 2009 at 4:39 PM, Olivier Pierard
  olivier.pier...@cenaero.be wrote:

  Dear all,
 
  In order to perform 32 bits compilation on 64 bits platform, how can I
  tell that all find_libraries for which no path is specified to look in
  /usr/lib instead of /usr/lib64 ?  Is there a configuration variable for
  cmake platform or a default searching directories variable ?
 
  
 
  This is called CMAKE_FIND_ROOT_PATH
 
  See for example:
 
  http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/Toolchain-gcc-m32.cmake?view=markup

 Thank you Mathieu.
 
 Problem is that cmake appends '(/usr)/lib64' automatically to the
 CMAKE_FIND_ROOT_PATH.  And since I want to switch between '/usr/lib' and
 '/usr/lib64', setting the ROOT_PATH to '/usr' or '/' always ends up with
 libraries found in /usr/lib64. Setting it to '/usr/lib' seems to be
 ignored because there is nothing in /usr/lib/lib64.
 
 Olivier
  You man need to read:
  http://www.cmake.org/Wiki/CMake_Cross_Compiling
 
  Cheers

 
 

___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Mathieu Malaterre
On Mon, Dec 7, 2009 at 11:43 AM, Marcel Loose lo...@astron.nl wrote:
 Hi Olivier,

 I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
 to OFF.

 BTW, I disagree with Mathieu that building 32-bit libraries/executables
 on a 64-bit system is cross-compilation. These binaries can be run
 without a problem on the host system. So, IMHO, you don't need a
 toolchain file. The only thing you have to do is instruct gcc/g++ to
 generate 32-bit objects/binaries, using the -m32 option, and tell CMake
 to look in lib instead of lib64 by setting the aforementioned property.


There is two things from the top of my head:
1. ia64 which is not x86 compatible
2. You still need a libz/libpng/libjpeg compiled as 32bits on your
amd64 system...

I think the project needs to be self contained (convenient libs)
otherwise to get it compiled using the -m32 trick

2cts
-- 
Mathieu
___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Marcel Loose
On Mon, 2009-12-07 at 13:19 +0100, Mathieu Malaterre wrote:
 On Mon, Dec 7, 2009 at 11:43 AM, Marcel Loose lo...@astron.nl wrote:
  Hi Olivier,
 
  I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
  to OFF.
 
  BTW, I disagree with Mathieu that building 32-bit libraries/executables
  on a 64-bit system is cross-compilation. These binaries can be run
  without a problem on the host system. So, IMHO, you don't need a
  toolchain file. The only thing you have to do is instruct gcc/g++ to
  generate 32-bit objects/binaries, using the -m32 option, and tell CMake
  to look in lib instead of lib64 by setting the aforementioned property.
 
 
 There is two things from the top of my head:
 1. ia64 which is not x86 compatible
 2. You still need a libz/libpng/libjpeg compiled as 32bits on your
 amd64 system...
 
 I think the project needs to be self contained (convenient libs)
 otherwise to get it compiled using the -m32 trick
 
 2cts

Hi Mathieu

Indeed, ia64 is not x86 compatible. I thought that Olivier was using a
x86_64 processor. Most 64-bit distros (for x86_64 that is) also provide
32-bit libs/binaries.

Best regards,
Marcel Loose.


___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Olivier Pierard
Marcel Loose wrote:
 On Mon, 2009-12-07 at 13:19 +0100, Mathieu Malaterre wrote:
   
 On Mon, Dec 7, 2009 at 11:43 AM, Marcel Loose lo...@astron.nl wrote:
 
 Hi Olivier,

 I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
 to OFF.

 BTW, I disagree with Mathieu that building 32-bit libraries/executables
 on a 64-bit system is cross-compilation. These binaries can be run
 without a problem on the host system. So, IMHO, you don't need a
 toolchain file. The only thing you have to do is instruct gcc/g++ to
 generate 32-bit objects/binaries, using the -m32 option, and tell CMake
 to look in lib instead of lib64 by setting the aforementioned property.
   
 There is two things from the top of my head:
 1. ia64 which is not x86 compatible
 2. You still need a libz/libpng/libjpeg compiled as 32bits on your
 amd64 system...

 I think the project needs to be self contained (convenient libs)
 otherwise to get it compiled using the -m32 trick

 2cts
 

 Hi Mathieu

 Indeed, ia64 is not x86 compatible. I thought that Olivier was using a
 x86_64 processor. Most 64-bit distros (for x86_64 that is) also provide
 32-bit libs/binaries.
   
Thanks guys for your insights.  I'm effectively working on a x86_64 with
32-bits pre-compiled libs provided by Suse in folder /usr/lib/ while
64-bits libraries are in /usr/lib64/.

Solution proposed by Marcel seemed perfectly suitable for me.  So I tried:
set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
...
find_library(FLTK_LIB_TEST NAMES fltk)
message(FIND_LIBRARY_USE_LIB64_PATHS: ${FIND_LIBRARY_USE_LIB64_PATHS})
message(FLTK_LIB_TEST: ${FLTK_LIB_TEST})

And with 'cmake -U *LIB* ..', I get:
FIND_LIBRARY_USE_LIB64_PATHS:OFF
FLTK_LIB_TEST:/usr/lib64/libfltk.a

Of course, libfltk.a is well in both folders /usr/lib/ and /usr/lib64/.

Olivier
 Best regards,
 Marcel Loose.




   


-- 
Olivier Pierard

CENAERO, Virtual Manufacturing Group

Bâtiment EOLE, 1er étage
Rue des Frères Wright, 29
B-6041 Gosselies
BELGIUM 

Tel: +32.(0)71.919374
Fax: +32.(0)71.919370

http://www.cenaero.be/

+-+-+- Disclaimer +-+-+-

http://www.cenaero.be/disclaimer

___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-07 Thread Marcel Loose
On Mon, 2009-12-07 at 14:18 +0100, Olivier Pierard wrote:
 Marcel Loose wrote:
  On Mon, 2009-12-07 at 13:19 +0100, Mathieu Malaterre wrote:

  On Mon, Dec 7, 2009 at 11:43 AM, Marcel Loose lo...@astron.nl wrote:
  
  Hi Olivier,
 
  I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
  to OFF.
 
  BTW, I disagree with Mathieu that building 32-bit libraries/executables
  on a 64-bit system is cross-compilation. These binaries can be run
  without a problem on the host system. So, IMHO, you don't need a
  toolchain file. The only thing you have to do is instruct gcc/g++ to
  generate 32-bit objects/binaries, using the -m32 option, and tell CMake
  to look in lib instead of lib64 by setting the aforementioned property.

  There is two things from the top of my head:
  1. ia64 which is not x86 compatible
  2. You still need a libz/libpng/libjpeg compiled as 32bits on your
  amd64 system...
 
  I think the project needs to be self contained (convenient libs)
  otherwise to get it compiled using the -m32 trick
 
  2cts
  
 
  Hi Mathieu
 
  Indeed, ia64 is not x86 compatible. I thought that Olivier was using a
  x86_64 processor. Most 64-bit distros (for x86_64 that is) also provide
  32-bit libs/binaries.

 Thanks guys for your insights.  I'm effectively working on a x86_64 with
 32-bits pre-compiled libs provided by Suse in folder /usr/lib/ while
 64-bits libraries are in /usr/lib64/.
 
 Solution proposed by Marcel seemed perfectly suitable for me.  So I tried:
 set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
 ...
 find_library(FLTK_LIB_TEST NAMES fltk)
 message(FIND_LIBRARY_USE_LIB64_PATHS: ${FIND_LIBRARY_USE_LIB64_PATHS})
 message(FLTK_LIB_TEST: ${FLTK_LIB_TEST})
 
 And with 'cmake -U *LIB* ..', I get:
 FIND_LIBRARY_USE_LIB64_PATHS:OFF
 FLTK_LIB_TEST:/usr/lib64/libfltk.a
 
 Of course, libfltk.a is well in both folders /usr/lib/ and /usr/lib64/.
 
 Olivier
  Best regards,
  Marcel Loose.
 
 
 
 

Hi Olivier,

FIND_LIBRARY_USE_LIB64_PATHS is a property. Set it like this:

  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)

If you do, you'll see that CMake will find /usr/lib/libfltk.a.

Best regards,
Marcel Loose.


___
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


[CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-04 Thread Olivier Pierard
Dear all,

In order to perform 32 bits compilation on 64 bits platform, how can I
tell that all find_libraries for which no path is specified to look in
/usr/lib instead of /usr/lib64 ?  Is there a configuration variable for
cmake platform or a default searching directories variable ?

Thank you,

olivier

-- 
Olivier Pierard

CENAERO, Virtual Manufacturing Group

Bâtiment EOLE, 1er étage
Rue des Frères Wright, 29
B-6041 Gosselies
BELGIUM 

Tel: +32.(0)71.919374
Fax: +32.(0)71.919370

http://www.cenaero.be/

+-+-+- Disclaimer +-+-+-

http://www.cenaero.be/disclaimer

___
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


Re: [CMake] 32 bits compilation on x64 platform - how to find system libraries

2009-12-04 Thread Mathieu Malaterre
On Fri, Dec 4, 2009 at 4:39 PM, Olivier Pierard
olivier.pier...@cenaero.be wrote:
 Dear all,

 In order to perform 32 bits compilation on 64 bits platform, how can I
 tell that all find_libraries for which no path is specified to look in
 /usr/lib instead of /usr/lib64 ?  Is there a configuration variable for
 cmake platform or a default searching directories variable ?


This is called CMAKE_FIND_ROOT_PATH

See for example:

http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/Toolchain-gcc-m32.cmake?view=markup

You man need to read:
http://www.cmake.org/Wiki/CMake_Cross_Compiling

Cheers
-- 
Mathieu
___
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