Skip to content

Commit

Permalink
Merge pull request #136 from rodluger/c++11
Browse files Browse the repository at this point in the history
C++11
  • Loading branch information
rodluger authored Jul 16, 2018
2 parents dd1c724 + cb5be77 commit 5dbec24
Show file tree
Hide file tree
Showing 6 changed files with 690 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ fi
conda info -a

# Build the code
CC=gcc-5 && CXX=g++-5 python setup.py develop
CC=gcc-4.8 && CXX=g++-4.8 python setup.py develop
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- gcc-4.8
- g++-4.8

matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. :changelog:
0.1.0 (2018-07-13)
0.1.2 (2018-07-15)
++++++++++++++++++

- Initial stable beta release of the code for submission to ApJ.
Expand Down
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import glob
import setuptools
__version__ = '0.1.1'
__version__ = '0.1.2'


# Custom compiler flags
Expand All @@ -26,8 +26,9 @@
macros['STARRY_NGRAD'] = int(macros['STARRY_NGRAD']) + 1

# Enable optimization?
optimize = True
if (os.getenv('STARRY_NO_OPT', 0)):
if int(os.getenv('STARRY_OPT', 1)):
optimize = True
else:
optimize = False


Expand Down Expand Up @@ -107,10 +108,16 @@ def build_extensions(self):
"""Build the extensions."""
ct = self.compiler.compiler_type
opts = self.c_opts.get(ct, [])
if not any(f.startswith("-std=") for f in opts):
if has_flag(self.compiler, "-std=c++14"):
opts.append('-std=c++14')
elif has_flag(self.compiler, "-std=c++11"):
opts.append('-std=c++11')
else:
raise RuntimeError("C++11 or 14 is required to compile starry")
if ct == 'unix':
opts.append('-DVERSION_INFO="%s"' %
self.distribution.get_version())
opts.append('-std=c++14')
if has_flag(self.compiler, '-fvisibility=hidden'):
opts.append('-fvisibility=hidden')
elif ct == 'msvc':
Expand Down
Loading

0 comments on commit 5dbec24

Please sign in to comment.