This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 86b7a84c93 GH-37308: [C++][Docs] Change name for CPP tutorial and 
minor fixes to the job (#37311)
86b7a84c93 is described below

commit 86b7a84c9317fa08222eb63f6930bbb54c2e6d0b
Author: Raúl Cumplido <[email protected]>
AuthorDate: Fri Aug 25 03:29:15 2023 +0200

    GH-37308: [C++][Docs] Change name for CPP tutorial and minor fixes to the 
job (#37311)
    
    ### Rationale for this change
    
    Fix the job and rename so it's picked up as part of the nightlies
    
    ### What changes are included in this PR?
    
    Rename + fixes to the job.
    
    ### Are these changes tested?
    
    Via CI
    
    ### Are there any user-facing changes?
    
    No
    * Closes: #37308
    
    Lead-authored-by: Raúl Cumplido <[email protected]>
    Co-authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/examples/tutorial_examples/CMakeLists.txt     | 9 ++-------
 cpp/examples/tutorial_examples/build_example.sh   | 2 +-
 cpp/examples/tutorial_examples/dataset_example.cc | 1 +
 cpp/examples/tutorial_examples/run.sh             | 9 +++++++--
 dev/tasks/tasks.yml                               | 2 +-
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/cpp/examples/tutorial_examples/CMakeLists.txt 
b/cpp/examples/tutorial_examples/CMakeLists.txt
index 7758af90fb..8788501484 100644
--- a/cpp/examples/tutorial_examples/CMakeLists.txt
+++ b/cpp/examples/tutorial_examples/CMakeLists.txt
@@ -19,11 +19,7 @@ cmake_minimum_required(VERSION 3.16)
 
 project(ArrowTutorialExamples)
 
-find_package(Arrow REQUIRED)
-
-get_filename_component(ARROW_CONFIG_PATH ${Arrow_CONFIG} DIRECTORY)
-find_package(Parquet REQUIRED HINTS ${ARROW_CONFIG_PATH})
-find_package(ArrowDataset REQUIRED HINTS ${ARROW_CONFIG_PATH})
+find_package(ArrowDataset)
 
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
@@ -44,5 +40,4 @@ add_executable(compute_example compute_example.cc)
 target_link_libraries(compute_example PRIVATE Arrow::arrow_shared)
 
 add_executable(dataset_example dataset_example.cc)
-target_link_libraries(dataset_example PRIVATE Arrow::arrow_shared 
Parquet::parquet_shared
-                                              
ArrowDataset::arrow_dataset_shared)
+target_link_libraries(dataset_example PRIVATE 
ArrowDataset::arrow_dataset_shared)
diff --git a/cpp/examples/tutorial_examples/build_example.sh 
b/cpp/examples/tutorial_examples/build_example.sh
index a315755a59..0b279890a7 100755
--- a/cpp/examples/tutorial_examples/build_example.sh
+++ b/cpp/examples/tutorial_examples/build_example.sh
@@ -21,7 +21,7 @@ set -ex
 mkdir -p $EXAMPLE_BUILD_DIR
 pushd $EXAMPLE_BUILD_DIR
 
-cmake /io
+cmake /io $EXAMPLE_CMAKE_OPTIONS
 make
 
 popd
diff --git a/cpp/examples/tutorial_examples/dataset_example.cc 
b/cpp/examples/tutorial_examples/dataset_example.cc
index 005cdc324d..a980fa5493 100644
--- a/cpp/examples/tutorial_examples/dataset_example.cc
+++ b/cpp/examples/tutorial_examples/dataset_example.cc
@@ -25,6 +25,7 @@
 #include <parquet/arrow/reader.h>
 #include <parquet/arrow/writer.h>
 
+#include <unistd.h>
 #include <iostream>
 // (Doc section: Includes)
 
diff --git a/cpp/examples/tutorial_examples/run.sh 
b/cpp/examples/tutorial_examples/run.sh
index ed319a9d32..bc0078435c 100755
--- a/cpp/examples/tutorial_examples/run.sh
+++ b/cpp/examples/tutorial_examples/run.sh
@@ -22,6 +22,7 @@ cd /io
 
 export ARROW_BUILD_DIR=/build/arrow
 export EXAMPLE_BUILD_DIR=/build/example
+export ARROW_INSTALL_DIR=/build/arrow-install
 
 echo
 echo "=="
@@ -29,7 +30,9 @@ echo "== Building Arrow C++ library"
 echo "=="
 echo
 
-./build_arrow.sh
+ARROW_CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${ARROW_INSTALL_DIR} \
+                     -DCMAKE_INSTALL_RPATH=${ARROW_INSTALL_DIR}/lib" \
+  ./build_arrow.sh
 
 echo
 echo "=="
@@ -37,7 +40,9 @@ echo "== Building example project using Arrow C++ library"
 echo "=="
 echo
 
-./build_example.sh
+EXAMPLE_CMAKE_OPTIONS="-DCMAKE_INSTALL_RPATH=${ARROW_INSTALL_DIR}/lib \
+                       -DCMAKE_PREFIX_PATH=${ARROW_INSTALL_DIR}" \
+  ./build_example.sh
 
 echo
 echo "=="
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 33643f16a3..55f23ed130 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -1625,7 +1625,7 @@ tasks:
       run: {{ kind }}
 {% endfor %}
 
-  cpp-tutorial-example:
+  example-cpp-tutorial:
     ci: github
     template: cpp-examples/github.linux.yml
     params:

Reply via email to