Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: macOS ADIOS1 w/ cctools ld64 w/o XCode #1196

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Feb 7, 2022

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

CMakeLists.txt Outdated
@@ -563,6 +563,11 @@ if(openPMD_HAVE_ADIOS1)
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)
Copy link
Member Author

Choose a reason for hiding this comment

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

This might be a CMake 3.18+ feature:

Thus:

  • need to bump CMake dependency from 3.15+ to 3.18+

Copy link
Member Author

Choose a reason for hiding this comment

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

Also: should use LINKER::
Expands to -Wl,--... on GCC and to -Xlinker --... on Clang.

@ax3l ax3l force-pushed the fix-macOSwithNonXcodeSymbolHidingADIOS1 branch 8 times, most recently from ec470ef to f6ed2ef Compare February 8, 2022 00:58
@ax3l ax3l force-pushed the fix-macOSwithNonXcodeSymbolHidingADIOS1 branch 2 times, most recently from 478aade to 972498c Compare February 8, 2022 01:01
@@ -459,6 +459,7 @@ set(IO_SOURCE
set(IO_ADIOS1_SEQUENTIAL_SOURCE
src/Error.cpp
src/auxiliary/Filesystem.cpp
src/auxiliary/JSON.cpp
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed because TracingJSON is now used in CommonADIOS1IOHandler.cpp

@ax3l ax3l force-pushed the fix-macOSwithNonXcodeSymbolHidingADIOS1 branch 2 times, most recently from 9443d4b to 3a15872 Compare February 8, 2022 01:39
src/ChunkInfo.cpp
src/IO/ADIOS/CommonADIOS1IOHandler.cpp
src/IO/ADIOS/ADIOS1IOHandler.cpp)
src/IO/ADIOS/ADIOS1IOHandler.cpp
src/IO/IOTask.cpp)
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed because we use openPMD::internal::operationAsString in CommonADIOS1IOHandler.cpp

@ax3l ax3l force-pushed the fix-macOSwithNonXcodeSymbolHidingADIOS1 branch 3 times, most recently from 59380d0 to 97cdc99 Compare February 8, 2022 06:23
@ax3l ax3l changed the title Fix: macOS ADIOS1 w/o XCode Fix: macOS ADIOS1 w/ cctools ld64 w/o XCode Feb 8, 2022
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.
@ax3l ax3l modified the milestones: 0.14.5, 0.14.6 May 25, 2022
@ax3l ax3l modified the milestones: 0.14.6, 0.14.7 Jun 8, 2022
@ax3l ax3l modified the milestones: 0.14.7, 0.14.6 Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant