5.30.02: TChirpFile.cxx fails to compile "getenv"

dear all,
am trying to compile 5.30.02 with Chirp support (i configured with these options
–enable-chirp --with-chirp-incdir=/usr/local/lib/cctools/cctools-3.3.4-i686-redhat5/include/cctools --with-chirp-libdir=/usr/local/lib/cctools/cctools-3.3.4-i686-redhat5/lib

and it seems to fail to compile TChirpFile.cxx. Is it a known issue?
if i add: #include <stdlib.h> it’s fine.

thanks in advance.
Below some extended output
==> lib/libX3d.so done
bin/rmkdepend -R -fio/chirp/src/TChirpFile.d -Y -w 1000 – -pipe -m32 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/local/lib/cctools/cctools-3.3.4-i686-redhat5/include/cctools -D__cplusplus – /usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx
g++ -O2 -pipe -m32 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/local/lib/cctools/cctools-3.3.4-i686-redhat5/include/cctools -o io/chirp/src/TChirpFile.o -c /usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx
/usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx: In function ‘void chirp_root_global_setup()’:
/usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx:75:54: error: ‘getenv’ was not declared in this scope
/usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx:89:64: error: ‘atoi’ was not declared in this scope
/usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx: At global scope:
/usr/local/lib/root/v5-30-02/io/chirp/src/TChirpFile.cxx:251:7: warning: unused parameter ‘fd’
make: *** [io/chirp/src/TChirpFile.o] Error 1
i checked that the following works, to check whether something is wrong with my machine settings, and it works fine.

#include <stdio.h>
#include <stdlib.h>

int main ()
{
char * pPath;
pPath = getenv (“PATH”);
if (pPath!=NULL)
printf (“The current path is: %s”,pPath);
return 0;
}

am using Ubuntu 11.0.4
my gcc is:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu/Linaro 4.5.2-8ubuntu4’ --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)

hi again,
i would like to compile ROOT 5.00.26e (the current Tag used in ATLAS with the chirp support enabled and it fails, since it seems to be incompatible with the external chirp_client.
I tried the different tags like:
cctools-3.2.2-i686-redhat5

cctools-3.3.4-i686-redhat5

and all fail during compilation, since it seems the TChirpFile.cxx is incompatible with the chirp_client set of functions.
Can one expert tell me which tag is compatible with 5.00.26e?
thanks (in advance)

here is some more info about the failure, if i use 3.2.2 (previous and more recent tags fail as well)
i welcome any help.

g++ -O2 -pipe -m32 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include -o io/chirp/src/TChirpFile.o -c io/chirp/src/TChirpFile.cxx
io/chirp/src/TChirpFile.cxx: In member function ‘Int_t TChirpFile::OpenChirpClient(const char*, const char**)’:
io/chirp/src/TChirpFile.cxx:167: error: ‘chirp_client_connect_url’ was not declared in this scope
io/chirp/src/TChirpFile.cxx: In member function ‘virtual Int_t TChirpFile::SysOpen(const char*, Int_t, UInt_t)’:
io/chirp/src/TChirpFile.cxx:204: error: invalid conversion from ‘char*’ to ‘long long int’
/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include/chirp_client.h:27: error: too few arguments to function 'long long int chirp_client_open(chirp_client*, const char*, long long int, long long int, chirp_stat*, time_t)'
io/chirp/src/TChirpFile.cxx:204: error: at this point in file
/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include/chirp_client.h: In member function ‘virtual Int_t TChirpFile::SysClose(Int_t)’:
/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include/chirp_client.h:28: error: too few arguments to function 'long long int chirp_client_close(chirp_client*, long long int, time_t)'
io/chirp/src/TChirpFile.cxx:216: error: at this point in file
io/chirp/src/TChirpFile.cxx: In member function ‘virtual Int_t TChirpFile::SysRead(Int_t, void*, Int_t)’:
io/chirp/src/TChirpFile.cxx:230: error: ‘chirp_client_read’ was not declared in this scope
io/chirp/src/TChirpFile.cxx: In member function ‘virtual Int_t TChirpFile::SysWrite(Int_t, const void*, Int_t)’:
io/chirp/src/TChirpFile.cxx:244: error: ‘chirp_client_write’ was not declared in this scope
io/chirp/src/TChirpFile.cxx: In member function ‘virtual Long64_t TChirpFile::SysSeek(Int_t, Long64_t, Int_t)’:
io/chirp/src/TChirpFile.cxx:258: error: ‘chirp_client_lseek’ was not declared in this scope
/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include/chirp_client.h: In member function ‘virtual Int_t TChirpFile::SysSync(Int_t)’:
/AtlasDisk/software/tools/cctools-3.2.2-i686-redhat5/include/chirp_client.h:33: error: too few arguments to function ‘long long int chirp_client_fsync(chirp_client*, long long int, time_t)’

hi,
apologize to insist but is there any advice here (besides the one which would say: use a more recent version"
thanks.

Hi,

The 5.30 patch branch has been updated to fix the compilation of the chirp plugins.

For v5.26, you would need to use a cctools/chirp strictly older than 3.2.2. The plugin has been update for chirp 3.2.2 only in time for v5.30 of ROOT. If you need a backport of this to the (ancient) version v5.26 of ROOT you will need to request it from the chirp development team as they are currently supporting the ROOT plugin.

Cheers,
Philippe.