Comments (13)
It works on linux because -Wl,-no-undefined
isn't enabled.
If the event reader have to be part of the dictionary the undefined function implementations can be moved to the header file for example.
Or maybe creating a second dictionary for the readers that is then part of podioRootIO
from podio.
Thank, Andre,
I guess enabling -Wl,-no-undefined
is not really an option, as it would then crash at run time,
wouldn't it ?
In #79 I have moved all virtual functions to ROOTReader.h, which works but is a but ugly.
Maybe in the long run we should consider re-organizing the libraries properly.
Also, I had to add ROOT includes and library to TestDataModel.
from podio.
No, the flag is just for the linker, but on clang with a different linker it is a different flag
from podio.
Try
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
elseif ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ))
SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
else()
MESSAGE( WARNING "We do not test with the ${CMAKE_CXX_COMPILER_ID} compiler, use at your own discretion" )
endif()
from podio.
This is happily ignored by the linker:
cd /Users/gaede/podio/podio/build/src && /usr/local/Cellar/cmake/3.15.1/bin/cmake -E cmake_link_script CMakeFiles/podioDict.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/c++ -std=c++14 -stdlib=libc++ -O2 -g -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -Wl,-undefined,error -o libpodioDict.so -install_name @rpath/libpodioDict.so CMakeFiles/podioDict.dir/podioDict.cxx.o -Wl,-rpath,/Users/gaede/podio/podio/build/src -Wl,-rpath,/data/ilcsoft/root/6.18.04/lib libpodio.so /data/ilcsoft/root/6.18.04/lib/libTree.so /data/ilcsoft/root/6.18.04/lib/libImt.so /data/ilcsoft/root/6.18.04/lib/libNet.so /data/ilcsoft/root/6.18.04/lib/libRIO.so /data/ilcsoft/root/6.18.04/lib/libThread.so /data/ilcsoft/root/6.18.04/lib/libCore.so
Undefined symbols for architecture x86_64:
"podio::ROOTReader::~ROOTReader()", referenced from:
ROOT::delete_podiocLcLPythonEventStore(void*) in podioDict.cxx.o
ROOT::deleteArray_podiocLcLPythonEventStore(void*) in podioDict.cxx.o
ROOT::destruct_podiocLcLPythonEventStore(void*) in podioDict.cxx.o
ld: symbol(s) not found for architecture x86_64
from podio.
Did you add the code sniped I posted?
from podio.
Yes - as you can see in my post: -Wl,-undefined,error
is there ...
from podio.
That flag enables the error (or rather makes it explicit since error is the default value for the llvm/clang/macos linker), so with the current podio master this would be the expected output. To disable the error use -Wl,-undefined,warning
(https://stackoverflow.com/a/26989988)
from podio.
Miss-clicked
from podio.
This did not work either - finally -Wl,-undefined,dynamic_lookup
did the trick, see #81.
With warning I got:
ld: can't use -undefined warning or suppress with -twolevel_namespace
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anyways, I think that dynamic_lookup is what we really want and what we use on linux.
from podio.
I think we had a long discussion once in DD4hep and agreed that no-undefined
is what we really want :)
from podio.
I remember that we had this discussion for DD4hep and that we had concluded that we want no-undefined
but this does not work with podio (and the split of libraries) - see #81.
My understanding is that -Wl,-undefined,dynamic_lookup
causes the same behavior as the default on linux: allow the symbol to not be there when linking the library. It then later needs to be available at run time from some other library...
from podio.
... and this is the case with our current tests - in particular the python reading....
from podio.
Related Issues (20)
- Invalid files cause irrecoverable crashes in `ROOTReader::openFile(...)` HOT 2
- PODIO implicit plug-in mechanism is not robust enough
- type inconsistency between `Collection::size()` and index for const object accessors HOT 4
- Frames API to write collection metadata? HOT 2
- Add emplace_back to UserDataCollection
- ROOTFrameReader crash when reading multiple edm4hep files HOT 6
- New podio Tag without c++20 prohibition HOT 4
- Removal of deprecated EventStore and related components
- Mutability conversion fails on `push_back` to collection via Python bindings HOT 2
- Improve python interface when adding collections to a frame HOT 1
- In PODIO 00-16-05, `ROOTLegacyReader` can't read files written by 00-16-02 HOT 1
- `PODIO_JSON_OUTPUT` not set downstream, but json support still compiled into libraries HOT 5
- Misleading Error: Invalid Member Definition HOT 10
- Generated `id` method for user facing types has become useless
- Codify state machines of readers and writers
- Cleanup double `void*` in CollectionBuffers
- Better out-of-bounds checks for collection access
- Better import structure for python bindings
- Subset collections of datatypes with VectorMembers do not work HOT 1
- Generate ROOT dictionary of vector<XXXData> classes HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podio.