Unverified Commit 6bb0f880 authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #151 from cancan101/patch-1

MRG: library_builders for fftw

Recipe for FFTW build.
parents d5d45b37 2f09a7af
...@@ -39,6 +39,7 @@ LIBTOOL_VERSION=${LIBTOOL_VERSION:-2.4.6} ...@@ -39,6 +39,7 @@ LIBTOOL_VERSION=${LIBTOOL_VERSION:-2.4.6}
RAGEL_VERSION=${RAGEL_VERSION:-6.10} RAGEL_VERSION=${RAGEL_VERSION:-6.10}
FLEX_VERSION=${FLEX_VERSION:-2.6.4} FLEX_VERSION=${FLEX_VERSION:-2.6.4}
BISON_VERSION=${BISON_VERSION:-3.0.4} BISON_VERSION=${BISON_VERSION:-3.0.4}
FFTW_VERSION=${FFTW_VERSION:-3.3.7}
OPENSSL_ROOT=openssl-1.0.2l OPENSSL_ROOT=openssl-1.0.2l
# Hash from https://www.openssl.org/source/openssl-1.0.2?.tar.gz.sha256 # Hash from https://www.openssl.org/source/openssl-1.0.2?.tar.gz.sha256
OPENSSL_HASH=ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c OPENSSL_HASH=ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c
...@@ -381,3 +382,55 @@ function build_flex { ...@@ -381,3 +382,55 @@ function build_flex {
build_simple flex $FLEX_VERSION \ build_simple flex $FLEX_VERSION \
https://github.com/westes/flex/releases/download/v$FLEX_VERSION https://github.com/westes/flex/releases/download/v$FLEX_VERSION
} }
function build_fftw_case {
local configure_args=${@:0}
build_simple fftw $FFTW_VERSION \
http://www.fftw.org/ tar.gz \
--with-pic --enable-shared --enable-threads --disable-fortran \
$configure_args
# eval cd fftw-$FFTW_VERSION/tests && make check-local && cd -
}
function build_fftw {
echo 'Building fftw'
# Save off current CFLAGS
local old_cflags=$CFLAGS
# Taken from: https://github.com/conda-forge/fftw-feedstock/blob/master/recipe/build.sh
export CFLAGS="-O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math"
# single
echo 'Building fftw: single'
build_fftw_case --enable-float --enable-sse --enable-sse2 --enable-avx
# Clear stamp file which prevents subsequent builds
rm fftw-stamp
# double
echo 'Building fftw: double'
build_fftw_case --enable-sse2 --enable-avx
# Clear stamp file which prevents subsequent builds
rm fftw-stamp
# long double (SSE2 and AVX not supported)
echo 'Building fftw: long double'
build_fftw_case --enable-long-double
# Taken from: https://github.com/conda-forge/pyfftw-feedstock/blob/master/recipe/build.sh
export C_INCLUDE_PATH=$BUILD_PREFIX/include # required as fftw3.h installed here
# define STATIC_FFTW_DIR so the patched setup.py will statically link FFTW
export STATIC_FFTW_DIR=$BUILD_PREFIX/lib
# TODO: These can be made into asserts per:
# https://github.com/conda-forge/fftw-feedstock/blob/8eaa8a1c63e7fcb97c63c1ee8e33c62ef3afa9c7/recipe/meta.yaml#L29-L52
ls -l $C_INCLUDE_PATH/fftw3*
ls -l $STATIC_FFTW_DIR/libfftw3*
# restore CFLAGS
export CFLAGS=$old_cflags
}
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