Skip to content

[native] Resolve antlr dependency for CTest on Apple Silicon#21374

Closed
czentgr wants to merge 1 commit intoprestodb:masterfrom
czentgr:cz_test_mac_m1
Closed

[native] Resolve antlr dependency for CTest on Apple Silicon#21374
czentgr wants to merge 1 commit intoprestodb:masterfrom
czentgr:cz_test_mac_m1

Conversation

@czentgr
Copy link
Contributor

@czentgr czentgr commented Nov 13, 2023

Description

On Apple M1 antlr is installed to /usr/local/lib. When running Ctest (e.g. make unittest) some tests fail due to antlr library not being found. Executing the tests manually on a terminal works as expected. The issue is only in Ctest. Setting the DYLD_LIBRARY_PATH explicitly in the environment does not resolve the issue and the CMakeLists.txt for each affected test needs to be modified.

Motivation and Context

This fixes an issue when attempting to run the unittests on Apple Silicon.

Error produced for one of the tests

2/8 Test #6: presto_server_test ...............Subprocess aborted***Exception:   0.05 sec
dyld[49652]: Library not loaded: libantlr4-runtime.4.9.3.dylib
  Referenced from: <5641000F-DB8B-371C-84CE-C248C2A7B353> /Users/czentgr/gitspace/presto/presto-native-execution/_build/debug/presto_cpp/main/tests/presto_server_test
  Reason: tried: 'libantlr4-runtime.4.9.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibantlr4-runtime.4.9.3.dylib' (no such file), 'libantlr4-runtime.4.9.3.dylib' (no such file), '/Users/czentgr/gitspace/presto/presto-native-execution/presto_cpp/main/tests/libantlr4-runtime.4.9.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/czentgr/gitspace/presto/presto-native-execution/presto_cpp/main/tests/libantlr4-runtime.4.9.3.dylib' (no such file), '/Users/czentgr/gitspace/presto/presto-native-execution/presto_cpp/main/tests/libantlr4-runtime.4.9.3.dylib' (no such file)

Impact

No external impact.

Test Plan

N/A

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@czentgr czentgr added the tests label Nov 13, 2023
@czentgr czentgr force-pushed the cz_test_mac_m1 branch 2 times, most recently from 7550041 to c07fadd Compare November 13, 2023 22:02
@czentgr czentgr changed the title Resolve antlr dependency for CTest on Apple Silicon [native] Resolve antlr dependency for CTest on Apple Silicon Nov 13, 2023
On Apple M1 antlr is installed to /usr/local/lib. When running Ctest (e.g. make unittest)
some tests fail due to antlr library not being found.
Executing the tests manually on a terminal works as expected. The issue is only in Ctest.
Setting the DYLD_LIBRARY_PATH explicitly in the environment does not resolve the issue and
the CMakeLists.txt for each affected test needs to be modified.
@czentgr czentgr marked this pull request as ready for review November 14, 2023 16:06
@czentgr czentgr requested a review from a team as a code owner November 14, 2023 16:06
@czentgr czentgr requested a review from majetideepak November 14, 2023 16:31
@majetideepak
Copy link
Collaborator

@czentgr I am working towards replacing Antlr with Velox TypeParser here #21357.
We might not need this PR then.

@czentgr
Copy link
Contributor Author

czentgr commented Nov 29, 2023

@majetideepak Thanks! Not sure why this suddenly became a problem on the Silicon Apple Macs. Anyway, lets keep this PR as a workaround for anyone looking and close it once your PR got merged.

@majetideepak
Copy link
Collaborator

@czentgr #21357 is now merged.

@ethanyzhang
Copy link
Contributor

@czentgr shall we close this then?

@czentgr
Copy link
Contributor Author

czentgr commented Dec 11, 2023

@yzhang1991 Yup, thanks. I Was investigating an issue running the tests from the makefile which was identified by Deepak (including a solution) today as well. But I confirmed that this PR can be closed.

@czentgr czentgr deleted the cz_test_mac_m1 branch July 31, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants