Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65974992
setup-r2.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 7, 11:12
Size
4 KB
Mime Type
text/x-python
Expires
Sun, Jun 9, 11:12 (2 d)
Engine
blob
Format
Raw Data
Handle
18153732
Attached To
rGEAR Gear
setup-r2.py
View Options
#!/usr/bin/env python
import
os
,
sys
from
distutils.core
import
setup
,
Extension
from
distutils.sysconfig
import
get_python_inc
from
distutils.sysconfig
import
get_python_lib
import
glob
import
numpy
'''
In order to compile with mpi,
export CC=mpicc
python setup.py build
'''
gadget_files
=
glob
.
glob
(
"src/*.c"
)
INCLUDES
=
[
"src/"
]
INCLUDES
.
append
(
numpy
.
get_include
())
INCLUDES
.
append
(
numpy
.
get_numarray_include
())
INCLUDES
.
append
(
os
.
path
.
join
(
numpy
.
get_numarray_include
(),
'numpy'
))
MPI_DIR
=
"/dios/shared/apps/openmpi/gcc/1.6/lib/"
MPI_LIB
=
"mpi"
INCLUDES
.
append
(
"/dios/shared/apps/openmpi/gcc/1.6/include/"
)
H5_LIB
=
"hdf5"
setup
(
name
=
'PyCool'
,
version
=
'0.0'
,
description
=
'Python Cooling code base wrapped around GEAR'
,
author
=
'Yves Revaz'
,
author_email
=
'yves.revaz@epfl.ch'
,
url
=
'http://obswww.unige.ch/~revaz/pNbody'
,
packages
=
[
'PyCool'
],
# ext_modules=[
# Extension('PyGear.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('NOGRAVITY', '1'),('LONG_X', '1'),('LONG_Y', '1'),('LONG_Z', '0.125')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
# ]
# ext_modules=[
# Extension('PyGear.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
# ]
# This is used for turb
# ext_modules=[
# Extension('PyChem.gadget', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('NOGRAVITY', '1'),('ISOTHERM_EQS', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] )
# ]
# This is used for normal cooling (cooling_with_metals)
# ext_modules=[
# Extension('PyCool.cooling', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('CHIMIE', '1'),('COOLING', '1'),('STELLAR_PROP', '1'),('ENTROPYPRED', '1'), ('PYCOOL', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB] ),
# Extension('PyCool.compute_lambda_interface', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('CHIMIE', '1'),('COOLING', '1'),('STELLAR_PROP', '1'),('ENTROPYPRED', '1'), ('PYCOOL', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB,H5_LIB] ),
# ]
# This is used for depraz cooling
ext_modules
=
[
Extension
(
'PyCool.cooling'
,
gadget_files
,
include_dirs
=
INCLUDES
,
define_macros
=
[(
'PY_INTERFACE'
,
'1'
),(
'UNEQUALSOFTENINGS'
,
'1'
)
,(
'PERIODIC'
,
'1'
),(
'PEANOHILBERT'
,
'1'
),(
'CHIMIE'
,
'1'
),(
'COOLING'
,
'1'
),(
'COOLING_FCT_FROM_HDF5'
,
'1'
),(
'STELLAR_PROP'
,
'1'
),(
'ENTROPYPRED'
,
'1'
),
(
'PYCOOL'
,
'1'
),(
'ONLY_MASTER_READ_EWALD'
,
'1'
)]
,
library_dirs
=
[
MPI_DIR
],
libraries
=
[
'gsl'
,
'gslcblas'
,
'm'
,
MPI_LIB
,
H5_LIB
]
),
Extension
(
'PyCool.compute_lambda_interface'
,
gadget_files
,
include_dirs
=
INCLUDES
,
define_macros
=
[(
'PY_INTERFACE'
,
'1'
),(
'UNEQUALSOFTENINGS'
,
'1'
)
,(
'PERIODIC'
,
'1'
),(
'PEANOHILBERT'
,
'1'
),(
'CHIMIE'
,
'1'
),(
'COOLING'
,
'1'
),(
'COOLING_FCT_FROM_HDF5'
,
'1'
),(
'STELLAR_PROP'
,
'1'
),(
'ENTROPYPRED'
,
'1'
),
(
'PYCOOL'
,
'1'
),(
'ONLY_MASTER_READ_EWALD'
,
'1'
)]
,
library_dirs
=
[
MPI_DIR
],
libraries
=
[
'gsl'
,
'gslcblas'
,
'm'
,
MPI_LIB
,
H5_LIB
]
),
]
)
# This is used for cooling_heating
'''
ext_modules=[
Extension('PyCool.cooling', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('CHIMIE', '1'),('COOLING', '1'),('COOLING_HEATING', '1'),('STELLAR_PROP', '1'),('ENTROPYPRED', '1'), ('PYCOOL', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB,H5_LIB] ),
Extension('PyCool.cooling_heating', gadget_files,include_dirs=[MPI_INC,"src/",PYTHON_INC],define_macros=[('PY_INTERFACE', '1'),('UNEQUALSOFTENINGS', '1') ,('PERIODIC', '1'),('PEANOHILBERT', '1'),('CHIMIE', '1'),('COOLING', '1'),('COOLING_HEATING', '1'),('STELLAR_PROP', '1'),('ENTROPYPRED', '1'), ('PYCOOL', '1'),('ONLY_MASTER_READ_EWALD', '1')] , library_dirs=[MPI_DIR],libraries=['gsl','gslcblas','m',MPI_LIB,H5_LIB] ),
]
)
'''
Event Timeline
Log In to Comment