I'm trying to build the simplest OpenMP or OpenACC C++ program with GPU offload using gcc-10, CUDA 11 on Ubuntu 18.04 and this CMakeLists.txt file (or OpenMP version):
cmake_minimum_required(VERSION 3.18)
project(hello VERSION 0.1.0)
find_package(OpenACC REQUIRED)
add_executable(hello main.cpp)
target_compile_options(hello PRIVATE -O3 -fopenacc -foffload=nvptx-none)
target_link_libraries (hello OpenACC::OpenACC_CXX)
The build fails with:
[build] [100%] Linking CXX executable hello
[build] /usr/local/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1
[build] /usr/bin/g++-10 -O3 -DNDEBUG -fopenacc CMakeFiles/hello.dir/main.cpp.o -o hello
[build] ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'
[build] nvptx-as: ptxas returned 255 exit status
[build] mkoffload: fatal error: /usr/bin/x86_64-linux-gnu-accel-nvptx-none-gcc-10 returned 1 exit status
[build] compilation terminated.
I suspect that a flag defining GPU architecture is missing, but I can't find relevant documentation. Offloading Support in GCC: Compilation options don't have Nvidia example and when I try my best guess -foffload="-arch=sm_75" or -foffload=nvidia-"-arch=sm_75", I get:
[build] [ 50%] Building CXX object CMakeFiles/hello.dir/main.cpp.o
[build] /usr/local/bin/cmake -E time /usr/bin/g++-10 -DFMT_LOCALE -O3 -DNDEBUG -O3 -fopenacc -foffload=nvptx-none -foffload=\"-arch=sm_75\" -std=gnu++2a -o CMakeFiles/hello.dir/main.cpp.o -c /home/paul/st/hello/main.cpp
[build] g++-10: fatal error: GCC is not configured to support "-arch as offload target
[build] compilation terminated.
Any clues or relevant links will be highly appreciated.
Related
I'm required to install the Dune library for my "Partial Differential Equation" lecture and am stuck. I'm on a MacBook and we received an installation script (for Linux), but I always get an error that my Gfortran and g++ compiler is not compatible.
I've researched similar errors and some could be fixed by deleting the CMake cache, but I'm not sure and don't want to screw up the folder structure.
The error code looks like this:
matthias#MacBookPro ~/Documents/studium_matthias/semester_7/num_2/dune$ ./buildmodules.sh
build common
----- using default flags $CMAKE_FLAGS from /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release.opts -----
--- going to build dune-common ---
--- calling all for dune-common ---
--- calling vcsetup for dune-common ---
--- calling configure for dune-common ---
cmake -DDUNE_BUILD_DIRECTORY_ROOT_PATH='/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build' -DCMAKE_C_COMPILER='/usr/bin/gcc' -DCMAKE_CXX_COMPILER='/usr/bin/g++' -DCMAKE_Fortran_COMPILER='/usr/local/bin/gfortran' -DCMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG -g0 -funroll-loops -ftemplate-depth=5120 -march=native -Wa,-q' -DHDF5_ROOT=/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/external/hdf5 -DFFTW3_ROOT_DIR=/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/external/fftw3 -DCMAKE_BUILD_TYPE=Release -DDUNE_SYMLINK_TO_SOURCE_TREE=1 "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/dune-common"
CMake Error at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface.cmake:383 (message):
The Fortran compiler:
/usr/local/bin/gfortran
and the CXX compiler:
/usr/bin/g++
failed to compile a simple test project using both languages. The output
was:
Change Dir: /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX
Run Build Command(s):/usr/bin/make VerifyFortranC && /usr/local/Cellar/cmake/3.15.5/bin/cmake -S/usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify -B/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 VerifyFortranC
/usr/local/Cellar/cmake/3.15.5/bin/cmake -S/usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify -B/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_progress_start /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles 6
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/VerifyFortranC.dir/all
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/depend
cd /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortran.dir/DependInfo.cmake
Scanning dependencies of target VerifyFortran
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/build
[ 16%] Building Fortran object CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
/usr/local/bin/gfortran -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -O3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f -o CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
[ 33%] Linking Fortran static library libVerifyFortran.a
/usr/local/Cellar/cmake/3.15.5/bin/cmake -P CMakeFiles/VerifyFortran.dir/cmake_clean_target.cmake
/usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortran.dir/link.txt --verbose=1
/usr/bin/ar qc libVerifyFortran.a CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
/usr/bin/ranlib libVerifyFortran.a
[ 33%] Built target VerifyFortran
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/depend
cd /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortranC.dir/DependInfo.cmake
Scanning dependencies of target VerifyFortranC
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/build
[ 50%] Building C object CMakeFiles/VerifyFortranC.dir/main.c.o
/usr/bin/gcc -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/main.c.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/main.c
[ 66%] Building C object CMakeFiles/VerifyFortranC.dir/VerifyC.c.o
/usr/bin/gcc -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyC.c
[ 83%] Building CXX object CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o
/usr/bin/g++ -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -std=c++17 -O3 -DNDEBUG -g0 -funroll-loops -ftemplate-depth=5120 -march=native -Wa,-q -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyCXX.cxx
clang: error: unsupported argument '-q' to option 'Wa,'
make[3]: *** [CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o] Error 1
make[2]: *** [CMakeFiles/VerifyFortranC.dir/all] Error 2
make[1]: *** [CMakeFiles/VerifyFortranC.dir/rule] Error 2
make: *** [VerifyFortranC] Error 2
Call Stack (most recent call first):
cmake/modules/DuneMacros.cmake:710 (FortranCInterface_VERIFY)
CMakeLists.txt:17 (dune_project)
-- Configuring incomplete, errors occurred!
See also "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/CMakeOutput.log".
See also "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/CMakeError.log".
--- Failed to build dune-common ---
Terminating dunecontrol due to previous errors!
How can I approach this?
As #squareskittles pointed out in the comments, the error arised from the unsupported argument -q to Wa,. This tells the compiler (gcc!) to pass the option -q to the assembler.
This option is not supported by clang. which gcc told me gcc was installed and located at /usr/bin/gcc but further inspection showed that it was just a symlink to clang - even though I had gcc installed via homebrew (located at /usr/local/bin/gcc-9).
In the installation file I was able to change the path of used compiler to the gcc installation (g++ was linked to clang, and I replaced it as well). From that point on the -q argument to Wa was valid the installation process went without further errors.
it will fine install dune core modules using homebrew package manager for your system. From now is available 2.7.1. https://github.com/dune-copasi/homebrew-tap
I am trying to compile some software that contains a compile.sh shell script. When I run the script, the software fails to compile due to what it reports as a broken C compiler.
I have tried reinstalling C compilers, both within and outside of conda, to no avail.
Below, please find the output of running the compile shell script
(base) userA#server:~/SPAdes-3.13.0-dev$ ./spades_compile.sh
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -- broken
CMake Error at /home/userA/anaconda3/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_708f4/fast
/usr/bin/make -f CMakeFiles/cmTC_708f4.dir/build.make CMakeFiles/cmTC_708f4.dir/build
make[1]: Entering directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -o CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -c /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_708f4
/home/userA/anaconda3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_708f4.dir/link.txt --verbose=1
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -rdynamic CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -o cmTC_708f4
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find crtbeginS.o: No such file or directory
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_708f4.dir/build.make:86: recipe for target 'cmTC_708f4' failed
make[1]: *** [cmTC_708f4] Error 1
make[1]: Leaving directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_708f4/fast' failed
make: *** [cmTC_708f4/fast] Error 2
CMake will not be able to correctly generate this project.
Expected result: properly compiled software
Actual result: report of a broken C compiler
I am trying to install FFTW on my mac with OpenMP enabled. I initially had trouble configuring, but that issue was solved here.
Now after configuring I type "make" and I get the following error:
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../kernel -I../dft -I../rdft -I../api -I../tests -I../libbench2 -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -Wa,-q -Wl,-no_compact_unwind -MT any-true.lo -MD -MP -MF .deps/any-true.Tpo -c any-true.c -o any-true.o
clang: error: unknown argument: '-malign-double'
clang: warning: -Wl,-no_compact_unwind: 'linker' input unused
clang: error: unsupported argument '-q' to option 'Wa,'
clang: warning: optimization flag '-fno-schedule-insns' is not supported
make[3]: *** [any-true.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
What is the issue here and how can I solve it?
You could try passing the location of the gcc compiler its absolute path rather than the binary name, just as
CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 ./configure --enable-mpi --enable-threads --enable-openmp
EDIT
After having a brief chat with OP, it looks like he omitted part of the error and the error came from the mpicc compiler used (due to --enable-mpi in the configure stage). According to the user, they were using OpenMPI and according to this FAQ the user can tune the C compiler by using the OMPI_CC environtment variable. So my suggestion was to build the FFTW library as
OMPI_CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 make
I am trying to compile luabind which I got from this link. After I do
mkdir build
cmake ..
make VERBOSE=1
"cmake .." produces these lines,
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- 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++-4.7
-- Check for working CXX compiler: /usr/bin/g++-4.7 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Found Lua52: /usr/lib/i386-linux-gnu/liblua5.2.so;/usr/lib/i386-linux-gnu/libm.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mwh/Desktop/Downloads/luabind-master/build
"make VERBOSE=1" produces following errors.
/usr/bin/cmake -H/home/mwh/Desktop/Downloads/luabind-master -B/home/mwh/Desktop/Downloads/luabind-master/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make -f src/CMakeFiles/luabind.dir/build.make src/CMakeFiles/luabind.dir/depend
make[2]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
cd /home/mwh/Desktop/Downloads/luabind-master/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mwh/Desktop/Downloads/luabind-master /home/mwh/Desktop/Downloads/luabind-master/src /home/mwh/Desktop/Downloads/luabind-master/build /home/mwh/Desktop/Downloads/luabind-master/build/src /home/mwh/Desktop/Downloads/luabind-master/build/src/CMakeFiles/luabind.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make -f src/CMakeFiles/luabind.dir/build.make src/CMakeFiles/luabind.dir/build
make[2]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
/usr/bin/cmake -E cmake_progress_report /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles 2
[ 1%] Building CXX object src/CMakeFiles/luabind.dir/class.cpp.o
cd /home/mwh/Desktop/Downloads/luabind-master/build/src && /usr/bin/g++-4.7 -I/usr/local/include -I/usr/include/lua5.2 -I/home/mwh/Desktop/Downloads/luabind-master -o CMakeFiles/luabind.dir/class.cpp.o -c /home/mwh/Desktop/Downloads/luabind-master/src/class.cpp
In file included from /home/mwh/Desktop/Downloads/luabind-master/luabind/object.hpp:38:0,
from /home/mwh/Desktop/Downloads/luabind-master/luabind/scope.hpp:28,
from /home/mwh/Desktop/Downloads/luabind-master/luabind/class.hpp:92,
from /home/mwh/Desktop/Downloads/luabind-master/src/class.cpp:30:
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp: In member function ‘T luabind::detail::enum_converter::apply(lua_State*, luabind::detail::by_value<T>, int)’:
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:498:21: error: ‘underlying_type’ in namespace ‘std’ does not name a type
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected type-specifier before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected ‘>’ before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected ‘(’ before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: ‘integral_t’ was not declared in this scope
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:83: error: expected ‘)’ before ‘;’ token
make[2]: *** [src/CMakeFiles/luabind.dir/class.cpp.o] Error 1
make[2]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make[1]: *** [src/CMakeFiles/luabind.dir/all] Error 2
make[1]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make: *** [all] Error 2
What shall I do to correct this problem? I am using gcc 4.7.3, boost 1.53, Lua 5.2 in Ubuntu 12.04. Please help.
I just checked out the project at revision 05c84a034e and built it on Mac OS X. Here's what CMake told me at configure time:
-- The CXX compiler identification is GNU 4.7.3
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /opt/local/bin/g++ -- works
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Found Lua52: /opt/local/lib/liblua.dylib;
So I have GCC 4.7.3, Boost 1.53, and Lua 5.2. I see you have GCC 4.7.3 also, but what about Boost and Lua?
Edit: Here's my compilation line from make VERBOSE=1 for the first file:
g++ -Wall -std=c++11 -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wno-deprecated-declarations -o CMakeFiles/luabind.dir/class.cpp.o -c class.cpp
You on the other hand show this:
g++-4.7 -o CMakeFiles/luabind.dir/class.cpp.o -c class.cpp
So the question is, where did all your compiler flags go? The top-level CMakeLists.txt should contain this:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
And a bunch more. Since you aren't getting those flags set, you need to figure out why. You might try adding some message("I am here") debug statements in your CMakeLists.txt and running cmake again from scratch to see if the expected parts of the configuration are being executed at all. The key thing here is that your compilation line lacks -std=c++11--that's why you get the error you have.
I am getting this error when building wxWidgets in Cygwin:
../src/generic/dirctrlg.cpp:67:24: fatal error: direct.h: No such file or directory
compilation terminated.
make: *** [corelib_dirctrlg.o] Error 1
T_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxWidgets-2.8.12/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I../include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ../src/generic/dirctrlg.cpp
Makefile:28340: recipe for target `corelib_dirctrlg.o' failed
I followed the instructions included in wxWidgets for Windows using configure in install.txt(Compiling wxWidgets).
Which compiler do you use? See http://wxwidgets.blogspot.com/2011/06/choosing-gcc-for-building-wxwidgets.html for some of the choices you have. FWIW direct.h should be present in MinGW compiler headers.