Skip to content

Commit

Permalink
Failing to lind libcudart on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Kraus committed Apr 15, 2019
1 parent 1bd14a9 commit 5e38eeb
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 73 deletions.
2 changes: 2 additions & 0 deletions conda/recipes/cudf/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (c) 2018-2019, NVIDIA CORPORATION.

cd python
$PYTHON setup.py build_ext --inplace
$PYTHON setup.py install
9 changes: 2 additions & 7 deletions conda/recipes/cudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ build:
number: {{ git_revision_count }}
script_env:
- CUDF_BUILD_NO_GPU_TEST
- BUILD_ABI

requirements:
build:
- python x.x
- python
- cython >=0.29,<0.30
- setuptools
- libcudf {{ version }}
- libcudf_cffi {{ version }}
- numba >=0.40
- nvstrings 0.7.*
run:
- python x.x
- cython >=0.29,<0.30
- setuptools
- libcudf {{ version }}
- python
- libcudf_cffi {{ version }}
- pandas >=0.23.4
- numba >=0.40
Expand Down
9 changes: 2 additions & 7 deletions conda/recipes/libcudf/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
CMAKE_COMMON_VARIABLES=" -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX11_ABI=$BUILD_ABI"

# Copyright (c) 2018-2019, NVIDIA CORPORATION.

if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
# C++11 requires 10.9
# but cudatoolkit 8 is build for 10.11
export MACOSX_DEPLOYMENT_TARGET=10.11
fi
CMAKE_COMMON_VARIABLES=" -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX11_ABI=$BUILD_ABI"

# show environment
printenv
Expand Down
8 changes: 5 additions & 3 deletions conda/recipes/libcudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ build:
- CXX
- CUDAHOSTCXX
- PARALLEL_LEVEL
- BUILD_ABI
run_exports:
- {{ pin_subpackage("libcudf", max_pin="x.x") }}

requirements:
build:
- cmake >=3.12.4
- nvstrings 0.7.*
host:
- librmm 0.7.*
- libnvstrings 0.7.*
run:
- pyarrow 0.12.1
- nvstrings 0.7.*

test:
commands:
Expand Down
22 changes: 4 additions & 18 deletions conda/recipes/libcudf_cffi/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
CMAKE_COMMON_VARIABLES=" -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX11_ABI=$BUILD_ABI"


# if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
# # C++11 requires 10.9
# # but cudatoolkit 8 is build for 10.11
# export MACOSX_DEPLOYMENT_TARGET=10.11
# fi
# Copyright (c) 2018-2019, NVIDIA CORPORATION.

# Cleanup local git
git clean -xdf
# Change directory for build process
cd cpp
# Use CMake-based build procedure
mkdir build
cd build
# configure
cmake $CMAKE_COMMON_VARIABLES ..
# build
make python_cffi
# install
make install_python
cd cpp/python
# build and install
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
16 changes: 4 additions & 12 deletions conda/recipes/libcudf_cffi/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@ source:

build:
number: {{ git_revision_count }}
string: cuda{{ cuda_version }}_py{{ py_version }}_{{ git_revision_count }}
string: py{{ py_version }}_{{ git_revision_count }}
script_env:
- CC
- CXX
- CUDAHOSTCXX
- PARALLEL_LEVEL
- BUILD_ABI

requirements:
build:
- cmake >=3.12.4
- python x.x
- python
- cffi
- setuptools
- nvstrings 0.7.*
- pycparser 2.19
- pyarrow 0.12.1
run:
- libcudf {{ version }}
- python x.x
run:
- python
- cffi
- pycparser 2.19
- pyarrow 0.12.1

test:
Expand Down
32 changes: 16 additions & 16 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,6 @@ else()
message(FATAL_ERROR "ZLib not found, please check your settings.")
endif(ZLIB_FOUND)

###################################################################################################
# - add gtest -------------------------------------------------------------------------------------

if(BUILD_TESTS)
include(CTest)
include(ConfigureGoogleTest)

if(GTEST_FOUND)
message(STATUS "Google C++ Testing Framework (Google Test) found in ${GTEST_ROOT}")
include_directories(${GTEST_INCLUDE_DIR})
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
else()
message(AUTHOR_WARNING "Google C++ Testing Framework (Google Test) not found: automated tests are disabled.")
endif(GTEST_FOUND)
endif(BUILD_TESTS)

###################################################################################################
# - RMM -------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -187,6 +171,22 @@ if (NVSTRINGS_INCLUDE AND NVTEXT_LIBRARY)
set_target_properties(NVText PROPERTIES IMPORTED_LOCATION ${NVTEXT_LIBRARY})
endif (NVSTRINGS_INCLUDE AND NVTEXT_LIBRARY)

###################################################################################################
# - add gtest -------------------------------------------------------------------------------------

if(BUILD_TESTS)
include(CTest)
include(ConfigureGoogleTest)

if(GTEST_FOUND)
message(STATUS "Google C++ Testing Framework (Google Test) found in ${GTEST_ROOT}")
include_directories(${GTEST_INCLUDE_DIR})
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
else()
message(AUTHOR_WARNING "Google C++ Testing Framework (Google Test) not found: automated tests are disabled.")
endif(GTEST_FOUND)
endif(BUILD_TESTS)

###################################################################################################
# - include paths ---------------------------------------------------------------------------------

Expand Down
27 changes: 24 additions & 3 deletions cpp/python/libgdf_cffi/libgdf_build.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
# Copyright (c) 2018-2019, NVIDIA CORPORATION.

import cffi
import os
import sys

fnames = [
'types.h',
'convert_types.h',
'functions.h',
'io_types.h',
'io_functions.h'
]

cudf_include_dirs = [
os.environ.get('CUDF_INCLUDE_DIR', '../../include/cudf/'),
os.path.join(sys.prefix, 'include/cudf')
]

include_dir = os.environ.get('CUDF_INCLUDE_DIR', '../../include/cudf/')
for cudf_include_dir in cudf_include_dirs:
if all([
os.path.isfile(os.path.join(cudf_include_dir, fname))
for fname in fnames
]):
include_dir = cudf_include_dir
break

ffibuilder = cffi.FFI()
ffibuilder.set_source("libgdf_cffi.libgdf_cffi", None)

for fname in ['types.h', 'convert_types.h', 'functions.h',
'io_types.h', 'io_functions.h']:
for fname in fnames:
with open(os.path.join(include_dir, fname), 'r') as fin:
ffibuilder.cdef(fin.read())

Expand Down
14 changes: 7 additions & 7 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ endfunction(ConfigureTest)
###################################################################################################
# - include paths ---------------------------------------------------------------------------------

include_directories("${GTEST_INCLUDE_DIR}"
"${ARROW_INCLUDE_DIR}"
"${FLATBUFFERS_INCLUDE_DIR}"
"${RMM_INCLUDE}"
"${NVSTRINGS_INCLUDE}"
"${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/thirdparty/cub"
"${CMAKE_SOURCE_DIR}/thirdparty/moderngpu/src"
"${CMAKE_SOURCE_DIR}/thirdparty/dlpack/include")
"${CMAKE_SOURCE_DIR}/thirdparty/dlpack/include"
"${GTEST_INCLUDE_DIR}"
"${ARROW_INCLUDE_DIR}"
"${FLATBUFFERS_INCLUDE_DIR}"
"${RMM_INCLUDE}"
"${NVSTRINGS_INCLUDE}")

###################################################################################################
# - library paths ---------------------------------------------------------------------------------
Expand Down

0 comments on commit 5e38eeb

Please sign in to comment.