Commit 9e5da97d authored by Pierre Augier's avatar Pierre Augier
Browse files

Nicer with pip (0.2.0.post6)

parent bcd83771825c
......@@ -50,3 +50,5 @@ bench/SLURM*
doc/ipynb/.ipynb_checkpoints
doc/ipynb/*.rst
doc/tmp/*
.eggs/*
\ No newline at end of file
......@@ -11,4 +11,4 @@ http://legacy.python.org/dev/peps/pep-0386/
'a' or 'alpha' means alpha version (internal testing),
'b' or 'beta' means beta version (external testing).
"""
__version__ = '0.2.0.post2'
__version__ = '0.2.0.post6'
......@@ -41,9 +41,11 @@ from copy import copy
import importlib
import multiprocessing
import warnings
from shutil import copyfile
from distutils.ccompiler import CCompiler
from setuptools.command.build_ext import build_ext
from setuptools import Extension as SetuptoolsExtension
import numpy as np
......@@ -188,8 +190,9 @@ class CommandsRunner(object):
class FunctionsRunner(CommandsRunner):
def _launch_process(self, command):
func, args, kwargs = command
print('launching command:\n{}(\n *args={},\n **kwargs={})'.format(
func.__name__, args, kwargs))
print('launching command:\n'
'{}(\n *args={},\n **kwargs={})'.format(
func.__name__, args, kwargs))
process = multiprocessing.Process(
target=func, args=args, kwargs=kwargs)
process.start()
......@@ -336,24 +339,7 @@ def make_extensions(extensions,
'build_ext', 'install', 'develop', 'bdist_wheel', 'bdist_egg']):
return
if '--inplace' in sys.argv or 'develop' in sys.argv:
path_base_output = '.'
elif ('install' in sys.argv and
'--single-version-externally-managed' in sys.argv):
if can_import_pythran:
# build_ext will take care of copying .so to site-packages
path_base_output = path_lib
else:
# build_ext will not be invoked
path_base_output = path_lib_python
elif 'bdist_wheel' in sys.argv:
path_base_output = 'build/bdist.' + '-'.join(
[platform.system().lower(), platform.machine()]) + '/wheel'
elif 'bdist_egg' in sys.argv:
path_base_output = 'build/bdist.' + '-'.join(
[platform.system().lower(), platform.machine()]) + '/egg'
else:
path_base_output = path_tmp
path_base_output = path_lib
sources = set()
for ext in extensions:
......@@ -424,6 +410,8 @@ def make_extensions(extensions,
CommandsRunner(commands).run()
extensions_out = []
# link .o files to produce the .so files if needed
files['so'] = []
commands = []
......@@ -435,6 +423,8 @@ def make_extensions(extensions,
os.path.join(path_tmp, os.path.splitext(source)[0] + '.o')
for source in ext.sources]
extensions_out.append(SetuptoolsExtension(ext.name, sources=[result]))
lib_dirs = []
lib_flags = []
for lib in ext.libraries:
......@@ -453,7 +443,7 @@ def make_extensions(extensions,
# wait for linking
CommandsRunner(commands).run()
return extensions_out
# building with pythran
......@@ -498,6 +488,8 @@ def build_extensions(self):
except AttributeError:
pass
try:
num_jobs = os.cpu_count()
except AttributeError:
......
......@@ -26,7 +26,15 @@ from src_cy.make_files_with_mako import make_pyx_files
from purepymake import (
Extension, make_extensions, monkeypatch_parallel_build,
make_pythran_extensions)
from config import parse_config
try:
from config import parse_config
except ImportError:
# solve a bug... Useful when there is already a module config imported...
here = os.path.abspath(os.path.dirname(__file__))
d = run_path(os.path.join(here, 'config.py'))
parse_config = d['parse_config']
monkeypatch_parallel_build()
......@@ -207,27 +215,14 @@ for base_name in base_names:
if key in base_name:
update_with_config(key)
ext_modules = make_extensions(
ext_modules, include_dirs=include_dirs,
lib_flags_dict=lib_flags_dict, lib_dirs_dict=lib_dirs_dict)
# import inspect
# curframe = inspect.currentframe()
# calframe = inspect.getouterframes(curframe, 2)
if not on_rtd:
make_extensions(
ext_modules, include_dirs=include_dirs,
lib_flags_dict=lib_flags_dict, lib_dirs_dict=lib_dirs_dict)
# CFLAGS='-std=c++03')
# Clear all purepymake.Extension objects after build is done.
ext_modules = []
if use_pythran:
ext_modules = make_pythran_extensions(
['fluidfft.fft2d.util_pythran',
'fluidfft.fft3d.util_pythran'])
else:
ext_modules = []
if use_pythran:
ext_modules.expand(make_pythran_extensions(
['fluidfft.fft2d.util_pythran',
'fluidfft.fft3d.util_pythran']))
setup(
......
[fftw3]
use = False
use = True
dir =
include_dir =
library_dir =
......
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