'libafsauthent.a' root 5.26.00c build failure

I’m running Debian Squeeze. I’ve tried all day to get root working, but everytime I fix one thing another comes up… and the building process fails. At first I was trying the ‘debian’ target for make, to build a set of debian packages. But the bugs were many…

So I decided to build cleanly from source and I did:

./configure linuxx8664gcc --prefix=/usr/local --disable-builtin-afterimage --disable-builtin-freetype --disable-builtin-glew --disable-builtin-pcre --disable-builtin-zlib --disable-builtin-ftgl --enable-gsl-shared --enable-minuit2 --enable-roofit --enable-table --enable-gdml --enable-qt --enable-qtgsi --enable-soversion --enable-unuran --enable-ruby

The result was fine. No problems. I also tried --enable-afs with no problems. Then I did

And the disaster ensued:

g++ ../../obj/XrdSecProtocolpwd.o -m64 -shared -lcrypt /usr/lib64/libafsauthent.a /usr/lib64/libafsauthent.a -L../../lib -lXrdCrypto -lXrdSut -lXrdOuc -lXrdSys -lnsl -lpthread -lrt -ldl -lc -lresolv -o ../../lib/libXrdSecpwd.so /usr/bin/ld: /usr/lib64/libafsauthent.a(client.o): relocation R_X86_64_32 against `grmutex' can not be used when making a shared object; recompile with -fPIC /usr/lib64/libafsauthent.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[5]: *** [../../lib/libXrdSecpwd.so] Error 1 make[4]: *** [Linuxall] Error 2 make[3]: *** [all] Error 2 make[2]: *** [XrdSecpwd] Error 2 make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/candres/Downloads/builds/root/root-5.26.00c/net/xrootd/src/xrootd' *** Error condition reported by make (rc = 2): make: *** [net/xrootd/src/xrootd/LastBuild.d] Error 1 make: *** Waiting for unfinished jobs.... rm core/utils/src/RStl_tmp.cxx core/utils/src/rootcint_tmp.cxx

I have no clue how to tackle this one. I have installed a package called: ‘libopenafs-dev’, but it doesn’t seem to do a good enough job. I tried --disable-afs, but it didn’t work. I haven’t tried --disable-xrootd, but I was hoping to use this feature at some point.

Any help is appreciated

Andres Cimmarusti

Dear acimmarusti,

Unfortunately there is no way out else then rebuilding the incriminating library with fPIC support.
Thereis script to help you in doing that under net/xrootd/src/xrootd/utils, installOpenAFS.sh .
Have a look to the top of that script for instructions about how to run it.

G. Ganis

Thanks.

I tried using the script with both supported versions using the --with-afs option to change the location, but for version 1.4 afs didn’t build and for version 1.5 I got the same error as before.

It’s highly likely I made a mistake, but I decided not to bother with this anymore so I passed the following options to the configure script

--disable-afs --disable-xrootd

And it compiled fine. I installed it and, after an unrelated hiccup, is working. I have to test it thoroughly.

I submitted a bug report to debian, asking for libopenafs to be compiled with fPIC support. This is what the maintainer answered:

[quote]Andres Cimmarusti acimmarusti@gmail.com writes:

Hello, I’m trying to compile root-system from source (as the packages in
Debian are very outdated and/or broken.

However, I’m getting the error during compilation:

g++ …/…/obj/XrdSecProtocolpwd.o -m64 -shared -lcrypt /usr/lib64/libafsauthent.a /usr/lib64/libafsauthent.a -L…/…/lib -lXrdCrypto -lXrdSut -lXrdOuc -lXrdSys -lnsl -lpthread -lrt -ldl -lc -lresolv -o …/…/lib/libXrdSecpwd.so
/usr/bin/ld: /usr/lib64/libafsauthent.a(client.o): relocation R_X86_64_32 against `grmutex’ can not be used when making a shared object; recompile with -fPIC
/usr/lib64/libafsauthent.a: could not read symbols: Bad value

Could you please compile openafs with fPIC support? I believe that would
solve the issue.

PIC versions of the libraries are available as -lafsauthent_pic and
-lafsrpc_pic (this matches the current upstream stable branch). There
will be real shared libraries once 1.6 is released.[/quote]

Now, I’m not sure how to tell the root build system to use those versions instead of the plain one…any clues? I’ll do some more searching

Andres

Dear Andres,

I am surprised that with the ad hoc build of 1.5 you get the same result: are you sure that
the freshly built libraries were linked in?

Anyhow, good to know that Debian provides the fPIC version of the libraries. If other distributions
do that as well, possibly with the same syntax, we can include those in the searches done by ROOT
and Xroot configure scripts.

In the meantime, I would try by creating a local directory, e.g. $HOME/afspic, where you create symlinks to the “_pic” version of the relevant libraries, with the “_pic” removed from the symlink name, e.g.

$HOME/afspic ~> ln -sf /usr/lib64/libafsauthent_pic.a libafsauthent.a 

and then you configure with

--with-afs-libdir=$HOME/afspic

Note, also, that you should not be forced to fully disable Xrootd to circumvent the afs related build issue; this should work as well:

--with-xrootd-opts="--disable-afs"

Gerri

Ok thanks. I’ll give it a try when I have more time. Right now I’m hard pressed to come up with a working script. I will also try to find out if other distros provide the fPIC version of the library. I think it’s a fair assumption that Debian based distros like Ubuntu will have it exactly like the maintainer described:

packages.debian.org/sid/amd64/li … v/filelist
(search for libafsauthent and you will see both versions)

I have a CentOS machine I can also investigate and other popular distros like Fedora, OpenSuSe and Mandriva will probably have web infrastructure to search packages like Debian and Ubuntu do.

[quote=“ganis”]Dear Andres,
Note, also, that you should not be forced to fully disable Xrootd to circumvent the afs related build issue; this should work as well:

--with-xrootd-opts="--disable-afs"

[/quote]

I tried this and it now works. I tried a CentOS machine and I didn’t need to disable afs.