File: Python

package info (click to toggle)
mpqc3 0.0~git20170114-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 148,788 kB
  • ctags: 40,140
  • sloc: cpp: 545,687; ansic: 13,220; perl: 5,065; fortran: 1,990; lisp: 1,269; python: 717; yacc: 392; sh: 304; f90: 238; lex: 184; xml: 182; makefile: 106
file content (46 lines) | stat: -rw-r--r-- 1,768 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- mode: cmake -*-

if (PYTHON)

  find_package(PythonInterp)
  if (PYTHONINTERP_FOUND)
    # seek the same version of python
    set(PYTHONINTERP_VERSION_STRING ${PYTHON_VERSION_STRING})
    set(Python_ADDITIONAL_VERSIONS ${PYTHONINTERP_VERSION_STRING})
    find_package(PythonLibs)
    
    # if versions of libraries and interpreter match, show can go on
    if (PYTHONLIBS_VERSION_STRING STREQUAL PYTHONINTERP_VERSION_STRING)
    
      set(HAVE_PYTHON TRUE)
      message(STATUS "Found Python:")
      message(STATUS "\tPython interpreter: ${PYTHON_EXECUTABLE} (version ${PYTHON_VERSION_STRING})")
      
      include(find_python_module)
      ####
      find_python_module(numpy REQUIRED)
      if (PY_NUMPY)
        set (HAVE_PYTHON_NUMPY TRUE)
        message(STATUS "\tHave numpy package at ${PY_NUMPY}")
      endif(PY_NUMPY)
      ####
      find_python_module(ase)
      if (PY_ASE)
        message(STATUS "\tHave ase package at ${PY_ASE}")
      else()
        message(STATUS "\tDid not find ase package; download from wiki.fysik.dtu.dk/ase if you want to use pympqc.ase_mpqc")
      endif(PY_ASE)
    else()
      message(WARNING 
        "** Could not find matching PYTHON interpreter and libraries
** Python interpreter version ${PYTHONINTERP_VERSION_STRING} was found, but Python libraries version ${PYTHONLIBS_VERSION_STRING} was found
** Make sure to set CMAKE variable PYTHON_EXECUTABLE to the \"correct\" interpreter
** You may also need to make the \"correct\" PYTHON interpreter appear first in PATH"
      )
      if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
        message(WARNING "** N.B. With MacPorts you may need to \"port select\", e.g.: port select python python27-apple")
      endif()
    endif()
  endif(PYTHONINTERP_FOUND)
  
endif()