Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clRNG #3236

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions recipes/clrng/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
mkdir build_release
cd build_release

if "%ARCH%" == "64" (
set BUILD64=ON
) else (
set BUILD64=OFF
)

cmake ^
-G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY="%LIBRARY_LIB%" ^
-DBUILD64="%BUILD64%" ^
-DSUFFIX_BIN="" ^
-DSUFFIX_LIB="" ^
-DBUILD_TEST=OFF ^
-DBUILD_CLIENT=OFF ^
-DOPENCL_ROOT="%LIBRARY_PREFIX%" ^
"%SRC_DIR%\src"
nmake
nmake install
25 changes: 25 additions & 0 deletions recipes/clrng/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

mkdir build_release
cd build_release


OPENCL_ROOT_FLAG="-DOPENCL_ROOT=${PREFIX}"
if [[ "`uname`" == "Darwin" ]] && [[ "${OSX_VARIANT}" == "native" ]]
then
OPENCL_ROOT_FLAG="";
fi

cmake \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DSUFFIX_BIN="" \
-DSUFFIX_LIB="" \
-DBUILD_TEST=0 \
-DBUILD_CLIENT=0 \
"${OPENCL_ROOT_FLAG}" \
"${SRC_DIR}/src"
make
make install
83 changes: 83 additions & 0 deletions recipes/clrng/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{% set name = "clRNG" %}
{% set version = "1.0.0-beta" %}
{% set sha256 = "12e46c89a577ea26ea8af2b11176b1c503c2b0a28a3766178f317f21f27324f4" %}

{% set OSX_VARIANT = os.environ.get("OSX_VARIANT", "native") %}

package:
name: {{ name|lower }}
version: {{ version.replace("-", "").replace("beta", "b") }}

source:
fn: {{ name }}-{{ version }}.tar.gz
url: https://github.com/clMathLibraries/{{ name }}/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}

build:
number: 0
script_env:
- OSX_VARIANT

{% if OSX_VARIANT != "native" %}
skip: True # [not osx]
{% else %}
#############################################################
# Skip Visual Studio 2015 32-bit builds due to a bug. #
# #
# xref: https://github.com/clMathLibraries/clRNG/issues/11 #
#############################################################
skip: True # [(win and py35) or (win32 and py36)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipping Python 3.5 as Python 3.5 and Python 3.6 use the same VC runtime version. So either will work for our purposes here. This is typical.

What is worth noting is that VS 2015 32-bit builds fail. This log demonstrates the build failure. An issue has already been raised about this upstream. ( clMathLibraries/clRNG#11 ) As there doesn't seem to be a patch we can use to fix this, we merely disable those builds. VS 2015 64-bit builds seem to build fine.

{% endif %}

features:
{% if OSX_VARIANT == "pocl" %}
- osx_pocl_opencl # [osx]
{% endif %}
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]
- vc14 # [win and py36]

requirements:
build:
- toolchain
- python # [win]
- msinttypes # [win and py<35]
- cmake
- ocl-icd # [linux]
- khronos-opencl-icd-loader # [win]
{% if OSX_VARIANT == "pocl" %}
- osx-pocl-opencl # [osx]
- pocl >=0.14 # [unix]
{% endif %}

run:
- khronos-opencl-icd-loader # [win]
- ocl-icd # [linux]
{% if OSX_VARIANT == "pocl" %}
- osx-pocl-opencl # [osx]
- pocl >=0.14 # [unix]
{% endif %}

test:
requires:
- python {{ environ['PY_VER'] + '*' }} # [win]

commands:
# Check files
- test -f "${PREFIX}/include/clRNG.h" # [unix]
- test -f "${PREFIX}/lib/libclRNG.so" # [linux]
- test -f "${PREFIX}/lib/libclRNG.dylib" # [osx]
- if not exist %LIBRARY_INC%\\clRNG.h exit 1 # [win]
- if not exist %LIBRARY_BIN%\\clRNG.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\\clRNG.lib exit 1 # [win]

about:
home: https://github.com/clMathLibraries/{{ name }}
license: BSD 3-Clause
license_file: LICENSE
summary: A library for uniform random number generation in OpenCL

extra:
recipe-maintainers:
- jakirkham