Installing PyRods

148 views
Skip to first unread message

john

unread,
May 5, 2011, 3:53:02 AM5/5/11
to iROD-Chat
I have stated to looking at the PyRods api client.
I have downloaded version PyRods-2.5.0
I have changed the setup.cfg file for my client irods installation (on
my laptop).
The Irods server (on a cluster) use standard installation with
PostgreSQL.
When I start the installation
python setup.py build
then I get following errors:
gcc: /home/floan/irods/2.5/iRODS/server/core/obj/srvRodsAPIs.a: No
such file or directory
gcc: /lib/libodbc.a: No such file or directory
error: command 'gcc' failed with exit status 1
[root@floan PyRods-2.5.0]#

What is wrong.



Adil Hasan

unread,
May 5, 2011, 9:14:47 AM5/5/11
to irod...@googlegroups.com
Hello John,
It looks like it cannot find the libraries. Maybe you need to set your
LD_LIBRARY_PATH to point to the
locations of these libraries?
hth
adil

john

unread,
May 6, 2011, 6:39:20 AM5/6/11
to iROD-Chat
The directories:
/home/floan/irods/2.5/iRODS/server/core/obj/
and
/lib/
are there but not the files:
srvRodsAPIs.a and libodbc.a

John

Adil Hasan

unread,
May 6, 2011, 7:00:03 AM5/6/11
to irod...@googlegroups.com
Hello John,
I think maybe you need to build iRODS to make the libraries. They are
part of the usual iRODS installation. The odbc one comes from the
postgres build. Do you have postgres on your laptop installed somewhere?
You could add that to the library path. Or, you could build iRODS with
postgres and not worry about starting it up and then set your
LD_LIBRARY_PATH and then build pyrods?

hope that is of some use,
adil

john

unread,
May 6, 2011, 8:32:29 AM5/6/11
to iROD-Chat
I set the LD_LIBRARY to irods and postgres.
Install irods as server with postgres.

New error
/usr/bin/ld: /home/floan/irods/2.5/iRODS/server/core/obj/
srvRodsAPIs.a(rsCloseCollection.o): relocation R_X86_64_32S against
`CollHandle' can not be used when making a shared object; recompile
with -fPIC
/home/floan/irods/2.5/iRODS/server/core/obj/srvRodsAPIs.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


Adil Hasan

unread,
May 6, 2011, 10:06:37 AM5/6/11
to irod...@googlegroups.com
Hello John,
Sorry. So the build of iRODS was ok, but the build of pyRODS is failing?
Could you try including the -fPIC in the pyRODS build script and see if
that clears up the
problem?
hth
adil

Wilko Kroeger

unread,
May 6, 2011, 2:57:27 PM5/6/11
to irod...@googlegroups.com

Hello John and Adil

I guess irods was compiled on an amd64 (x86-64) platform and on this
platform object files have to be compiled with -fPIC if they will be
included into a shared library. PyRods builds a shared library and links
with the irods object files which were compiled without the -fPIC option
and therefore it fails.

You could set CCFLAGS and then recompile irods and build PyRods for
example:

iRODS % export CCFLAGS=-fPIC (or setenv CCFLAGS -fPIC on c-shells)
iRODS % make clean
iRODS % make
PyRods % python setup.py build

Maybe the irods build should be changed to include -fPIC on amd64
platforms.

Cheers,
Wilko

> --
> "iRODS: the Integrated Rule-Oriented Data-management System; A community
> driven, open source, data grid software solution" https://www.irods.org
>
> iROD-Chat: http://groups.google.com/group/iROD-Chat
>

john

unread,
May 9, 2011, 3:45:44 AM5/9/11
to iROD-Chat
-I removed postgre directory and rebuild irods with ./irodssetup and
as a server with postgresql database.

Did not help:
ules/properties/microservices/obj/propertiesMS.o -L/usr/lib64 -
lpython2.7 -o build/lib.linux-x86_64-2.7/irods.so
/usr/bin/ld: /home/floan/irods/postgres/pgsql/lib/
libodbc.a(SQLAllocHandle.o): relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a shared object;
recompile with -fPIC
/home/floan/irods/postgres/pgsql/lib/libodbc.a: could not read
symbols: Bad value



(This laptop is a fedora 12 and with 64 bits option).

Adil Hasan

unread,
May 9, 2011, 4:20:39 AM5/9/11
to irod...@googlegroups.com
Hello John,
I wonder if the problem is that the arguments to the CCFLAGS is not
being propagate to the
makefile. Do you think it would be possible to run:

make clean

and then make.

I think that the irodssetup script will setup all the other things that
one would need (such as the .irodsEnv file etc). I
think that should hopefully build the libraries that you need.

hth
adil

john

unread,
May 9, 2011, 4:36:07 AM5/9/11
to iROD-Chat
Same problem

/usr/bin/ld: /home/floan/irods/postgre/pgsql/lib/
libodbc.a(SQLAllocHandle.o): relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a shared object;
recompile with -fPIC
/home/floan/irods/postgre/pgsql/lib/libodbc.a: could not read symbols:
Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


john

unread,
May 9, 2011, 5:12:34 AM5/9/11
to iROD-Chat
-fPIC is for 64 bit AMD processor? I have intel.
(I fond this: Warning: Only build the static archive with -fPIC on
AMD64. On other architectures this is unneeded and will have a
performance impact at execution time. )

Jérôme Fuselier

unread,
May 9, 2011, 5:58:43 AM5/9/11
to iROD-Chat
Hello John,

Just some additional information on PyRods install script:
- The srvRodsAPIs.a library is created automatically in the
setup.py script with the ar and ranlib command (around line 150).
- The postgres library should be created by the iRODS default
install. PyRods parses the config.mk file to locate the POSTGRES_HOME
variable and adds '/lib/libodbc.a' to create the full path of the
library. (method IrodsConfigParser.parse())

As Wilko said I believed that you would need to compile iRODS and
postgres with the fPIC option. And then try to compile PyRods.

hth
Jerome

john

unread,
May 9, 2011, 7:06:04 AM5/9/11
to iROD-Chat
I have done this. I set the export CC_FLAGS=-fPIC. (in the prompt and
in the makefile)
I have tried to removed all irods, tar new installation, run
irodssetup as server (default) and with postgres db. I also tired to
run make clean and then make.
Same error message.
John

Jérôme Fuselier

unread,
May 9, 2011, 8:32:18 AM5/9/11
to iROD-Chat
Can you give us information on your current configuration (OS/
processor/...) ? I will try to install a working environment in a
virtual machine and reproduce the error.

Jerome

john

unread,
May 9, 2011, 8:56:48 AM5/9/11
to iROD-Chat
Laptop: Dell Latitude D630
Kernel Linux 2.6.35.12-90.fc14.x86_64
Gnome 2.32.0
Intel Core Duo T7250 2GHz

Jérôme Fuselier

unread,
May 10, 2011, 9:23:27 AM5/10/11
to iROD-Chat
I've managed to reproduce the error and find a solution. Hopefully it
will work for you too.

- Compile iRODS with the -fPIC option. (using CC_FLAGS)
- Modify the setup.py script line 36. libodbc.a should be libodbc.so.
- Compile PyRods
- Add the postgres library dir in the LD_LIBRARY_PATH variable.

hth
Jerome

john

unread,
May 11, 2011, 5:21:07 AM5/11/11
to iROD-Chat
I start from the beginning:
-tar irods from irods2.5.tgz
-cd to iRODS
-export CC_FLAGS=-fPIC
./irodssetup
-include add ....no
-build irods server...yes
-make ..ICAT.. yes
-..
-Download ... Postgres DBMS..yes
-New Postgres directory? /home/floan/irods/postgres
..(defaults)
-include GSI --no
-start iRODS build...yes,

cd to pyrods:
- tar pyrods 2.5.0
-chanced setup.cfg (irods_dir=/home/floan/irods/2.5/iRODS
-Changes the setup.py line 36 to libodbs.so (note (libodbc.so do not
exist in /lib/ and /lib64/
- export LD_LIBRARY_PATH=/home/floan/irods/postgres;/home/floan/irods/
2.5/iRODS
-python setup.py build

SAME ERROR:
/usr/bin/ld: /home/floan/irods/2.5/iRODS/server/core/obj/
srvRodsAPIs.a(rsCloseCollection.o): relocation R_X86_64_32S against
`CollHandle' can not be used when making a shared object; recompile
with -fPIC
/home/floan/irods/2.5/iRODS/server/core/obj/srvRodsAPIs.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


Note! Python version
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2

Jérôme Fuselier

unread,
May 11, 2011, 5:52:24 AM5/11/11
to iROD-Chat
I've made a mistake, the variable is CCFLAGS and not CC_FLAGS.
> ...
>
> read more »

john

unread,
May 11, 2011, 6:37:51 AM5/11/11
to iROD-Chat
Yes

On May 11, 11:52 am, Jérôme Fuselier <jerome.fusel...@gmail.com>
> ...
>
> read more »

john

unread,
May 12, 2011, 4:10:17 AM5/12/11
to iROD-Chat
I start python and write import irods and from irods import *
and get message about; can not find irods

I su root and write python setyp.py install
exit
and
[floan@floan PyRods-2.5.0]$ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import irods
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libodbc.so.1: cannot open shared object file: No such
file or directory
>>>

What now?
> ...
>
> read more »

Jérôme Fuselier

unread,
May 12, 2011, 5:34:34 AM5/12/11
to iROD-Chat
You have to add the postgres lib directory in LD_LIBRARY_PATH.

`export LD_LIBRARY_PATH=/home/floan/irods/postgres/pgsql/lib:
$LD_LIBRARY_PATH`

Check the path if it's the right one. You should find the shared
library "libodbc.so" in it.
> ...
>
> read more »

john

unread,
May 12, 2011, 6:32:48 AM5/12/11
to iROD-Chat
OK:)

On May 12, 11:34 am, Jérôme Fuselier <jerome.fusel...@gmail.com>
> ...
>
> read more »

john

unread,
May 13, 2011, 7:15:32 AM5/13/11
to iROD-Chat
How to do this for MS Windows?
> ...
>
> les mer »

Jérôme Fuselier

unread,
May 13, 2011, 8:01:45 AM5/13/11
to iROD-Chat
I didn't plan to support MS Windows and I don't have a working
environment to evaluate how hard it would be.

It may be possible to use a subset of the actual code to create a
wrapper for the MS Windows icommands but I don't know if you can have
access to the source code.


Jerome
> ...
>
> read more »

Gabriele Giammatteo

unread,
May 18, 2011, 6:20:36 AM5/18/11
to iROD-Chat
Hi,
I was experiencing the same problem, and thanks to your hints I
managed to solve it!

Actually I didn't changed the setup.py to point from libodbc.a to
libodbc.so, but I managed to solve this error:
ules/properties/microservices/obj/propertiesMS.o -L/usr/lib64 -
lpython2.7 -o build/lib.linux-x86_64-2.7/irods.so
/usr/bin/ld: /home/floan/irods/postgres/pgsql/lib/
libodbc.a(SQLAllocHandle.o): relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a shared object;
recompile with -fPIC
/home/floan/irods/postgres/pgsql/lib/libodbc.a: could not read
symbols: Bad value

exporting the CFLAGS variable (and not only the CCFLAGS) as you
suggested.


So, concluding, before issue irrodssetup:
export CFLAGS=-fPIC
export CCFLAGS=-fPIC (actually for this one, I set it in config/
irods.confg instead of exporting from the shell)

...and everything should be built for 64-bit platforms (also the odbc
drivers)

Hope it helps,

Gabriele
> > > > > > > > srvRodsAPIs.a(rsCloseCollection.o):relocationR_X86_64_32S against
> > > > > > > > > > > > > > > libodbc.a(SQLAllocHandle.o):relocationR_X86_64_32 against
> > > > > > > > > > > > > > > > > libodbc.a(SQLAllocHandle.o):relocationR_X86_64_32 against
> > > > > > > > > > > > > > > > > `.rodata.str1.8' can not be used when making a shared object;
> > > > > > > > > > > > > > > > > recompile with -fPIC
> > > > > > > > > > > > > > > > > /home/floan/irods/postgres/pgsql/lib/libodbc.a: could not read
> > > > > > > > > > > > > > > > > symbols: Bad value
>
> > > > > > > > > > > > > > > > > (This laptop is a fedora 12 and with 64 bits option).
>
> > > > > > > > > > > > > > > > > On May 6, 8:57 pm, Wilko Kroeger<wi...@slac.stanford.edu>  wrote:
> > > > > > > > > > > > > > > > >> Hello John and Adil
>
> > > > > > > > > > > > > > > > >> I guess irods was compiled on an amd64 (x86-64) platform and on this
> > > > > > > > > > > > > > > > >> platform object files have to be compiled with -fPIC if they will be
> > > > > > > > > > > > > > > > >> included into a shared library. PyRods builds a shared library and links
> > > > > > > > > > > > > > > > >> with the irods object files which were compiled without the -fPIC option
> > > > > > > > > > > > > > > > >> and therefore it fails.
>
> > > > > > > > > > > > > > > > >> You could set CCFLAGS and then recompile irods and build PyRods
>
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages