-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating to circleci2.0 and adding Makefile
- Loading branch information
Showing
8 changed files
with
119 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
machine: true | ||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
key: v2-miniconda-{{ .Branch }} | ||
|
||
- run: | ||
name: install miniconda | ||
command: | | ||
if [[ ! -d /home/circleci/miniconda ]]; then | ||
wget https://repo.continuum.io/miniconda/Miniconda3-4.5.1-Linux-x86_64.sh -O miniconda.sh && | ||
bash miniconda.sh -b -f -p /home/circleci/miniconda; | ||
else | ||
echo "Using cached miniconda"; | ||
fi | ||
source ~/miniconda/bin/activate root | ||
conda config --set always_yes yes | ||
conda config --add channels conda-forge | ||
conda config --add channels spectralDNS | ||
conda clean --lock | ||
conda install --yes --quiet conda-forge-ci-setup=1 | ||
source run_conda_forge_build_setup | ||
- save_cache: | ||
key: v2-miniconda-{{ .Branch }} | ||
paths: | ||
- /home/circleci/miniconda | ||
|
||
- run: | ||
name: Build and test | ||
command: | | ||
source ~/miniconda/bin/activate root | ||
cd /home/circleci/project | ||
conda build --python 2.7 ./conf/conda | ||
conda build --python 3.6 ./conf/conda | ||
- run: | ||
name: Upload packages | ||
command: | | ||
source ~/miniconda/bin/activate root | ||
cd /home/circleci/project | ||
upload_or_check_non_existence ./conf/conda spectralDNS --channel main | ||
export CONDA_PY=36 | ||
upload_or_check_non_existence ./conf/conda spectralDNS --channel main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
VERSION=$(shell python3 -c "import mpiFFT4py; print(mpiFFT4py.__version__)") | ||
|
||
default: | ||
python setup.py build_ext -i | ||
|
||
pip: | ||
rm -f dist/* | ||
python setup.py sdist | ||
twine upload dist/* | ||
|
||
tag: | ||
git tag $(VERSION) | ||
git push --tags | ||
|
||
publish: tag pip | ||
|
||
clean: | ||
git clean mpiFFT4py -fx | ||
git clean tests -fx | ||
cd docs && make clean && cd .. | ||
@rm -rf *.egg-info/ build/ dist/ .eggs/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
numpy: | ||
- 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,66 @@ | ||
#!/usr/bin/env python | ||
|
||
import os, sys, platform | ||
from distutils.core import setup, Extension | ||
from Cython.Distutils import build_ext | ||
from Cython.Build import cythonize | ||
import os | ||
import re | ||
import subprocess | ||
from setuptools import setup, Extension | ||
from setuptools.command.build_ext import build_ext | ||
from numpy import get_include | ||
|
||
# Version number | ||
major = 1 | ||
minor = 1 | ||
version = 0 | ||
|
||
cwd = os.path.abspath(os.path.dirname(__file__)) | ||
cdir = os.path.join(cwd, "mpiFFT4py", "cython") | ||
|
||
cmdclass = {} | ||
def has_flag(compiler, flagname): | ||
"""Return a boolean indicating whether a flag name is supported on | ||
the specified compiler. | ||
""" | ||
devnull = open(os.devnull, "w") | ||
p = subprocess.Popen([compiler.compiler[0], '-E', '-'] + [flagname], | ||
stdin=subprocess.PIPE, stdout=devnull, stderr=devnull, | ||
shell=True) | ||
p.communicate("") | ||
return True if p.returncode == 0 else False | ||
|
||
class build_ext_subclass(build_ext): | ||
def build_extensions(self): | ||
extra_compile_args = ['-w', '-Ofast'] | ||
cmd = "echo | %s -E - %s &>/dev/null" % ( | ||
self.compiler.compiler[0], " ".join(extra_compile_args)) | ||
try: | ||
subprocess.check_call(cmd, shell=True) | ||
except: | ||
extra_compile_args = ['-w', '-O3'] | ||
extra_compile_args = ['-g0'] | ||
for c in ['-w', '-Ofast', '-ffast-math', '-march=native']: | ||
if has_flag(self.compiler, c): | ||
extra_compile_args.append(c) | ||
|
||
for e in self.extensions: | ||
e.extra_compile_args = extra_compile_args | ||
e.extra_compile_args += extra_compile_args | ||
e.include_dirs.extend([get_include()]) | ||
build_ext.build_extensions(self) | ||
|
||
ext = cythonize(os.path.join(cdir, "*.pyx")) | ||
[e.include_dirs.extend([get_include()]) for e in ext] | ||
cmdclass = {'build_ext': build_ext_subclass} | ||
ext = [Extension('mpiFFT4py.cython.maths', | ||
sources=[os.path.join(cdir, "maths.pyx")])] | ||
|
||
def version(): | ||
srcdir = os.path.join(cwd, 'mpiFFT4py') | ||
with open(os.path.join(srcdir, '__init__.py')) as f: | ||
m = re.search(r"__version__\s*=\s*'(.*)'", f.read()) | ||
return m.groups()[0] | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setup(name = "mpiFFT4py", | ||
version = "%d.%d.%d" % (major, minor, version), | ||
version = version(), | ||
description = "mpiFFT4py -- Parallel 3D FFT in Python using MPI for Python", | ||
long_description = "", | ||
long_description = long_description, | ||
author = "Mikael Mortensen", | ||
author_email = "[email protected]", | ||
url = 'https://github.com/spectralDNS/mpiFFT4py', | ||
download_url = "https://github.com/spectralDNS/mpiFFT4py/archive/mpiFFT4py-1.1.0.tar.gz", | ||
classifiers = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Science/Research', | ||
'Intended Audience :: Education', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 3', | ||
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', | ||
'Topic :: Scientific/Engineering :: Mathematics', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
|
@@ -57,5 +71,5 @@ def build_extensions(self): | |
], | ||
package_dir = {"mpiFFT4py": "mpiFFT4py"}, | ||
ext_modules = ext, | ||
cmdclass = cmdclass | ||
cmdclass = {'build_ext': build_ext_subclass} | ||
) |