0

I'm trying to build a portable version of gcc 4.8.2. (for only C/C++ languages) The end result is have gcc installed into a specific application directory, eg, /opt/gcc-4.8.2 so that I can copy that directory from one computer to another (all computers are either intel corei5 or corei7, running recent Linux versions, eg, Ubuntu 12, Suse 10/11, Centos 5 & 6).

So far I'm able to build gcc ok, using --prefix to have the gcc outputs placed in a single directory (which can then be later copied to the other hosts). I configured & built gcc's dependencies (gmp, mpfr, mpc, isl) to have --disable-shared, so I can be sure that the final gcc, when copied to other hosts, won't complain about missing libraries or symbols.

I have a question with cloog. I configured gcc with --with-cloog (to pick up my locally built cloog, which I built along with the other gcc dependencies). However, what I don't know, is whether I also need to copy the cloog libraries and binary to each host I copy gcc to?

Also, how can I test gcc & cloog interaction? Is there a simple C file example and/or gcc command line that can be used to test whether gcc is successfully making use of cloog?

Additionally, are there any other considerations when trying to build a gcc which I then want to run on other hosts?

Darren Smith
  • 2,261
  • 16
  • 16

1 Answers1

3

It depends if cloog is installed as a shared library libcloog-isl.so.* or as a static one libcloog.a ; use

ldd $(gcc-4.8 -print-file-name=cc1)

to find out. Of course you need to install all the shared libraries dependencies. If libcloog*so appears in the output of above ldd command, it is a shared library. Otherwise a static one.

You could set the LD_LIBRARY_PATH, or add the directory containing libcloog-isl.so.* (e.g. /usr/local/lib/ or /opt/lib/ etc...) to /etc/ld.so.conf (then run ldconfig)

I am not entirely sure your gcc build can run on every platform you mentioned. There might be libc* dependencies. See this. And perhaps also binutils dependencies (notably for gcc-4.8 -flto compilations).

To test gcc just compile with optimizations (e.g. gcc-4.8 -Wall -O3) some non-trivial file.

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • "I am not entirely sure your gcc build can run on every platform you mentioned. There might be libc* dependencies." .. yep, I was wondering about this too. I hope to avoid that problem by performing the build of gcc on the oldest OS in our system, eg, Suse 10. – Darren Smith Dec 28 '13 at 08:40