Skip to content

Commit

Permalink
Merge pull request rapidsai#5 from dantegd/014-fix-build
Browse files Browse the repository at this point in the history
FIX Small build script corrections
  • Loading branch information
dantegd authored May 11, 2020
2 parents 700215c + 945fff3 commit 0d0c91f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@


## Bug Fixes
- PR #5: Small build.sh fixes
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fi


# Build and (optionally) install the cuml Python package
if (( ${NUMARGS} == 0 )) || hasArg cuml; then
if (( ${NUMARGS} == 0 )) || hasArg pyraft; then

cd ${REPODIR}/python
if [[ ${INSTALL_TARGET} != "" ]]; then
Expand Down
12 changes: 5 additions & 7 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,14 @@ logger "Adding ${CONDA_PREFIX}/lib to LD_LIBRARY_PATH"
export LD_LIBRARY_PATH_CACHED=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

logger "Build libcuml, cuml, prims and bench targets..."
logger "Build C++ and Python targets..."
$WORKSPACE/build.sh cppraft pyraft -v

logger "Resetting LD_LIBRARY_PATH..."

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_CACHED
export LD_LIBRARY_PATH_CACHED=""

logger "Build treelite for GPU testing..."

cd $WORKSPACE


################################################################################
Expand All @@ -111,10 +108,11 @@ nvidia-smi

logger "GoogleTest for raft..."
cd $WORKSPACE/cpp/build
GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test/ml
# Googletests haven't been moved over/integrated yet
# GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test_raft
# running simple tests meanwhile

logger "Python pytest for cuml..."
cd $WORKSPACE/python

pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s

python -m pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s
8 changes: 3 additions & 5 deletions cpp/include/raft.hpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
* limitations under the License.
*/


#include <string>

namespace raft {

/* Function for testing RAFT include
*
* @return message indicating RAFT has been included succesfully*/
inline std::string test_raft()
{
std::string status = "RAFT Setup succesfully";
return status;
inline std::string test_raft() {
std::string status = "RAFT Setup succesfully";
return status;
}

} // namespace raft
9 changes: 4 additions & 5 deletions cpp/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
* limitations under the License.
*/


#include <raft.hpp>
#include <iostream>
#include <raft.hpp>

int main(){
std::string result = raft::test_raft();
std::cout << result;
int main() {
std::string result = raft::test_raft();
std::cout << result;
}
28 changes: 28 additions & 0 deletions python/.flake8.cython
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[flake8]
filename = *.pyx, *.pxd
exclude = *.egg, build, docs, .git
ignore = E999, E225, E226, E227, W503, W504

# Rules ignored:
# E999: invalid syntax (works for Python, not Cython)
# E225: Missing whitespace around operators (breaks cython casting syntax like <int>)
# E226: Missing whitespace around arithmetic operators (breaks cython pointer syntax like int*)
# E227: Missing whitespace around bitwise or shift operator (Can also break casting syntax)
# W503: line break before binary operator (breaks lines that start with a pointer)
# W504: line break after binary operator (breaks lines that end with a pointer)
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
clean_folder(setup_file_path + '/raft')
shutil.rmtree(setup_file_path + '/build')

except IOError as e:
except IOError:
pass

# need to terminate script so cythonizing doesn't get triggered after
Expand Down

0 comments on commit 0d0c91f

Please sign in to comment.