Building ROOT on unsupported architectures

I am trying build ROOT using an unsupported architecture - using a non-gcc compiler. As “practice” I tried to build it on inux and gcc, but as if it were a different architecture. I added a new test architecture to config/ARCH and copied Makefile.linuxx86gcc to Makefile.[test architecture], and then tried to do a ./configure [test architecture] and make, and I did not get an identical setup as x86 (or even one that worked).

Clearly I am missing something. Which files need to be copied/renamed to make this work?

I think you need to modify the “configure” script as well (e.g. search for the word “linux” inside, in order to get an idea what you would need to add there).

I’m still struggling. Here is what I have done:

[ul]Added a line “linuxtest” to the config/ARCHS file.
Copied config/Makefile.linuxx8664gcc to config/Makefile.linuxtest
Duplicated the linuxx8664 section in ./configure (near line 1747) to one for linuxtest
Duplicated the linuxx8664 section in ./config/ (near line 305) to one for linuxtest

Note that the name of the new architecture starts with linux; this was deliberate.

./config linuxx8664gcc --minimal followed by make works.

./config linuxtest --minimal followed by make does not work. The messages “checking whether to build etc.” are identical to the above. The problem is with Cintex (/usr/bin/ld: cannot find -lCintex). So it appears that I need to edit at least one more file.

I don’t know why it tries to build “cintex” … it should not be needed at all … try to explicitly add “–disable-cintex”

No change; I wouldn’t expect --disable-cintex to do anything after --minimal was selected, and it doesn’t.

Well, I would try the following … cd /where/you/unpacked/the/hacked/root make distclean ./configure linuxx8664gcc --minimal > configure.linuxx8664gcc.out.txt 2>&1 cp -a config.log config.linuxx8664gcc.log make > make.linuxx8664gcc.out.txt 2>&1 make distclean ./configure linuxtest --minimal > configure.linuxtest.out.txt 2>&1 cp -a config.log config.linuxtest.log diff configure.linuxtest.out.txt configure.linuxx8664gcc.out.txt diff config.linuxtest.log config.linuxx8664gcc.log make > make.linuxtest.out.txt 2>&1 diff make.linuxtest.out.txt make.linuxx8664gcc.out.txt

Very interesting.

The good news is that it did spot a missing file: cint/iosenum/iosenum.linuxtest3

The bad news is that there’s still something wrong. The difference on the configure is that linuxtest is looking for a 32-bit zlib: “Checking for libz … /usr/lib” rather than “Checking for libz … /usr/lib64”

The makefile differences are huge: there is a missing -m64 in many places - but not quite everywhere - in linuxtest, which flags many of the compile lines. (~1000 differences)

The link phase shows that Cintex is being looked for, but does not give me any hints about why it is looking for it.

g++ -shared -Wl,-soname, -m64 -O2 -Wl,--no-undefined -Wl,--as-needed -o lib/ cint/cint/lib/dll_stl/rootcint_vector.o -Llib -lCint -Llib -lCore -lCint -ldl

Oh, one more thing. There is also a /etc/vmc/Makefile.linuxx8664gcc file which I copied to /etc/vmc/Makefile.linuxtest. Makes no obvious difference.

You need to find out why it chooses a 32-bit zlib instead of a 64-bit one (this may have the same cause that results in the missing “-m64” afterwards).
I’ve got an additional idea what you can “compare” … see my previous post here … I modified the “procedure” (the “config.log” file contains the exact “flow” of the configure execution).

I tried a fresh install, hacked things as described above and now things are slightly different with respect to -m64.

First, the config.logs are identical except for “Architecture set to linuxtest/linuxx8664gcc by user”

Second, configure.linuxtest.out.txt and configure.linuxx8664gcc.out.txt are now (after the fresh install) identical.

Finally, the output of make is still very different. Linuxtest starts with " checking for gcc… gcc" rather than “checking for gcc… gcc -m64” and ends with an inability to find Cintex.

So there still seems to be at least one more file that needs to be changed. Thoughts?

[quote=“Tom LeCompte”]Finally, the output of make is still very different. Linuxtest starts with " checking for gcc… gcc" rather than “checking for gcc… gcc -m64” and ends with an inability to find Cintex.[/quote] This sounds really weird. It looks like it was running some “configure” step.
When I run “make”, the very first line that I see is:
cp cint/cint/inc/Api.h include/Api.h
and, afterwards, “grep -i checking make.linuxx8664gcc.out.txt” returns nothing.

I think I know where any “configure” steps come from, when one runs “make”.
Have a look at the end of the “configlog" and "configureout.txt” files.
In both of them, there should be a line in form “Enabled support for …”.
See if there are any “builtin_SomePackage” entries in this line. If yes, each of these packages will be built from scratch (when you “make” ROOT), starting with an appropriate “configure” step (and these “configure” scripts do not know your “new” architecture at all). Appropriate “.tar.gz” source code archive files are included in the ROOT distribution. Try:
find ./ -name “tar.gz"
In particular, in your case, I tip on “pcre” and “lzma” packages.
If this is the case, you will need to provide appropriate binary versions of “pcre” and “lzma”, which you need to compile yourself (e.g. by your “new” compiler, or any compiler that produces libraries which are “binary compatible” with your “new” compiler). Then the ROOT “configure” step should find them (again, check the "config
log” file and make sure that it picks the right include files and libraries) and it will not try to build them from scratch when running “make”.

I get the message “Enabled support for builtin_pcre, builtin_lzma, explicitlink, shadowpw, shared.”

So I tried a very simple thing:
./configure linuxx8664gcc --minimal --disable-builtin-pcre --disable-builtin-lzma

I still get “Enabled support for builtin_pcre, builtin_lzma, explicitlink, shadowpw, shared.”

(And for whatever it’s worth, I have a system copy installed)

So while you may be on to something, I seem not to be able to toggle the setting.

You cannot build ROOT without “pcre” and “lzma” (they are either provided by the operating system or ROOT will compile its own versions).
Note: if you want to use the “operating system provided” packages, you need to install appropriate “binary” and “development” packages which provide “pcre” and “lzma” binary libraries and include files (afterwards, you should not get any “builtin_SomePackage” entries).