mavak / trucov

True coverage tool for C / C++
1 stars 1 forks source link

Installation Instructions for Mac-OSX 10.7 (Lion) #177

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download/unpack source, cd into trucov_10.1/
2. cmake .
3. make

What is the expected output? What do you see instead?
Expected output is a compile log that generates a trucov binary.  The actual 
output is this:

In file included from /Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:36:
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:51:37: error: 
boost/program_options.hpp: No such file or directory
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:52:32: error: 
boost/filesystem.hpp: No such file or directory
In file included from 
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:56,
                 from /Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:36:
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:55:43: error: 
boost/filesystem/operations.hpp: No such file or directory
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:56:37: error: 
boost/filesystem/path.hpp: No such file or directory
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:57:30: error: 
boost/progress.hpp: No such file or directory
In file included from 
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:56,
                 from /Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:36:
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:63: error: 
‘boost’ has not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:63: error: 
‘filesystem’ is not a namespace-name
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:63: error: 
expected namespace-name before ‘;’ token
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:272: error: 
‘fs’ has not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:272: error: ISO 
C++ forbids declaration of ‘path’ with no type
/Users/gfarrand/Code/Tools/trucov_10.1/include/tru_utility.h:272: error: 
expected ‘;’ before ‘m_curr_dir’
In file included from /Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:36:
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:58: error: ‘boost’ 
has not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:58: error: 
‘filesystem’ is not a namespace-name
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:58: error: expected 
namespace-name before ‘;’ token
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:59: error: ‘boost’ 
has not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:59: error: 
‘program_options’ is not a namespace-name
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:59: error: expected 
namespace-name before ‘;’ token
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:150: error: ‘po’ 
has not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/include/config.h:150: error: expected 
‘,’ or ‘...’ before ‘vm’
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:134: error: ‘bool 
Config::initialize’ is not a static member of ‘class Config’
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:134: error: ‘po’ has 
not been declared
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:134: error: expected 
primary-expression before ‘int’
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:134: error: expected 
primary-expression before ‘char’
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:134: error: initializer 
expression list treated as compound expression
/Users/gfarrand/Code/Tools/trucov_10.1/src/config.cpp:135: error: expected 
‘,’ or ‘;’ before ‘{’ token
make[2]: *** [CMakeFiles/trucov_lib.dir/src/config.cpp.o] Error 1
make[1]: *** [CMakeFiles/trucov_lib.dir/all] Error 2
make: *** [all] Error 2

Boost is installed in /opt/local/include/boost/...
Looking for program_options.hpp gets me here:
/opt/local/include/boost//program_options.hpp - and the file has expected 
contents.

What version of the product are you using? On what operating system?
trucov 10.1, on Mac OSX 10.7.4

Please provide any additional information below.
Since gcc on the mac is not actually gcc (it's llvm), there may be an issue.  I 
compiled & installed gcc 4.6.2 from source.  After that, I was able to build a 
test binary with gcov awareness.  Then, I generated the .gcov and .gcda files 
and ran the gcov-4.6.2 executable to view my code coverage - not pretty, but it 
worked.

So my question is two-fold:
1.  How can I resolve this build failure?
2.  How can I teach the cmake environment to use the 'real' gcc that has gcov 
support (installed in $HOME/raw_gcc), instead of the 'fake' gcc that lives in 
/usr/bin/gcc?

Original issue reported on code.google.com by grant.fa...@gmail.com on 4 Sep 2012 at 7:27

GoogleCodeExporter commented 9 years ago
Here is the output from the "cmake ." command:

ApplePie:trucov_10.1 gfarrand$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Welcome to Trucov 10.1
Compiling with Build Type = Release
  1) To compile in Release mode: cmake -DCMAKE_BUILD_TYPE=Release
  2) To compile in Debug mode:   cmake -DCMAKE_BUILD_TYPE=Debug
Coverage Profiling = Disabled
  1) To compile with coverage profiling:    cmake -DCOVERAGE=On
  2) To compile without coverage profiling: cmake -DCOVERAGE=Off
Compiling with debug option enabled.
  1) To compile with debug option enabled:  cmake -DDEBUGFLAG=On
  2) To compile with debug option disabled: cmake -DDEBUGFLAG=Off
Assuming newer version of boost.
  1) To compile with newer versions of boost: cmake -DBOOST_VERSION=New
  2) To compile with older versions of boost: cmake -DBOOST_VERSION=Old
  If boost fails to link, attempt to compile with the older version of boost.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/gfarrand/Code/Tools/trucov_10.1

Original comment by grant.fa...@gmail.com on 4 Sep 2012 at 7:28