"portable" linux binaries?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

"portable" linux binaries?

Mark Moll-2
Is there any mechanism in CMake that would make it easier to create Linux binaries that run on more than one version of Linux / glibc? I am thinking of something along the lines of the support for OS X Universal Binaries in CMake or the functionality provided by apgcc in the autopackage tool (http://autopackage.org/apbuild-apgcc.php).

--
Mark



_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

Bill Hoffman
Mark Moll wrote:
> Is there any mechanism in CMake that would make it easier to create
> Linux binaries that run on more than one version of Linux / glibc? I
> am thinking of something along the lines of the support for OS X
> Universal Binaries in CMake or the functionality provided by apgcc in
> the autopackage tool (http://autopackage.org/apbuild-apgcc.php).
>


Why reinvent?

This should work just as well with CMake as it does for autotools:

export CC=apgcc
export CXX=apg++
cmake ..


-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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

j s-3
The most interesting thing is to be able to set the relative RPATH.

Is there a way to do this for a normal build, and not the install target?  I never use the install target for my project, but I'd like to be able to set the relative path to my own copy of libstdc++.  All of the RPATH settings in the man page for cmake 2.4 seem to be in terms of INSTALL.

Thanks,

Juan

On Mon, Nov 23, 2009 at 3:55 PM, Bill Hoffman <[hidden email]> wrote:
Mark Moll wrote:
Is there any mechanism in CMake that would make it easier to create
Linux binaries that run on more than one version of Linux / glibc? I
am thinking of something along the lines of the support for OS X
Universal Binaries in CMake or the functionality provided by apgcc in
the autopackage tool (http://autopackage.org/apbuild-apgcc.php).



Why reinvent?

This should work just as well with CMake as it does for autotools:

export CC=apgcc
export CXX=apg++
cmake ..


-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


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

Alexander Neundorf-3
On Tuesday 24 November 2009, j s wrote:
> The most interesting thing is to be able to set the relative RPATH.
>
> Is there a way to do this for a normal build, and not the install target?
> I never use the install target for my project, but I'd like to be able to
> set the relative path to my own copy of libstdc++.  All of the RPATH
> settings in the man page for cmake 2.4 seem to be in terms of INSTALL.

I think you can set the rpath relative to the containing ELF file
using "$ORIGIN" in the path.

If you want to build directly with the install (or custom) rpath, you can set
BUILD_WITH_INSTALL_RPATH to TRUE and then set INSTALL_RPATH as you like.

Alex
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

j s-3
Thanks, that should work.

Regards,

Juan

2009/11/24 Alexander Neundorf <[hidden email]>
On Tuesday 24 November 2009, j s wrote:
> The most interesting thing is to be able to set the relative RPATH.
>
> Is there a way to do this for a normal build, and not the install target?
> I never use the install target for my project, but I'd like to be able to
> set the relative path to my own copy of libstdc++.  All of the RPATH
> settings in the man page for cmake 2.4 seem to be in terms of INSTALL.

I think you can set the rpath relative to the containing ELF file
using "$ORIGIN" in the path.

If you want to build directly with the install (or custom) rpath, you can set
BUILD_WITH_INSTALL_RPATH to TRUE and then set INSTALL_RPATH as you like.

Alex


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

j s-3
Hello,

I am running:
cmake version 2.4-patch 7

on Ubuntu 8.04 and I can't get this option to work, whether it is in CMakeLists.txt or on the command line.

 rm CMakeCache.txt; cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib/shared' ../src/; grep RPATH CMakeCache.txt

rm CMakeCache.txt ; cmake -DBUILD_WITH_INSTALL_RPATH=TRUE -DINSTALL_RPATH='$ORIGIN/../lib/shared' ../src/ ; grep RPATH CMakeCache.txt

The man page says to use INSTALL_RPATH and BUILD_WITH_INSTALL_RPATH.

strings /usr/bin/cmake | grep RPATH
_ZN8cmTarget20HaveInstallTreeRPATHEv
_ZN8cmTarget18HaveBuildTreeRPATHEv
SKIP_BUILD_RPATH
CMAKE_SKIP_RPATH
BUILD_WITH_INSTALL_RPATH
INSTALL_RPATH_USE_LINK_PATH
< section from man page here >

Regards,

Juan

On Tue, Nov 24, 2009 at 3:46 PM, j s <[hidden email]> wrote:
Thanks, that should work.

Regards,

Juan

2009/11/24 Alexander Neundorf <[hidden email]>

On Tuesday 24 November 2009, j s wrote:
> The most interesting thing is to be able to set the relative RPATH.
>
> Is there a way to do this for a normal build, and not the install target?
> I never use the install target for my project, but I'd like to be able to
> set the relative path to my own copy of libstdc++.  All of the RPATH
> settings in the man page for cmake 2.4 seem to be in terms of INSTALL.

I think you can set the rpath relative to the containing ELF file
using "$ORIGIN" in the path.

If you want to build directly with the install (or custom) rpath, you can set
BUILD_WITH_INSTALL_RPATH to TRUE and then set INSTALL_RPATH as you like.

Alex



_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: "portable" linux binaries?

Alexander Neundorf-3
On Sunday 29 November 2009, j s wrote:

> Hello,
>
> I am running:
> cmake version 2.4-patch 7
>
> on Ubuntu 8.04 and I can't get this option to work, whether it is in
> CMakeLists.txt or on the command line.
>
>  rm CMakeCache.txt; cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE
> -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib/shared' ../src/; grep RPATH
> CMakeCache.txt
>
> rm CMakeCache.txt ; cmake -DBUILD_WITH_INSTALL_RPATH=TRUE
> -DINSTALL_RPATH='$ORIGIN/../lib/shared' ../src/ ; grep RPATH CMakeCache.txt
>
> The man page says to use INSTALL_RPATH and BUILD_WITH_INSTALL_RPATH.

Please post a complete small example where the issue can be reproduced (and
the properties are set via set_target_properties() ).

Thanks
Alex
_______________________________________________
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