Link to local glibc

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

Link to local glibc

Michele Portolan
Hello,

I build on a Ubuntu machine (kernel 4.4.0-64-generic), but I need my
program to be executed on an old Cento 5.8 (kernel 2.6.18). I tried
compiling with "-static" to have static linking, but when I try to
execute I get "ERROR: Kernel too old!"

I therefore locally compiled a glibc with support for kernel 2.6.18 ...
but how can I have Cmake use it instead of the system one?

Thanks,


Michele

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Link to local glibc

Marcel Loose
Hi Michele,

This could become a painful exercise. You basically have two options:
1) Treat it as a cross-compilation project, or
2) Create a virtual machine running CentOS 5.8 and do the build there.
If I were you, I would go for the second option.

Cheers,
Marcel.

Op 07-03-17 om 17:56 schreef Michele Portolan:

> Hello,
>
> I build on a Ubuntu machine (kernel 4.4.0-64-generic), but I need my
> program to be executed on an old Cento 5.8 (kernel 2.6.18). I tried
> compiling with "-static" to have static linking, but when I try to
> execute I get "ERROR: Kernel too old!"
>
> I therefore locally compiled a glibc with support for kernel 2.6.18 ...
> but how can I have Cmake use it instead of the system one?
>
> Thanks,
>
>
> Michele
>


--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Link to local glibc

Chuck Atkins
If you're using a newer Ubuntu environment, I'd suggest using a CentOS 5 docker container.   Either that or the VM.

- Chuck

On Tue, Mar 7, 2017 at 1:53 PM, Marcel Loose <[hidden email]> wrote:
Hi Michele,

This could become a painful exercise. You basically have two options:
1) Treat it as a cross-compilation project, or
2) Create a virtual machine running CentOS 5.8 and do the build there.
If I were you, I would go for the second option.

Cheers,
Marcel.

Op 07-03-17 om 17:56 schreef Michele Portolan:
> Hello,
>
> I build on a Ubuntu machine (kernel 4.4.0-64-generic), but I need my
> program to be executed on an old Cento 5.8 (kernel 2.6.18). I tried
> compiling with "-static" to have static linking, but when I try to
> execute I get "ERROR: Kernel too old!"
>
> I therefore locally compiled a glibc with support for kernel 2.6.18 ...
> but how can I have Cmake use it instead of the system one?
>
> Thanks,
>
>
> Michele
>



--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Link to local glibc

Michele Portolan

I'll try and see if I can compile a gcc 4.9.3 chain on the CentOS 5 machine (I need C++11).

The docker container looks interesting but I haven't used it yet: does it need some specific install on the target machine? I don't have any install rights on the Cento 5.11 machine....

Thanks,


Michele


Le 07/03/2017 à 22:33, Chuck Atkins a écrit :
If you're using a newer Ubuntu environment, I'd suggest using a CentOS 5 docker container.   Either that or the VM.

- Chuck

On Tue, Mar 7, 2017 at 1:53 PM, Marcel Loose <[hidden email]> wrote:
Hi Michele,

This could become a painful exercise. You basically have two options:
1) Treat it as a cross-compilation project, or
2) Create a virtual machine running CentOS 5.8 and do the build there.
If I were you, I would go for the second option.

Cheers,
Marcel.

Op 07-03-17 om 17:56 schreef Michele Portolan:
> Hello,
>
> I build on a Ubuntu machine (kernel 4.4.0-64-generic), but I need my
> program to be executed on an old Cento 5.8 (kernel 2.6.18). I tried
> compiling with "-static" to have static linking, but when I try to
> execute I get "ERROR: Kernel too old!"
>
> I therefore locally compiled a glibc with support for kernel 2.6.18 ...
> but how can I have Cmake use it instead of the system one?
>
> Thanks,
>
>
> Michele
>



--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake





--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Link to local glibc

Chuck Atkins

I'll try and see if I can compile a gcc 4.9.3 chain on the CentOS 5 machine (I need C++11).

I'd suggest using the devtollset repo from https://people.centos.org/tru/devtools/devtools.repo
 

The docker container looks interesting but I haven't used it yet: does it need some specific install on the target machine? I don't have any install rights on the Cento 5.11 machine....


I think you misunderstand.  I meant to use a docker container on your Ubuntu machine running CentOS 5 as a development environment.  That way you can use your Ubuntu workstation to build in a CentOS 5 environment.

- Chuck


--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Link to local glibc

Michele Portolan

At the end of the day, here is what I did:

 1) create a development Centos 5.5 machine

 2) on the dev machine, I compiled gcc 4.9.3 from sources, installed it locally and updated the build system (cmake, etc..) with only local builds, if possible from source. By exploiting LD_LIBRARY_PATH, I link to the glibc et al. in the gcc 4.9.3 installation path

 3) I run Cmake on the dev machine, to obtain the executables and libraries

 4) I prepare a distribution with the Cmake-built exe and libs, and in case of dynamic linking, the dependecies found by ldd

 5) I unpack the distribution on my target Cento0S 5.5 machine and run the execs, if needed using LD_LIBRARY_PATH for the local libs


Quite the workaround, but it works better than manually handling all glibc dependencies!


Michele


On 08/03/17 17:57, Chuck Atkins wrote:

I'll try and see if I can compile a gcc 4.9.3 chain on the CentOS 5 machine (I need C++11).

I'd suggest using the devtollset repo from https://people.centos.org/tru/devtools/devtools.repo
 

The docker container looks interesting but I haven't used it yet: does it need some specific install on the target machine? I don't have any install rights on the Cento 5.11 machine....


I think you misunderstand.  I meant to use a docker container on your Ubuntu machine running CentOS 5 as a development environment.  That way you can use your Ubuntu workstation to build in a CentOS 5 environment.

- Chuck



--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake