Fix: macOS ADIOS1 w/ cctools ld64 w/o XCode#1196
Open
ax3l wants to merge 2 commits intoopenPMD:devfrom
Open
Conversation
ax3l
commented
Feb 7, 2022
CMakeLists.txt
Outdated
| set_target_properties(openPMD.ADIOS1.Serial PROPERTIES | ||
| LINK_FLAGS "-Wl,--exclude-libs,ALL") | ||
| elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") | ||
| check_linker_flag(CXX "-Wl,--exclude-libs,ALL" DARWIN_WO_XCODE) |
Member
Author
There was a problem hiding this comment.
This might be a CMake 3.18+ feature:
- https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4777
- https://cmake.org/cmake/help/latest/module/CheckLinkerFlag.html
Thus:
- need to bump CMake dependency from 3.15+ to 3.18+
Member
Author
There was a problem hiding this comment.
Also: should use LINKER::
Expands to -Wl,--... on GCC and to -Xlinker --... on Clang.
ec470ef to
f6ed2ef
Compare
478aade to
972498c
Compare
ax3l
commented
Feb 8, 2022
| set(IO_ADIOS1_SEQUENTIAL_SOURCE | ||
| src/Error.cpp | ||
| src/auxiliary/Filesystem.cpp | ||
| src/auxiliary/JSON.cpp |
Member
Author
There was a problem hiding this comment.
Needed because TracingJSON is now used in CommonADIOS1IOHandler.cpp
9443d4b to
3a15872
Compare
ax3l
commented
Feb 8, 2022
| src/IO/ADIOS/CommonADIOS1IOHandler.cpp | ||
| src/IO/ADIOS/ADIOS1IOHandler.cpp) | ||
| src/IO/ADIOS/ADIOS1IOHandler.cpp | ||
| src/IO/IOTask.cpp) |
Member
Author
There was a problem hiding this comment.
Needed because we use openPMD::internal::operationAsString in CommonADIOS1IOHandler.cpp
59380d0 to
97cdc99
Compare
Some compiler toolchains on macOS do not use the XCode system compiler. For instance, conda-forge uses vanilla clang to build packages. In that case, the symbol hiding instructions we used on macOS were not effective, leading to errors like openPMD#1195. The current patch checks if the toolchain understands GCC/LLVM-ish linker flags on macOS and if it does, it adds them.
97cdc99 to
8e2e327
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some compiler toolchains on macOS do not use the XCode tools. For instance, conda-forge uses vanilla clang to build packages combined with a cctools
ld64(similar to the macOS system linker) but without XCode.In that case, the symbol hiding instructions we used on macOS were not effective, leading to errors like #1195.
This also fixes regressions from #1101, similar to #1167.
The current patch checks if the toolchain understands GCC/LLVM/ld64-ish linker flags on macOS and if it does, it adds them.
Attention
llvm-strip< 14 is also broken, which is used in Conda-Forgecompilers-CMAKE_STRIPshould usecctools'stripcommand (needs to be set manually): Conda: llvm-strip <= 13 broken on Apple aarch64 M1 AMReX-Codes/pyamrex#35