Re: [AMBER] compile errors with AmberTools1.5 + Amber11

From: Robert Wohlhueter <bobwohlhueter.earthlink.net>
Date: Sun, 01 May 2011 21:46:14 -0400

Jason,
You tip-off that python3 uses unicode natively, but python2 doesn't sent
me down the right path. In fact, my Ubuntu machine has python2.5, 2.6,
and 3.1 installed. The executable (in path /usr/bin) is 2.6.5, but I
had a PYTHONHOME set which included a colon-separated list of all the
python libs (with 3.1 at the tail end). When I start interactive python
with the -vv flag, it wants to use the 3.1 libs, and lots of things
break. When I start with -E (ignore environment vars), everything comes
right!

So removing the unsetting the envvar (and removing it from my .cshrc)
solved my problems; I configure with the "-nopythone" flag;
AT15_Amber11.py runs without complaint; and I have a working build of
amber11+AT1.5.

The gory details are pasted below.

Thanks for your patient help.

Bob W.

******************my installation has three sets of python
libs*******************

bobw.winter-linux: ~ (1%)> find /usr -name os.py\* -print
find /usr -name os.py* -print
/usr/lib/python2.6/os.pyo
/usr/lib/python2.6/os.pyc
/usr/lib/python2.6/os.py
/usr/lib/python2.5/os.pyc
/usr/lib/python2.5/os.py
/usr/lib/python3.1/os.pyc
/usr/lib/python3.1/os.py
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/os.pyc
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/os.py
/usr/local/lib/chimera/lib/python2.5/os.pyc
/usr/local/lib/chimera/lib/python2.5/os.py
bobw.winter-linux: ~ (2%)> find /usr -name site.py\* -print
find /usr -name site.py* -print
/usr/lib/python2.6/site.pyc
/usr/lib/python2.6/site.py
/usr/lib/python2.6/site.pyo
/usr/lib/python2.5/site.pyc
/usr/lib/python2.5/site.py
/usr/lib/python2.5/site.py.orig
/usr/lib/python3.1/site.pyc
/usr/lib/python3.1/site.py
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/site.pyc
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/site.py
/usr/local/lib/modeller9.9/bin/lib/python2.3/site.py
/usr/local/lib/apbs/apbs-1.2.1-amd64/lib/python2.5/site-packages/site.pyc
/usr/local/lib/apbs/apbs-1.2.1-amd64/lib/python2.5/site-packages/site.py
/usr/local/lib/chimera/lib/python2.5/site.pyc
/usr/local/lib/chimera/lib/python2.5/site.py
bobw.winter-linux: ~ (3%)>

bobw.winter-linux: ~ (1%)> find /usr -name os.py\* -print
find /usr -name os.py* -print
/usr/lib/python2.6/os.pyo
/usr/lib/python2.6/os.pyc
/usr/lib/python2.6/os.py
/usr/lib/python2.5/os.pyc
/usr/lib/python2.5/os.py
/usr/lib/python3.1/os.pyc
/usr/lib/python3.1/os.py
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/os.pyc
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/os.py
/usr/local/lib/chimera/lib/python2.5/os.pyc
/usr/local/lib/chimera/lib/python2.5/os.py
bobw.winter-linux: ~ (2%)> find /usr -name site.py\* -print
find /usr -name site.py* -print
/usr/lib/python2.6/site.pyc
/usr/lib/python2.6/site.py
/usr/lib/python2.6/site.pyo
/usr/lib/python2.5/site.pyc
/usr/lib/python2.5/site.py
/usr/lib/python2.5/site.py.orig
/usr/lib/python3.1/site.pyc
/usr/lib/python3.1/site.py
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/site.pyc
/usr/local/lib/autodock/MGLTools-1.5.4/lib/python2.5/site.py
/usr/local/lib/modeller9.9/bin/lib/python2.3/site.py
/usr/local/lib/apbs/apbs-1.2.1-amd64/lib/python2.5/site-packages/site.pyc
/usr/local/lib/apbs/apbs-1.2.1-amd64/lib/python2.5/site-packages/site.py
/usr/local/lib/chimera/lib/python2.5/site.pyc
/usr/local/lib/chimera/lib/python2.5/site.py
bobw.winter-linux: ~ (3%)>

*****************set in .cshrc**********************************************
setenv PYTHONHOME
/usr/lib/python2.6:/usr/lib/python3.1:/usr/local/lib/modeller9.9/modlib:/usr/local/lib/modeller9.9/modlib/modeller

***************with this PYTHONHOME set, interactive python is broken******
bobw.winter-linux: ~ (3%)> python -vv
python -vv
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# trying /usr/lib/python3.1/site.so
# trying /usr/lib/python3.1/sitemodule.so
# trying /usr/lib/python3.1/site.py
# /usr/lib/python3.1/site.pyc has bad magic
import site # from /usr/lib/python3.1/site.py
# can't create /usr/lib/python3.1/site.pyc
# trying /usr/lib/python3.1/os.so
# trying /usr/lib/python3.1/osmodule.so
# trying /usr/lib/python3.1/os.py
# /usr/lib/python3.1/os.pyc has bad magic
import os # from /usr/lib/python3.1/os.py
# can't create /usr/lib/python3.1/os.pyc
import errno # builtin
import posix # builtin
# trying /usr/lib/python3.1/posixpath.so
# trying /usr/lib/python3.1/posixpathmodule.so
# trying /usr/lib/python3.1/posixpath.py
# /usr/lib/python3.1/posixpath.pyc has bad magic
import posixpath # from /usr/lib/python3.1/posixpath.py
# can't create /usr/lib/python3.1/posixpath.pyc
# trying /usr/lib/python3.1/stat.so
# trying /usr/lib/python3.1/statmodule.so
# trying /usr/lib/python3.1/stat.py
# /usr/lib/python3.1/stat.pyc has bad magic

....etc

***************but the the -E flag to ignore any env. vars, it loads the
right modules***********
bobw.winter-linux: ~ (3%)> python -E -vv
python -E -vv
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# trying /usr/lib/python2.6/site.so
# trying /usr/lib/python2.6/sitemodule.so
# trying /usr/lib/python2.6/site.py
# /usr/lib/python2.6/site.pyc matches /usr/lib/python2.6/site.py
import site # precompiled from /usr/lib/python2.6/site.pyc
# trying /usr/lib/python2.6/os.so
# trying /usr/lib/python2.6/osmodule.so
# trying /usr/lib/python2.6/os.py
# /usr/lib/python2.6/os.pyc matches /usr/lib/python2.6/os.py
import os # precompiled from /usr/lib/python2.6/os.pyc

...

>>> import os
>>> dir(os)
['EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST',
'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR',
'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL',
'EX_UNAVAILABLE', 'EX_USAGE', 'F_OK', 'NGROUPS_MAX', 'O_APPEND',
'O_ASYNC', 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL',
'O_LARGEFILE', 'O_NDELAY', 'O_NOATIME', 'O_NOCTTY', 'O_NOFOLLOW',
'O_NONBLOCK', 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TRUNC',
'O_WRONLY', 'P_NOWAIT', 'P_NOWAITO', 'P_WAIT', 'R_OK', 'SEEK_CUR',
'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'UserDict', 'WCONTINUED',
'WCOREDUMP', 'WEXITSTATUS', 'WIFCONTINUED', 'WIFEXITED', 'WIFSIGNALED',
'WIFSTOPPED', 'WNOHANG', 'WSTOPSIG', 'WTERMSIG', 'WUNTRACED', 'W_OK',
'X_OK', '_Environ', '__all__', '__builtins__', '__doc__', '__file__',
'__name__', '__package__', '_copy_reg', '_execvpe', '_exists', '_exit',
'_get_exports_list', '_make_stat_result', '_make_statvfs_result',
'_pickle_stat_result', '_pickle_statvfs_result', '_spawnvef', 'abort',
'access', 'altsep', 'chdir', 'chmod', 'chown', 'chroot', 'close',
'closerange', 'confstr', 'confstr_names', 'ctermid', 'curdir',
'defpath', 'devnull', 'dup', 'dup2', 'environ', 'errno', 'error',
'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp',
'execvpe', 'extsep', 'fchdir', 'fchmod', 'fchown', 'fdatasync',
'fdopen', 'fork', 'forkpty', 'fpathconf', 'fstat', 'fstatvfs', 'fsync',
'ftruncate', 'getcwd', 'getcwdu', 'getegid', 'getenv', 'geteuid',
'getgid', 'getgroups', 'getloadavg', 'getlogin', 'getpgid', 'getpgrp',
'getpid', 'getppid', 'getsid', 'getuid', 'isatty', 'kill', 'killpg',
'lchown', 'linesep', 'link', 'listdir', 'lseek', 'lstat', 'major',
'makedev', 'makedirs', 'minor', 'mkdir', 'mkfifo', 'mknod', 'name',
'nice', 'open', 'openpty', 'pardir', 'path', 'pathconf',
'pathconf_names', 'pathsep', 'pipe', 'popen', 'popen2', 'popen3',
'popen4', 'putenv', 'read', 'readlink', 'remove', 'removedirs',
'rename', 'renames', 'rmdir', 'sep', 'setegid', 'seteuid', 'setgid',
'setgroups', 'setpgid', 'setpgrp', 'setregid', 'setreuid', 'setsid',
'setuid', 'spawnl', 'spawnle', 'spawnlp', 'spawnlpe', 'spawnv',
'spawnve', 'spawnvp', 'spawnvpe', 'stat', 'stat_float_times',
'stat_result', 'statvfs', 'statvfs_result', 'strerror', 'symlink',
'sys', 'sysconf', 'sysconf_names', 'system', 'tcgetpgrp', 'tcsetpgrp',
'tempnam', 'times', 'tmpfile', 'tmpnam', 'ttyname', 'umask', 'uname',
'unlink', 'unsetenv', 'urandom', 'utime', 'wait', 'wait3', 'wait4',
'waitpid', 'walk', 'write']


...


>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__',
'__package__', '__stderr__', '__stdin__', '__stdout__',
'_clear_type_cache', '_current_frames', '_getframe', 'api_version',
'argv', 'builtin_module_names', 'byteorder', 'call_tracing',
'callstats', 'copyright', 'displayhook', 'dont_write_bytecode',
'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix',
'executable', 'exit', 'flags', 'float_info', 'getcheckinterval',
'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding',
'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof',
'gettrace', 'hexversion', 'last_type', 'last_value', 'maxint',
'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks',
'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2',
'py3kwarning', 'pydebug', 'setcheckinterval', 'setdlopenflags',
'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin',
'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
>>> import site
>>> dir(site)
['ENABLE_USER_SITE', 'PREFIXES', 'USER_BASE', 'USER_SITE', '_Helper',
'_Printer', '__builtin__', '__builtins__', '__doc__', '__file__',
'__name__', '__package__', '_init_pathinfo', '_script', 'abs__file__',
'addpackage', 'addsitedir', 'addsitepackages', 'addusersitepackages',
'aliasmbcs', 'check_enableusersite', 'execsitecustomize',
'execusercustomize', 'main', 'makepath', 'os', 'removeduppaths',
'setBEGINLIBPATH', 'setcopyright', 'setencoding', 'sethelper',
'setquit', 'sys']
>>>





On 5/1/11 6:45 AM, Jason Swails wrote:
> Hi Bob,
>
> On Sun, May 1, 2011 at 2:04 AM, Robert Wohlhueter<
> bobwohlhueter.earthlink.net> wrote:
>
>> Jason,
>>
>> A couple of comments on your comments: By "clean slate" I mean really
>> clean, i.e. removing the $AMBERHOME dir entirely, re-extracting tars,
>> re-patching, re-configuring. And I have AMBERHOME defined in root's
>> .cshrc. (Nor does it make any difference if I `chown` of AMBERHOME to
>> non-root, and build as a non-root user. So these aren't issues.
>>
> OK.
>
>
>> I can't expect you to fix my Ubuntu installation of Python; it's a
>> standard installation via the Synaptic Package Manager, and I don't see
>> anything wrong with it: 2.5, 2.6, and 3.1 are all installed under
>> /usr/lib; all of these contain a "os.py", none contain a "sys.py",
>>
> sys is a built-in module, so there is no sys.py. Try firing up an
> interactive session and running
>
> import sys
> help(sys)
>
> That should describe the module.
>
>
>> specifying absolute path to 2.6 either via PYTHONHOME or hard-wiring in
>> AT15_Amber11.py doesn't free me from the "import site" failed message.
>>
> Is there no site.py? This should actually be imported automatically for any
> python version on any major OS, so this is a disturbing error... "import
> site" works just fine for me for the python2.4, 2.5, 2.6, 2.7, and 3.2
> installations.
>
>
>> One rock left unturned is the python syntax errors which I get when
>> omitting the "-nopython" flag while configuring. These errors prevent me
>> from configuring without the "-nopython" flag, and thus force me to rely
>> on my (broken?) Unbuntu Python installations. These errors all have to
>> do with use of \n for "newline" in the python code. [SyntaxError:
>> ("(unicode error) \\N escapes not supported (can't load> unicodedata
>> module)"]). My search of the internet seems to confirm this, and says
>> that the proper "newline" character for python using unicode is
>> "u2424". Is it not possible/preferable for amber to patch its python
>> code to reflect this?
>>
> But for python2.x, unicode is not the default string type (but I think it is
> for python3.x). All of the python code written in amber is for python2.x,
> and can't be expected to work for python3.x (perhaps the 2to3 utility is
> enough to fix this) -- which is your default version?
>
> Moreover, I've built AmberTools 1.5 successfully on both Ubuntu 9.10 and
> 10.10 (I haven't tried 10.04, but I'm guessing that works just fine) using
> both the intel and gnu compilers. This leads me to wonder what's different
> about your OS installation that's preventing it from working.
>
> All the best,
> Jason
>
>
>> Bob W.
>>
>>
>>
>> On 4/29/11 3:52 PM, Jason Swails wrote:
>>> On Fri, Apr 29, 2011 at 4:06 PM, Robert Wohlhueter<
>>> bobwohlhueter.earthlink.net> wrote:
>>>
>>>> Hi Jason,
>>>> Well, configuring (a clean slate) with -nopython flag circumvented the
>>>> weird python errors, but brought me other troubles (see below):
>>>> apparently my local python installation is not up to snuff. On a long
>>>> shot, I tried the `AT15_Amber11.py` script again anyway, but got the
>>>> same errors as previously (can't import "site", "os").
>>>>
>>>> Not to muddy the waters, but I also tried a clean build with the latest
>>>> (half an hour ago) bugfix.all for AT 1.5. You might be interested that
>>>> it gives a "malformed patch" error (see below), but didn't affect my
>>>> python problem.
>>>>
>>>> Bob Wohlhueter
>>>>
>>>> *****************************************************************
>>>> cpp -traditional -P -DBINTRAJ lapack.f> _lapack.f
>>>> gfortran -c -O0 -o lapack.o _lapack.f
>>>> cpp -traditional -P -DBINTRAJ resp.f> _resp.f
>>>> gfortran -c -O0 -o resp.o _resp.f
>>>> gfortran \
>>>> lapack.o resp.o -o resp
>>>> gfortran -o calcpka calcpka.f90
>>>> ./py_setup.sh
>>>> Using system python
>>>> Error importing cpinutil.py python modules! cpinutil will not work.
>>>> make[1]: *** [python] Error 1
>>>> make[1]: Leaving directory `/usr/local/lib/amber11/AmberTools/src/etc'
>>>> make: *** [serial] Error 2
>>>>
>>>>
>>>> root.winter-linux: ...lib/amber11 (25%)# ./AT15_Amber11.py
>>>>
>>> Ooh, I would not do this as root. In several places, I think, the Amber
>>> install references files in $AMBERHOME/bin. If AMBERHOME is blank, this
>>> will just be parsed as /bin/, which is one of the last places you want to
>>> mess around in (especially if it's *not* your scripts, so you don't know
>>> what it's doing).
>>>
>>> ./AT15_Amber11.py
>>> 'import site' failed; use -v for traceback
>>>> Traceback (most recent call last):
>>>> File "./AT15_Amber11.py", line 8, in<module>
>>>> import os, sys
>>>> ImportError: No module named os
>>>>
>>> Not good... Either you didn't start from a clean tree and it's still
>> trying
>>> to use the broken python from $AMBERHOME/bin, or your system python is
>>> busted (very not good). The first means just get rid of the whole
>>> AmberTools 1.5 directory and start over. If it's the second one, and
>> you're
>>> using Ubuntu, then something is seriously wrong (I use Ubuntu all the
>> time
>>> and have never seen this...).
>>>
>>>
>>>> ****************bugfix.all patch
>>>> error*************************************************
>>>> patching file AmberTools/src/cpptraj/src/AmberNetcdf.cpp
>>>> patching file AmberTools/src/mmpbsa_py/MMPBSA_mods/alamdcrd.py
>>>> patching file AmberTools/src/mmpbsa_py/setup.sh
>>>> patch: **** malformed patch at line 3176: Workarounds: none
>>>>
>>> I don't know why this is happening, but I can reproduce it. If you just
>>> delete the last 2 lines it goes away... but not sure what'll happen when
>> we
>>> add another patch.
>>>
>>> HTH,
>>> Jason
>>>
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
>
>


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Sun May 01 2011 - 19:00:04 PDT
Custom Search