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 compilation for G++4.7 on Ubuntu 13.04 #1

Merged
merged 1 commit into from
Jul 25, 2013
Merged

Fix compilation for G++4.7 on Ubuntu 13.04 #1

merged 1 commit into from
Jul 25, 2013

Conversation

bcachet
Copy link
Contributor

@bcachet bcachet commented Jul 25, 2013

Ubuntu is shipped with G++4.7
To run Bandit specs with G++4.7, I needed to:

  • update compile flags via CMakeLists.txt
  • add header to bandit.h (otherwise, got and error with assertion_exception.h)
  • add <string.h> header to specs/util/argv_helper.h in order to use strlen

Ubuntu is shipped with G++4.7
To run Bandit specs with G++4.7, I needed to:
 * update compile flags via CMakeLists.txt
 * add <stdexcept> header to bandit.h (otherwise, got and error with assertion_exception.h)
 * add <string.h> header to specs/util/argv_helper.h in order to use strlen
@bcachet
Copy link
Contributor Author

bcachet commented Jul 25, 2013

On Ubuntu 13.04, the patch works for both G++4.7 and Clang++3.2

With Clang

mkdir build-clang; cd build-clang; CC=clang CXX=clang++ cmake ..;make
-- The C compiler identification is Clang 3.2.0
-- The CXX compiler identification is Clang 3.2.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bertrand/Desktop/bandit/build-clang
Scanning dependencies of target bandit-specs
[ 12%] Building CXX object CMakeFiles/bandit-specs.dir/specs/synopsis.spec.cpp.o
[ 25%] Building CXX object CMakeFiles/bandit-specs.dir/specs/before_each_after_each.spec.cpp.o
[ 37%] Building CXX object CMakeFiles/bandit-specs.dir/specs/describe.spec.cpp.o
[ 50%] Building CXX object CMakeFiles/bandit-specs.dir/specs/fuzzbox.spec.cpp.o
[ 62%] Building CXX object CMakeFiles/bandit-specs.dir/specs/main.cpp.o
[ 75%] Building CXX object CMakeFiles/bandit-specs.dir/specs/run.spec.cpp.o
[ 87%] Building CXX object CMakeFiles/bandit-specs.dir/specs/it.spec.cpp.o
[100%] Building CXX object CMakeFiles/bandit-specs.dir/specs/reporters/dots_reporter.spec.cpp.o
Linking CXX executable bin/bandit-specs
.......................................
Test run complete. 39 tests run. 39 succeeded.
[100%] Built target bandit-specs

With GCC

mkdir build-gcc; cd build-gcc; CC=gcc CXX=g++ cmake ..;make
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- 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
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bertrand/Desktop/bandit/build-gcc
Scanning dependencies of target bandit-specs
[ 12%] Building CXX object CMakeFiles/bandit-specs.dir/specs/synopsis.spec.cpp.o
[ 25%] Building CXX object CMakeFiles/bandit-specs.dir/specs/before_each_after_each.spec.cpp.o
[ 37%] Building CXX object CMakeFiles/bandit-specs.dir/specs/describe.spec.cpp.o
[ 50%] Building CXX object CMakeFiles/bandit-specs.dir/specs/fuzzbox.spec.cpp.o
[ 62%] Building CXX object CMakeFiles/bandit-specs.dir/specs/main.cpp.o
[ 75%] Building CXX object CMakeFiles/bandit-specs.dir/specs/run.spec.cpp.o
[ 87%] Building CXX object CMakeFiles/bandit-specs.dir/specs/it.spec.cpp.o
[100%] Building CXX object CMakeFiles/bandit-specs.dir/specs/reporters/dots_reporter.spec.cpp.o
Linking CXX executable bin/bandit-specs
.......................................
Test run complete. 39 tests run. 39 succeeded.
[100%] Built target bandit-specs

@joakimkarlsson joakimkarlsson merged commit 65a4b15 into banditcpp:master Jul 25, 2013
@joakimkarlsson
Copy link
Collaborator

I'm running on Mac OS with clang 4.2.0. I need the -stdlib=libc++ flag.

I just pushed a version where I try to make that flag conditional of whether the compiler supports them or not.

35a68a7

Does that work for you?

@bcachet
Copy link
Contributor Author

bcachet commented Jul 26, 2013

It works with GCC47 but not with Clang3.2
For Clang3.2, removing the -stdlib=libc++ flag allow me to build and run specs.
With -stdlib=libc++ flag, build failed because it doesn't find , headers

sbeyer pushed a commit to ogdf/bandit that referenced this pull request Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants