Commit 41bfcc25 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

add setup.py install process

parent 5250a018
include py/lib/swig/numpy.i
include lib/utils/nemodep/cfalcon.h lib/utils/csnaptools.h lib/utils/*.h lib/utils/ctree.h lib/projects/nemodep/crectify.h lib/projects/nemodep/c2dplot.h
from __future__ import print_function
try:
from unsiotools.py_unstools import *
except:
import sys
print("Unable to import [unsiotools.py_unstools]....",file=sys.stderr)
#!/usr/bin/env python
"""
>> PACKAGING
Dependencies :
==============
apt-get install python3-stdeb fakeroot python3-all-dev python3-all swig python3-numpy python3-setuptools
apt-get install python-stdeb fakeroot python-all-dev python-all swig python-numpy python-setuptools libsqlite3-dev
( see https://pypi.org/project/stdeb/)
NEMO (https://github.com/teuben/nemo)
you must have NEMO package installed (especially falcON) to build this module
To build RPM :
==============
python3 setup.py bdist_rpm --release 1mga6
To build deb package :
======================
python3 setup.py --command-packages=stdeb.command bdist_deb sdist_dsc --with-python2=True --with-python3=True --dist-dir=my_deb --debian-version 0ubuntu16.04
To build MacOSX :
=================
1) use clang compiler and python3
2) build
CC=/usr/bin/cc CXX=/usr/bin/c++ python3 setup.py build_ext -L ${HOME}/local/unsio/lib -R ${HOME}/local/unsio/lib
3) install locally
python3 setup.py install --user
4) set DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${HOME}/local/unsio/lib
>> INSTALL
to install locally :
====================
python3 setup.py install --user
"""
#from distutils.core import setup, Extension
import numpy,os,sys
from setuptools import setup, Extension
# find out numpy include directory.
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_include()
#DEHNEN=$ENV{NEMO}/usr/dehnen
# detect python version (2 or 3)
pyversion="3"
if sys.version_info[0]<3 :
pyversion=""
setup(
name='python'+pyversion+'-unsiotools',
version='1.0',
description='Python wrapper to unsiotools',
author='Jean-Charles LAMBERT',
author_email='jean-charles.lambert@lam.fr',
url='https://projets.lam.fr/projects/uns_projects',
# 'unsiotools' -> installation directory
# 'py/lib/swig' -> about all the py source in 'src'
package_dir={'unsiotools':'py/lib/swig'},
packages=['unsiotools'],
ext_modules = [
Extension("unsiotools/_py_unstools",
sources=[ "py/lib/swig/py_unstools.i"],
swig_opts=['-c++','-modern', '-DNO_CUDA -DNOBOOST',
'-Isrc','-I./py/lib/swig', '-Iswig','-Ilib/utils','-Ilib/utils/nemodep', '-Ilib/projects/nemodep'],
include_dirs = [numpy_include,'src',
'lib/utils',
'lib/utils/nemodep',
'lib/projects/nemodep',
os.environ['NEMO']+'/usr/dehnen/utils',
os.environ['NEMO']+'/usr/dehnen/utils/inc',
os.environ['NEMO']+'/usr/dehnen/falcON',
os.environ['NEMO']+'/usr/dehnen/falcON/inc',
os.environ['NEMO']+'/usr/dehnen/falcON/public',
os.environ['NEMO']+'/inc'
],
extra_compile_args = ['-O2'],
define_macros=[('NOBOOST',None), # equivalent to -DNOBOOST
('falcON_SINGLE',None),
('falcON_NEMO',None),
('NO_CUDA',None) ],
# NOTE : libraries linking order is VERY important !!!
libraries=['JCLutils', 'JCLprojects','unsio', 'WDutils', 'falcON', 'nemo','cpgplot', 'pgplot','sqlite3','X11','gfortran'],
library_dirs=['/usr/lib64','/lib64',
os.environ['NEMO']+'/lib',
os.environ['NEMO']+'/usr/dehnen/utils/lib',
os.environ['NEMO']+'/usr/dehnen/falcON/lib'],
runtime_library_dirs=['/usr/lib64','/lib64',
os.environ['NEMO']+'/lib',
os.environ['NEMO']+'/usr/dehnen/utils/lib',
os.environ['NEMO']+'/usr/dehnen/falcON/lib' ]
)
],
install_requires=['numpy'],
setup_requires=['numpy']
#
#py_modules = ["py_baryc"]
#data_files=[('',['src/numpy.i'])]
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment