After fixing mex.cmake to properly pass the mex compile flags, i'm getting a compile error on one of my 6 test machines. A quick google search only suggested -std=c++0x, but that's already in the compiler flags. Andres - it's in your code - can you have a look?
[ 58%] Building CXX object systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o
cd /home/russt/locomotion/drake-distro/drake/pod-build/systems/plants && /usr/local/bin/c++ -DHandCmex_EXPORTS -Wreturn-type -Wuninitialized -Wunused-variable -std=c++0x -O3 -DNDEBUG -fPIC -I/home/russt/locomotion/drake-distro/drake/pod-build/include -I/home/russt/locomotion/drake-distro/build/include -I/home/russt/locomotion/drake-distro/drake/pod-build/lcmgen -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/russt/locomotion/drake-distro/build/include/eigen3 -I/usr/local/MATLAB/R2012b/extern/include -I/usr/local/MATLAB/R2012b/simulink/include -I/home/russt/locomotion/drake-distro/drake/util -I/home/russt/locomotion/drake-distro/drake/systems/plants/tinyxml -I/home/russt/locomotion/drake-distro/build/include/snopt -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -o CMakeFiles/HandCmex.dir/HandCmex.cpp.o -c /home/russt/locomotion/drake-distro/drake/systems/plants/HandCmex.cpp
In file included from /home/russt/locomotion/drake-distro/drake/systems/plants/RigidBodyManipulator.h:9:0,
from /home/russt/locomotion/drake-distro/drake/systems/plants/HandCmex.cpp:6:
/home/russt/locomotion/drake-distro/drake/systems/plants/collision/Model.h:69:3: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
/home/russt/locomotion/drake-distro/drake/systems/plants/collision/Model.h:71:3: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
In file included from /home/russt/locomotion/drake-distro/drake/systems/plants/HandCmex.cpp:6:0:
/home/russt/locomotion/drake-distro/drake/systems/plants/RigidBodyManipulator.h:185:3: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
make[3]: *** [systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o] Error 1
make[3]: Leaving directory `/home/russt/locomotion/drake-distro/drake/pod-build'
make[2]: *** [systems/plants/CMakeFiles/HandCmex.dir/all] Error 2
make[2]: Leaving directory `/home/russt/locomotion/drake-distro/drake/pod-build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/russt/locomotion/drake-distro/drake/pod-build'
make: *** [all] Error 2
a little more info:
russt@ubuntu:~/locomotion/drake-distro/drake$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
std::shared_ptr should be in <memory>, which is included in Model.h.
This compiled fine on my machine until I updated the cmake submodule - after that I get the same error you show above
that's good - at least it's reproducible
On Apr 12, 2014, at 10:00 AM, Andres Valenzuela [email protected] wrote:
std::shared_ptr should be in
, which is included in Model.h. This compiled fine on my machine until I updated the cmake submodule - after that I get the same error you show above
—
Reply to this email directly or view it on GitHub.
This error seems to appear in RobotLocomotion/cmake@6c27268. Not sure why that would change what standard library classes are available. Here are the compile commands that work and don't work:
THIS WORKS
[ 61%] Building CXX object systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o
cd /home/avalenzu/drc/software/drake/pod-build/systems/plants && /usr/lib/ccache/c++ -DHandCmex_EXPORTS -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wunused-variable -std=c++0x -O3 -DNDEBUG -fPIC -I/home/avalenzu/drc/software/drake/pod-build/include -I/home/avalenzu/drc/software/build/include -I/home/avalenzu/drc/software/drake/pod-build/lcmgen -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/avalenzu/drc/software/build/include/eigen3 -I/usr/local/MATLAB/R2013b/extern/include -I/usr/local/MATLAB/R2013b/simulink/include -I/home/avalenzu/drc/software/drake/util -I/home/avalenzu/drc/software/drake/systems/plants/tinyxml -I/home/avalenzu/drc/software/build/include/snopt -DMATLAB_MEX_FILE -o CMakeFiles/HandCmex.dir/HandCmex.cpp.o -c /home/avalenzu/drc/software/drake/systems/plants/HandCmex.cpp
THIS DOESN'T
[ 61%] Building CXX object systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o
cd /home/avalenzu/drc/software/drake/pod-build/systems/plants && /usr/lib/ccache/c++ -DHandCmex_EXPORTS -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wunused-variable -std=c++0x -O3 -DNDEBUG -fPIC -I/home/avalenzu/drc/software/drake/pod-build/include -I/home/avalenzu/drc/software/build/include -I/home/avalenzu/drc/software/drake/pod-build/lcmgen -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/avalenzu/drc/software/build/include/eigen3 -I/usr/local/MATLAB/R2013b/extern/include -I/usr/local/MATLAB/R2013b/simulink/include -I/home/avalenzu/drc/software/drake/util -I/home/avalenzu/drc/software/drake/systems/plants/tinyxml -I/home/avalenzu/drc/software/build/include/snopt -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -o CMakeFiles/HandCmex.dir/HandCmex.cpp.o -c /home/avalenzu/drc/software/drake/systems/plants/HandCmex.cpp
The difference is that the latter contains the following flags:
-ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32
If I update the cmake submodule, run make, let the build fail, and then manually enter the compile command without those flags, the file compiles.
Hope that helps!
can you figure out which of the flags is causing the problem? maybe -ansi?
On Apr 12, 2014, at 10:29 AM, Andres Valenzuela [email protected] wrote:
This error seems to appear in RobotLocomotion/cmake@6c27268. Not sure why that would change what standard library classes are available. Here are the compile commands that work and don't work:
THIS WORKS
[ 61%] Building CXX object systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o
cd /home/avalenzu/drc/software/drake/pod-build/systems/plants && /usr/lib/ccache/c++ -DHandCmex_EXPORTS -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wunused-variable -std=c++0x -O3 -DNDEBUG -fPIC -I/home/avalenzu/drc/software/drake/pod-build/include -I/home/avalenzu/drc/software/build/include -I/home/avalenzu/drc/software/drake/pod-build/lcmgen -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/avalenzu/drc/software/build/include/eigen3 -I/usr/local/MATLAB/R2013b/extern/include -I/usr/local/MATLAB/R2013b/simulink/include -I/home/avalenzu/drc/software/drake/util -I/home/avalenzu/drc/software/drake/systems/plants/tinyxml -I/home/avalenzu/drc/software/build/include/snopt -DMATLAB_MEX_FILE -o CMakeFiles/HandCmex.dir/HandCmex.cpp.o -c /home/avalenzu/drc/software/drake/systems/plants/HandCmex.cppTHIS DOESN'T
[ 61%] Building CXX object systems/plants/CMakeFiles/HandCmex.dir/HandCmex.cpp.o
cd /home/avalenzu/drc/software/drake/pod-build/systems/plants && /usr/lib/ccache/c++ -DHandCmex_EXPORTS -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wreturn-type -Wuninitialized -Wunused-variable -std=c++0x -O3 -DNDEBUG -fPIC -I/home/avalenzu/drc/software/drake/pod-build/include -I/home/avalenzu/drc/software/build/include -I/home/avalenzu/drc/software/drake/pod-build/lcmgen -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/avalenzu/drc/software/build/include/eigen3 -I/usr/local/MATLAB/R2013b/extern/include -I/usr/local/MATLAB/R2013b/simulink/include -I/home/avalenzu/drc/software/drake/util -I/home/avalenzu/drc/software/drake/systems/plants/tinyxml -I/home/avalenzu/drc/software/build/include/snopt -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -o CMakeFiles/HandCmex.dir/HandCmex.cpp.o -c /home/avalenzu/drc/software/drake/systems/plants/HandCmex.cpp
The difference is that the latter contains the following flags:-ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32
If I update the cmake submodule, run make, let the build fail, and then manually enter the compile command without those flags, the file compiles.Hope that helps!
—
Reply to this email directly or view it on GitHub.
Good call. Without -ansi it compiles, with -ansi it doesn't.
Ok. I will search for and remove the ANSI flag if it appears and print a warning. Not ideal, but seems necessary.
On Apr 12, 2014, at 11:09 AM, Andres Valenzuela [email protected] wrote:
Good call. Without -ansi it compiles, with -ansi it doesn't.
—
Reply to this email directly or view it on GitHub.
This was resolved by RobotLocomotion/cmake@1a37c487856d7ac5a9c3fe4da54edaa7f872a3b6
-ansi
In C mode, this is equivalent to -std=c89. In C++ mode, it is equivalent to -std=c++98.
std::shared_ptr
Most helpful comment
-ansi
In C mode, this is equivalent to -std=c89. In C++ mode, it is equivalent to -std=c++98.
std::shared_ptr was added in C++11