Hey guys,

I'm trying to install my own version of python on an HPC without root access so I can use my own packages. So far I am banging my head against the wall and getting nowhere. I actually had my own version of python, numpy, ipython and a couple other packages from source (although numpy wasn't optimized with Lapack or Atlas). I needed h5py, so I got szip and hdf5 from source and installed them and got them up and going. H5py was still complaining and I couldn't find any .so libraries it was looking for (I think I needed to download the development hdf5 and maybe I didn't, still confused about this one). Well, I tried to start over from scratch. Now I'm not even able to install python-2.7 from source.
I run "./configure --prefix=/u/myusername/local" and then "make install" and I get this error:

/opt/cray/xt-asyncpe/4.5/bin/cc  -Xlinker -export-dynamic -o python \
            Modules/python.o \
            libpython2.7.a -lresolv -ldl  -lutil   -lm  
pgcc-Error-Unknown switch: -Xlinker
pgcc-Error-Unknown switch: -export-dynamic
make: *** [python] Error 1

If I do an "export CC=/usr/bin/gcc" and then repeat the last two steps I get this error:

/usr/bin/gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes   Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Objects/obmalloc.o Python/mysnprintf.o Python/pyctype.o Parser/tokenizer_pgen.o Parser/printgrammar.o Parser/pgenmain.o -lpthread -ldl  -lutil -o Parser/pgen
Parser/tokenizer_pgen.o: In function `.st7206':
tokenizer_pgen.c:(.data+0x308): undefined reference to `__pgdbg_stub'
Parser/printgrammar.o:(.data+0x0): undefined reference to `__pgdbg_stub'
Parser/pgenmain.o:(.data+0x0): undefined reference to `__pgdbg_stub'
collect2: ld returned 1 exit status
make: *** [Parser/pgen] Error 1

NOTE: If I do an "export CC=/usr/bin/cc" and use this cc instead I get the same error that I do with gcc.

So, in a nutshell I'm completely frustrated and lost... google hasn't been able to help me out. I know I'm asking a lot of questions but if anyone could help I'd be eternally grateful.

Thanks in advance and for your time.

Recommended Answers

All 7 Replies

Are you sure that it has not Python allready, it would be very rare beast indeed to have Linux and not Python. Nothing happens when you try to execute python? Could you not just uncompress binary distribution for Linux to your user directionary. Often ~/bin is included in path so you can softlink the executables there and set environment variables in your .profile or .bashrc

It has its own version of Python on it (Python-2.6), but it doesn't have any modules except for the ones that come with it. I want to be able to add all of the modules I talked about in my post to it, so I wanted to create my own local version of it. I had already compiled it once, so I have NO idea why it won't let me do it again. It is really driving me crazy!
So staticpython is an already compiled python binary for linux? Or am I misunderstanding it? I will probably be using iPython 95% of the time once I get python anyways, but I really want to be able to compile it. Thanks for your reply. Any ideas why it wouldn't be compiling for me?

Reading a bit about static python, it isn't a solution to my problem. I need to be able to add a bunch of different packages. So I really need to be able to install my own version of python.

Why can you add modules to your PYTHONPATH or PATH, what python 2.6 is missing that you need to compile other version. It is difficult to have idea of reason exactly, you did configure and set the installation path, looks proper to me. I am also compiling newer version of Python for my cygwin (it also have only 2.6 in repository) as maybe have something to relate to your version. I ones compiled Python in home directorionary in server and I now remember it went very smoothly: only using proper she bang line in scripts and I got even web script to use it for CGI instead of system version.

Maybe you could try something like

make mrproper && make

I do not know what make install target they have for thorough cleaning, mrproper is one used for Linux kernel and similar linux stuff.

No mrproper... I did do a "make clean" to get rid of the old stuff, but to no avail. Does anyone have any clue what is stopping my installation? It must be something that is being left behind because I had it previously installed. I just can't figure out what it is. Thanks for your help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.