Skip to content

Added functions for MATLAB build support - #13

Merged
kevingurney merged 5 commits into
mathworks:build_supportfrom
mcafaro:build_support
Apr 30, 2019
Merged

kevingurney merged 5 commits into
mathworks:build_supportfrom
mcafaro:build_support

Conversation

@mcafaro

@mcafaro mcafaro commented Apr 26, 2019

Copy link
Copy Markdown
Member

No description provided.

@mcafaro
mcafaro requested review from kevingurney and rdmello April 26, 2019 20:37

@kevingurney kevingurney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mcafaro Thanks for creating this pull request! Overall, these changes look good! Only minor comments.

Comment thread matlab/build_support/common_vars.m Resolved
Comment thread matlab/build_support/compile.m Resolved
Comment thread matlab/build_support/compile.m Resolved
Comment thread matlab/build_support/test.m Resolved
Comment thread matlab/build_support/test.m Resolved

@rdmello rdmello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't have any specific feedback beyond what Kevin's mentioned here. Thanks for doing this!

@kevingurney

Copy link
Copy Markdown
Member

Changes look good! I am going to go ahead and merge this. Thanks again @mcafaro!

@kevingurney
kevingurney merged this pull request into mathworks:build_support Apr 30, 2019
wesm pushed a commit to apache/arrow that referenced this pull request May 16, 2019
…ther directly within MATLAB

The MATLAB interface to Feather currently uses CMake to build MEX files. It would be convenient to be able to build the MEX file used by the MATLAB interface to Feather directly using normal MATLAB commands.

This will also provide a workaround for MEX compilation issues when using older CMake versions with newer versions of MATLAB (R2018b and beyond).

The commits in the pull request add a new `build_support` folder to the MATLAB subfolder in the Arrow repository. This `build_support` folder contains two functions called `compile` and `test` that use the `ARROW_HOME` environment variable and the `mex` command to build the necessary MEX files.

For example:

``` matlab
>> cd build_support
>> compile
...lots of output...
>> test
...successfully passed all tests...
```

Thanks to Mark (@mcafaro) for implementing this and working through the initial review in mathworks#13

Author: Mark Cafaro <mark.cafaro@mathworks.com>
Author: rdmello <rylan.dmello@mathworks.com>
Author: Mark Cafaro <34887852+mcafaro@users.noreply.github.com>

Closes #4321 from rdmello/ARROW-5329 and squashes the following commits:

1a14d83 <rdmello> Updating README.md with instructions for building directly using MATLAB
a685bce <Mark Cafaro> Switched from MATLAB char arrays to strings
39e8e2a <Mark Cafaro> Changed MATLAB MEX compilation to use RPATH only on UNIX systems
a90af5a <Mark Cafaro> Changed MATLAB variable names to be more clear
f9e1aee <Mark Cafaro> Fixed MATLAB variable name
0372982 <Mark Cafaro> Added functions for MATLAB build support
kevingurney pushed a commit that referenced this pull request Dec 23, 2024
…n timezone (apache#45051)

### Rationale for this change

If the timezone database is present on the system, but does not contain a timezone referenced in a ORC file, the ORC reader will crash with an uncaught C++ exception.

This can happen for example on Ubuntu 24.04 where some timezone aliases have been removed from the main `tzdata` package to a `tzdata-legacy` package. If `tzdata-legacy` is not installed, trying to read a ORC file that references e.g. the "US/Pacific" timezone would crash.

Here is a backtrace excerpt:
```
#12 0x00007f1a3ce23a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f1a3ce39391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x00007f1a3f4accc4 in orc::loadTZDB(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
#15 0x00007f1a3f4ad392 in std::call_once<orc::LazyTimezone::getImpl() const::{lambda()#1}>(std::once_flag&, orc::LazyTimezone::getImpl() const::{lambda()#1}&&)::{lambda()#2}::_FUN() () from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#16 0x00007f1a4298bec3 in __pthread_once_slow (once_control=0xa5ca7c8, init_routine=0x7f1a3ce69420 <__once_proxy>) at ./nptl/pthread_once.c:116
apache#17 0x00007f1a3f4a9ad0 in orc::LazyTimezone::getEpoch() const ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#18 0x00007f1a3f4e76b1 in orc::TimestampColumnReader::TimestampColumnReader(orc::Type const&, orc::StripeStreams&, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#19 0x00007f1a3f4e84ad in orc::buildReader(orc::Type const&, orc::StripeStreams&, bool, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#20 0x00007f1a3f4e8dd7 in orc::StructColumnReader::StructColumnReader(orc::Type const&, orc::StripeStreams&, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#21 0x00007f1a3f4e8532 in orc::buildReader(orc::Type const&, orc::StripeStreams&, bool, bool, bool) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#22 0x00007f1a3f4925e9 in orc::RowReaderImpl::startNextStripe() ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#23 0x00007f1a3f492c9d in orc::RowReaderImpl::next(orc::ColumnVectorBatch&) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
apache#24 0x00007f1a3e6b251f in arrow::adapters::orc::ORCFileReader::Impl::ReadBatch(orc::RowReaderOptions const&, std::shared_ptr<arrow::Schema> const&, long) ()
   from /tmp/arrow-HEAD.ArqTs/venv-wheel-3.12-manylinux_2_17_x86_64.manylinux2014_x86_64/lib/python3.12/site-packages/pyarrow/libarrow.so.1900
```

### What changes are included in this PR?

Catch C++ exceptions when iterating ORC batches instead of letting them slip through.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40633

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/arrow that referenced this pull request Jul 7, 2025
…ther directly within MATLAB

The MATLAB interface to Feather currently uses CMake to build MEX files. It would be convenient to be able to build the MEX file used by the MATLAB interface to Feather directly using normal MATLAB commands.

This will also provide a workaround for MEX compilation issues when using older CMake versions with newer versions of MATLAB (R2018b and beyond).

The commits in the pull request add a new `build_support` folder to the MATLAB subfolder in the Arrow repository. This `build_support` folder contains two functions called `compile` and `test` that use the `ARROW_HOME` environment variable and the `mex` command to build the necessary MEX files.

For example:

``` matlab
>> cd build_support
>> compile
...lots of output...
>> test
...successfully passed all tests...
```

Thanks to Mark (@mcafaro) for implementing this and working through the initial review in mathworks/arrow#13

Author: Mark Cafaro <mark.cafaro@mathworks.com>
Author: rdmello <rylan.dmello@mathworks.com>
Author: Mark Cafaro <34887852+mcafaro@users.noreply.github.com>

Closes #4321 from rdmello/ARROW-5329 and squashes the following commits:

1a14d83b3 <rdmello> Updating README.md with instructions for building directly using MATLAB
a685bce91 <Mark Cafaro> Switched from MATLAB char arrays to strings
39e8e2a2b <Mark Cafaro> Changed MATLAB MEX compilation to use RPATH only on UNIX systems
a90af5a3d <Mark Cafaro> Changed MATLAB variable names to be more clear
f9e1aeed7 <Mark Cafaro> Fixed MATLAB variable name
03729828d <Mark Cafaro> Added functions for MATLAB build support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants