You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Duplicate symbol errors occur when the pcm utilities from the root directory are compiled:
make
c++ -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x -c pcm-numa.cpp -o pcm-numa.o
c++ -MM -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x pcm-numa.cpp > pcm-numa.d
c++ -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x -c msr.cpp -o msr.o
[...]
duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::operator=(std::initializer_list<TopologyEntry>) in:
pcm-numa.o
utils.o
duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::assign(std::initializer_list<TopologyEntry>) in:
pcm-numa.o
utils.o
duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::insert(__gnu_cxx::__normal_iterator<TopologyEntry const*, std::vector<TopologyEntry, std::allocator<TopologyEntry> > >, std::initializer_list<TopologyEntry>) in:
pcm-numa.o
utils.o
ld: 522 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [pcm-numa.x] Error 1
For some reason the following lines are defined in cpucounters.h and must be removed in order to compile the utilities without duplicate symbol errors:
#ifndef HACK_TO_REMOVE_DUPLICATE_ERROR
template class PCM_API std::allocator<TopologyEntry>;
template class PCM_API std::vector<TopologyEntry>;
template class PCM_API std::allocator<CounterWidthExtender *>;
template class PCM_API std::vector<CounterWidthExtender *>;
template class PCM_API std::allocator<uint32>;
template class PCM_API std::vector<uint32>;
template class PCM_API std::allocator<char>;
#endif
Alternatively HACK_TO_REMOVE_DUPLICATE_ERROR must be defined somewhere for these lines to be silent during compilation (which is actually something already in place when compiling MacMSRDriver lib and driver).
When the above lines are removed (AFTER compiling the libPcmMsr.dylib from the MacMSRDriver directory) the utilities are compiled successfully.
The text was updated successfully, but these errors were encountered:
Duplicate symbol errors occur when the pcm utilities from the root directory are compiled:
For some reason the following lines are defined in cpucounters.h and must be removed in order to compile the utilities without duplicate symbol errors:
Alternatively HACK_TO_REMOVE_DUPLICATE_ERROR must be defined somewhere for these lines to be silent during compilation (which is actually something already in place when compiling MacMSRDriver lib and driver).
When the above lines are removed (AFTER compiling the libPcmMsr.dylib from the MacMSRDriver directory) the utilities are compiled successfully.
The text was updated successfully, but these errors were encountered: