gcov error: Multiple sources for a single basic block - c++

When I invoke gcov as follows it returns the following error message:
gcov -a -p dynamic-maps.gcda
Multiple sources for a single basic block: <path-to-file>/dynamic-maps.cpp != (in _ZN16AnalysisPipeline16AnalysisServices22calculate_dynamic_mapsERKNSt3__110shared_ptrINS_6Common16AnalysisRegistryEEERKN9Utilities6ImagesERKNS3_10TimeSeriesERKNS3_14T1ParameterFitE).
Invalid .gcno File!
Please can someone explain what the cause of this might be.
gcov -version returns:
LLVM (http://llvm.org/):
LLVM version 3.4svn
Optimized build.
Default target: x86_64-apple-darwin13.4.0
Host CPU: core-avx-i
The file was compiled using Xcode 5.1 on OS X Mavericks with the following version of clang:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Updating Xcode to version 6.1.1 has resolved the issue.

Related

Why do `gcc -v` and `whereis gcc` output different paths?

I get the following output when I run respectively gcc -v and whereis gcc:
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
gcc: /usr/bin/gcc
Does this mean I have multiple installations of gcc on my mac ? If so, how do I uninstall the 'extra/unnecessary' ones ?
Thanks

i want to use g++ but my mac uses clang

I want to compile my program which uses OpenMp on mac os Sierra. I have Xcode8. I do it via terminal: g++ -fopenmp -o train train.cpp. The next errors occur:
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
Tell me please how can I solve this problem.
clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

How to get the gcc version of .so file on OSX 10.11.6

On mac, Enter "gcc -v" in Terminal to get the gcc version as below.
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
How to get the gcc version used to generate the .so file? For example, I want to get the gcc version from a .so file on Mac.

Clang version confusion (OSX and Cmake)

I'm attempting to lock down the compiler version I use (for a number of reasons I won't go into). To do this, I'd like to check the version of the compiler on build using CMAKE_CXX_COMPILER_VERSION and CMAKE_CXX_COMPILER_VERSION.
On OSX CMake reports:
CMAKE_CXX_COMPILER_VERSION 7.0.2.7000181
CMAKE_CXX_COMPILER_ID Clang
CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
However, the version reported via terminal is:
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
This is true of:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ --version
clang --version
gcc --version
g++ --version
Why the discrepancy in version numbers as reported by CMake and the command line (for the same executable)?
And for the purposes of restricting to a particular compiler version, is CMAKE_CXX_COMPILER_VERSION reliable?
Turns out CMake sets the compiler version in CMakeFiles/3.5.0/CmakeCXXCompiler.cmake (for version 3.5.0). Only by deleting this file and re-building is the correct compiler version reported (assuming you had a different one installed at some point).

Not able to use C++14 features( bind,lambdas,etc and getting C++11extension warning) after installing gcc49?

It shows that gcc49 is active:
$ port select --list gcc
Available versions for gcc:
mp-gcc49 (active)
none
but version is still 4.2.1,
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
How do i fix this?