Skip to content

Commit 59f6874

Browse files
committed
remove fast-math for python; put in a test; clean deps a bit
1 parent 7708199 commit 59f6874

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

recipes/camb/Makefile.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ index 6e8d822..af9cedc 100644
77
SFFLAGS = -shared -fPIC
88

99
-FFLAGS = -O3 -fopenmp -ffast-math -fmax-errors=4
10-
+FFLAGS = -O3 -fopenmp -fmax-errors=4
10+
+FFLAGS = -O3 -fopenmp -fmax-errors=4 ${EXTRA_FFLAGS}
1111
DEBUGFLAGS = -cpp -g -fbounds-check -fbacktrace -ffree-line-length-none -fmax-errors=4 -ffpe-trap=invalid,overflow,zero
1212
MODOUT = -J$(OUTPUT_DIR)
1313
SMODOUT = -J$(DLL_DIR)

recipes/camb/build.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3-
make camb
3+
EXTRA_FFLAGS=-ffast-math make camb
4+
5+
make clean
46

57
cd pycamb
68
python setup.py build

recipes/camb/meta.yaml

+4-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ build:
2424
requirements:
2525
build:
2626
- {{ compiler('c') }}
27-
- {{ compiler('cxx') }}
2827
- {{ compiler('fortran') }}
2928
- git
3029
- make
@@ -37,11 +36,9 @@ outputs:
3736
script: install-pycamb.sh
3837
requirements:
3938
build:
39+
# these are needed to convince conda-build to pin the requirements
4040
- {{ compiler('c') }}
41-
- {{ compiler('cxx') }}
4241
- {{ compiler('fortran') }}
43-
- git
44-
- make
4542
host:
4643
- python
4744
- pip
@@ -67,11 +64,9 @@ outputs:
6764
script: install-camb.sh
6865
requirements:
6966
build:
67+
# these are needed to convince conda-build to pin the requirements
7068
- {{ compiler('c') }}
71-
- {{ compiler('cxx') }}
7269
- {{ compiler('fortran') }}
73-
- git
74-
- make
7570
test:
7671
files:
7772
- params.ini
@@ -80,7 +75,8 @@ outputs:
8075

8176
about:
8277
home: https://camb.info/
83-
license: LGPL
78+
license: modified LGPL
79+
license_family: LGPL
8480
license_file: {{ RECIPE_DIR }}/LICENSE
8581
summary: Code for Anisotropies in the Microwave Background
8682
description: |

recipes/camb/test_camb.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#!/use/bin/env python
2+
3+
# check that we are not linking fast-math from fortran
4+
str_num_before = str(1e-323)
5+
print("before import:", str_num_before)
6+
27
import camb
38

9+
str_num_after = str(1e-323)
10+
print("after import:", str_num_after)
11+
12+
assert str_num_before == str_num_after
13+
414
# run the code
515
pars = camb.CAMBparams()
616
pars.set_cosmology(

0 commit comments

Comments
 (0)