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 3c9b4573c1 GH-20047: [MATLAB] Enable GitHub Actions CI for MATLAB
Interface on Windows (#35792)
3c9b4573c1 is described below
commit 3c9b4573c154f514edad02de48b55d410fb3d654
Author: Lei Hou <[email protected]>
AuthorDate: Thu Jul 6 21:04:28 2023 -0400
GH-20047: [MATLAB] Enable GitHub Actions CI for MATLAB Interface on Windows
(#35792)
### Rationale for this change
Currently GitHub Actions builds arrow/matlab on Linux and Mac but not on
Windows. This change is to enable the build on Windows such that we have
qualification coverage on all popular platforms.
### What changes are included in this PR?
The build on windows uses Ninja and Visual Studio to build. This submission
is aimed to enable the CI on Windows. In the future, we'll try to build using
Ninja and MinGW.
### Are these changes tested?
Yes. When I submitted the change, I verified that the Windows CI was
enabled that tests were run successfully.
### Are there any user-facing changes?
No.
### Future Direction
On Windows, use Ninja+MinGW to build to remove the dependency on Visual
Studio.
* Closes: #20047
Authored-by: Lei Hou <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.github/workflows/matlab.yml | 74 +++++++++++++++++++++++++++++++++++++++
matlab/CMakeLists.txt | 83 +++++++++++++++++++++++---------------------
2 files changed, 118 insertions(+), 39 deletions(-)
diff --git a/.github/workflows/matlab.yml b/.github/workflows/matlab.yml
index 541ffcea83..427bb813fd 100644
--- a/.github/workflows/matlab.yml
+++ b/.github/workflows/matlab.yml
@@ -53,6 +53,21 @@ jobs:
run: sudo apt-get install ninja-build
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
+ - name: Install ccache
+ run: sudo apt-get install ccache
+ - name: Setup ccache
+ shell: bash
+ run: ci/scripts/ccache_setup.sh
+ - name: ccache info
+ id: ccache-info
+ shell: bash
+ run: echo "cache-dir=$(ccache --get-config cache_dir)" >>
$GITHUB_OUTPUT
+ - name: Cache ccache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.ccache-info.outputs.cache-dir }}
+ key: matlab-ccache-ubuntu-${{ hashFiles('cpp/**', 'matlab/**') }}
+ restore-keys: matlab-ccache-ubuntu-
- name: Build MATLAB Interface
run: ci/scripts/matlab_build.sh $(pwd)
- name: Run MATLAB Tests
@@ -84,6 +99,21 @@ jobs:
run: brew install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
+ - name: Install ccache
+ run: brew install ccache
+ - name: Setup ccache
+ shell: bash
+ run: ci/scripts/ccache_setup.sh
+ - name: ccache info
+ id: ccache-info
+ shell: bash
+ run: echo "cache-dir=$(ccache --get-config cache_dir)" >>
$GITHUB_OUTPUT
+ - name: Cache ccache
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.ccache-info.outputs.cache-dir }}
+ key: matlab-ccache-macos-${{ hashFiles('cpp/**', 'matlab/**') }}
+ restore-keys: matlab-ccache-macos-
- name: Build MATLAB Interface
run: ci/scripts/matlab_build.sh $(pwd)
- name: Run MATLAB Tests
@@ -94,3 +124,47 @@ jobs:
uses: matlab-actions/run-tests@v1
with:
select-by-folder: matlab/test
+ windows:
+ name: AMD64 Windows 2022 MATLAB
+ runs-on: windows-2022
+ if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Install MATLAB
+ uses: matlab-actions/setup-matlab@v1
+ - name: Download Timezone Database
+ shell: bash
+ run: ci/scripts/download_tz_database.sh
+ - name: Install ccache
+ shell: bash
+ run: ci/scripts/install_ccache.sh 4.6.3 /usr
+ - name: Setup ccache
+ shell: bash
+ run: ci/scripts/ccache_setup.sh
+ - name: ccache info
+ id: ccache-info
+ shell: bash
+ run: echo "cache-dir=$(ccache --get-config cache_dir)" >>
$GITHUB_OUTPUT
+ - name: Cache ccache
+ uses: actions/cache@v3
+ with:
+ path: |
+ ${{ steps.ccache-info.outputs.cache-dir }}
+ key: matlab-ccache-windows-${{ hashFiles('cpp/**', 'matlab/**') }}
+ restore-keys: matlab-ccache-windows-
+ - name: Build MATLAB Interface
+ shell: cmd
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+ bash -c "ci/scripts/matlab_build.sh $(pwd)"
+ - name: Run MATLAB Tests
+ env:
+ # Add the installation directory to the MATLAB Search Path by
+ # setting the MATLABPATH environment variable.
+ MATLABPATH: matlab/install/arrow_matlab
+ uses: matlab-actions/run-tests@v1
+ with:
+ select-by-folder: matlab/test
diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt
index 48b504859a..51aec0c3c1 100644
--- a/matlab/CMakeLists.txt
+++ b/matlab/CMakeLists.txt
@@ -484,26 +484,9 @@ if(APPLE)
# at runtime.
set_target_properties(mexcall PROPERTIES INSTALL_RPATH "@loader_path")
- if(NOT Arrow_FOUND)
- # If Arrow_FOUND is false, Arrow is built by the arrow_shared target and
needs
- # to be copied to CMAKE_PACKAGED_INSTALL_DIR. The DIRECTORY install
command is used to
- # install libarrow.dylib (symlink) and the real files it points to.
- #
- # The subfolders cmake and pkgconfig are excluded as they will be empty.
- # Note: The following CMake Issue suggests enabling an option to exclude
all
- # folders that would be empty after installation:
- # https://gitlab.kitware.com/cmake/cmake/-/issues/17122
- install(DIRECTORY "${ARROW_SHARED_LIB_DIR}/"
- DESTINATION ${CMAKE_PACKAGED_INSTALL_DIR}
- FILES_MATCHING
- REGEX "${ARROW_SHARED_LIB_FILENAME}\\..*dylib"
- PATTERN "cmake" EXCLUDE
- PATTERN "pkgconfig" EXCLUDE)
-
- # Add @loader_path to the RPATH of arrow_matlab so that libarrow.dylib can
be found
- # at runtime.
- set_target_properties(arrow_matlab PROPERTIES INSTALL_RPATH "@loader_path")
- endif()
+ # Add @loader_path to the RPATH of arrow_matlab so that libarrow.dylib can
be found
+ # at runtime.
+ set_target_properties(arrow_matlab PROPERTIES INSTALL_RPATH "@loader_path")
endif()
# On Linux, use the RUNPATH values below for runtime dependency resolution.
This enables
@@ -520,26 +503,48 @@ if(UNIX
# at runtime.
set_target_properties(mexcall PROPERTIES INSTALL_RPATH $ORIGIN)
- if(NOT Arrow_FOUND)
- # If Arrow_FOUND is false, Arrow is built by the arrow_shared target and
needs
- # to be copied to CMAKE_PACKAGED_INSTALL_DIR. The DIRECTORY install
command is used to
- # install libarrow.so (symlink) and the real files it points to.
- #
- # The subfolders cmake and pkgconfig are excluded as they will be empty.
- # Note: The following CMake Issue suggests enabling an option to exclude
all
- # folders that would be empty after installation:
- # https://gitlab.kitware.com/cmake/cmake/-/issues/17122
- install(DIRECTORY "${ARROW_SHARED_LIB_DIR}/"
- DESTINATION ${CMAKE_PACKAGED_INSTALL_DIR}
- FILES_MATCHING
- REGEX "${ARROW_SHARED_LIB_FILENAME}\\.so.*"
- PATTERN "cmake" EXCLUDE
- PATTERN "pkgconfig" EXCLUDE)
-
- # Add $ORIGIN to the RUNPATH of arrow_matlab so that libarrow.so can be
found
- # at runtime.
- set_target_properties(arrow_matlab PROPERTIES INSTALL_RPATH $ORIGIN)
+ # Add $ORIGIN to the RUNPATH of arrow_matlab so that libarrow.so can be found
+ # at runtime.
+ set_target_properties(arrow_matlab PROPERTIES INSTALL_RPATH $ORIGIN)
+endif()
+
+if(NOT Arrow_FOUND)
+ # If Arrow_FOUND is false, Arrow is built by the arrow_shared target and
needs
+ # to be copied to CMAKE_PACKAGED_INSTALL_DIR.
+
+ if(APPLE)
+ # Install libarrow.dylib (symlink) and the real files it points to.
+ # on macOS, we need to match these files: libarrow.dylib
+ # libarrow.1300.dylib
+ # libarrow.1300.0.0.dylib
+ # where the version number might change.
+ set(SHARED_LIBRARY_VERSION_REGEX
+
"${ARROW_SHARED_LIB_FILENAME}(([.][0-9]+)?([.][0-9]+)?([.][0-9]+)?)${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
+ elseif(UNIX AND NOT CYGWIN)
+ # Install libarrow.so (symlink) and the real files it points to.
+ # On Linux, we need to match these files: libarrow.so
+ # libarrow.so.1200
+ # libarrow.so.1200.0.0
+ # where the version number might change.
+ set(SHARED_LIBRARY_VERSION_REGEX
+
"${ARROW_SHARED_LIB_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}(([.][0-9]+)?([.][0-9]+)?([.][0-9]+)?)"
+ )
+ else()
+ set(SHARED_LIBRARY_VERSION_REGEX
+ ${ARROW_SHARED_LIB_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
+
+ # The subfolders cmake and pkgconfig are excluded as they will be empty.
+ # Note: The following CMake Issue suggests enabling an option to exclude all
+ # folders that would be empty after installation:
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/17122
+ install(DIRECTORY "${ARROW_SHARED_LIB_DIR}/"
+ DESTINATION ${CMAKE_PACKAGED_INSTALL_DIR}
+ FILES_MATCHING
+ REGEX ${SHARED_LIBRARY_VERSION_REGEX}
+ PATTERN "cmake" EXCLUDE
+ PATTERN "pkgconfig" EXCLUDE)
endif()
# MATLAB_ADD_INSTALL_DIR_TO_STARTUP_FILE toggles whether an addpath command to
add the install