Compilation problem with Cygwin

132 views
Skip to first unread message

brhr

unread,
Dec 26, 2015, 5:16:44 PM12/26/15
to cp2k
Hello CP2K depeloppers and users.

I show respect for the new CP2K release.

I tried to compile CP2K-3 on my Windows 10 laptop PC
in accordance with "How to Compile and Install CP2K on Windows with Cygwin"
(https://www.cp2k.org/howto:compile_on_windows_with_cygwin)

but failed with the following message:

   cp2k-3.0/tools/build_utils/makedep.py  in collect_include_deps

    RuntimeError: maximum recursion depth exceeded while calling a Python object

sys.setrecursionlimit(10000) on the top of makedep.py did not solve the problem.
A limit value more than 10000 caused segmentation fault on my system.

So then I rewrote the collect_include_deps and collect_use_depth functions in makedep.py
 into some others without recursion:

#=============================================================================
def collect_include_deps(parsed_files, fn):
#    pf = parsed_files[fn]
#    incs = []

#    for i in pf['include']:
#        fn_inc = normpath(path.join(dirname(fn), i))
#        if(parsed_files.has_key(fn_inc)):
#            incs.append(fn_inc)
#            incs += collect_include_deps(parsed_files, fn_inc)

 #   return(list(set(incs)))
 
    pf = parsed_files[fn]
    incs = []

    for i in pf['include']:
        fn_inc = normpath(path.join(dirname(fn), i))
        if(parsed_files.has_key(fn_inc)):
            incs.append(fn_inc)
            incs += list(set(incs))

    return(list(set(incs)))


#=============================================================================
def collect_use_deps(parsed_files, fn):
#    pf = parsed_files[fn]
#    uses = pf['use']

#    for i in pf['include']:
#        fn_inc = normpath(path.join(dirname(fn), i))
#        if(parsed_files.has_key(fn_inc)):
#           uses += collect_use_deps(parsed_files, fn_inc)

 #   return(list(set(uses)))
 
    pf = parsed_files[fn]
    uses = pf['use']

    for i in pf['include']:
        fn_inc = normpath(path.join(dirname(fn), i))
        if(parsed_files.has_key(fn_inc)):
           uses += list(set(uses))

    return(list(set(uses)))


#=============================================================================


I have no experience of python, I 'm not sure whether the rewritten codes are equivalent to the original codes.

Any way the python error did not happen after the rewite, another error came to happen.

   Can't open module file "***.mod".

It seemed to that the automatic dependency generator did not work although all.dep had been generated in
 obj/local/.

Any help would be greatly appreciated.

brhr

Agilio Padua

unread,
Jan 6, 2016, 10:51:56 AM1/6/16
to cp...@googlegroups.com

Same error on Mac OS X v10.11.2

  ...

  File "/Users/apadua/sw/cp2k-3.0/tools/build_utils/makedep.py", line 233, in collect_include_deps

    incs += collect_include_deps(parsed_files, fn_inc)

  File "/Users/apadua/sw/cp2k-3.0/tools/build_utils/makedep.py", line 230, in collect_include_deps

    fn_inc = normpath(path.join(dirname(fn), i))

  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 332, in normpath

    slash, dot = (u'/', u'.') if isinstance(path, _unicode) else ('/', '.')

  RuntimeError: maximum recursion depth exceeded while calling a Python object


though cp2k 2.6.2 compiles perfectly with the same makedep.py


Agilio


brhr

unread,
Jan 8, 2016, 9:56:07 PM1/8/16
to cp...@googlegroups.com
 
Hello
 
Cp2k-3.0 was successfully compiled with Cygwin after renaming src/dbcsr/mm/libxsmm.F to libxsmm_wrap.F
as suggested in an another post.

       Thank you! 

  
Reply all
Reply to author
Forward
0 new messages