phonopy/setup3.py

101 lines
3.6 KiB
Python
Raw Normal View History

2012-12-11 16:19:23 +08:00
from distutils.core import setup, Extension
import numpy
2015-04-03 23:44:27 +08:00
from setup import extension_spglib, extension_phonopy, packages_phonopy, scripts_phonopy
2012-12-11 16:19:23 +08:00
include_dirs_numpy = [numpy.get_include()]
sources = ['c/_phono3py.c',
'c/harmonic/dynmat.c',
'c/harmonic/lapack_wrapper.c',
'c/harmonic/phonoc_array.c',
'c/harmonic/phonoc_utils.c',
'c/anharmonic/phonon3/fc3.c',
'c/anharmonic/phonon3/frequency_shift.c',
'c/anharmonic/phonon3/interaction.c',
'c/anharmonic/phonon3/real_to_reciprocal.c',
'c/anharmonic/phonon3/reciprocal_to_normal.c',
'c/anharmonic/phonon3/imag_self_energy.c',
'c/anharmonic/phonon3/imag_self_energy_with_g.c',
'c/anharmonic/phonon3/collision_matrix.c',
'c/anharmonic/other/isotope.c',
'c/anharmonic/triplet/triplet.c',
'c/anharmonic/triplet/triplet_kpoint.c',
'c/spglib/mathfunc.c',
2015-08-02 11:48:12 +08:00
'c/spglib/kpoint.c',
'c/kspclib/kgrid.c',
'c/kspclib/tetrahedron_method.c']
extra_link_args = ['-lgomp',
'-llapacke', # this is when lapacke is installed on system
'-llapack',
'-lblas']
extra_compile_args = ['-fopenmp',]
include_dirs = (['c/harmonic_h',
'c/anharmonic_h',
2015-08-02 11:48:12 +08:00
'c/spglib_h',
'c/kspclib_h'] +
2015-01-07 11:30:09 +08:00
include_dirs_numpy)
2015-10-03 21:20:00 +08:00
define_macros = []
##
2015-04-03 23:44:27 +08:00
## Uncomment and modify below if lapacke is prepared in a special location
2015-08-02 11:48:12 +08:00
#
2015-04-03 23:44:27 +08:00
# include_dirs += ['../lapack-3.5.0/lapacke/include']
# extra_link_args = ['-lgomp', '../lapack-3.5.0/liblapacke.a']
## Uncomment below to measure reciprocal_to_normal_squared_openmp performance
# define_macros = [('MEASURE_R2N', None)]
2015-04-03 23:44:27 +08:00
##
## This is for the test of libflame
##
# use_libflame = False
# if use_libflame:
# sources.append('c/anharmonic/flame_wrapper.c')
# extra_link_args.append('../libflame-bin/lib/libflame.a')
# include_dirs_libflame = ['../libflame-bin/include']
# include_dirs += include_dirs_libflame
2015-04-03 23:44:27 +08:00
extension_phono3py = Extension(
'anharmonic._phono3py',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
sources=sources)
2015-04-03 23:44:27 +08:00
packages_phono3py = ['anharmonic',
'anharmonic.other',
'anharmonic.phonon3']
scripts_phono3py = ['scripts/phono3py',
'scripts/kaccum',
'scripts/gaccum']
2015-04-03 23:44:27 +08:00
########################
# _lapackepy extension #
########################
include_dirs_lapackepy = ['c/harmonic_h',] + include_dirs_numpy
sources_lapackepy = ['c/_lapackepy.c',
2015-08-04 23:27:45 +08:00
'c/harmonic/dynmat.c',
2015-08-05 16:39:56 +08:00
'c/harmonic/phonon.c',
'c/harmonic/phonoc_array.c',
'c/harmonic/phonoc_utils.c',
'c/harmonic/lapack_wrapper.c']
extension_lapackepy = Extension(
'phonopy._lapackepy',
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
include_dirs=include_dirs,
sources=sources_lapackepy)
2013-02-05 15:14:07 +08:00
setup(name='phono3py',
2015-10-10 09:23:40 +08:00
version='0.9.14',
2013-02-05 15:14:07 +08:00
description='This is the phono3py module.',
author='Atsushi Togo',
author_email='atz.togo@gmail.com',
url='http://phonopy.sourceforge.net/',
2015-04-03 23:44:27 +08:00
packages=(packages_phonopy + packages_phono3py),
scripts=(scripts_phonopy + scripts_phono3py),
ext_modules=[extension_spglib,
extension_lapackepy,
extension_phonopy,
extension_phono3py])