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

Installation indigo on OSX failed while building 'nodelet_tutorial_math' #13333

Closed
ejalaa12 opened this issue Dec 1, 2016 · 24 comments
Closed

Comments

@ejalaa12
Copy link
Contributor

ejalaa12 commented Dec 1, 2016

Hello,

I followed the official installation of ROS Indigo on OSX.
Everything worked perfectly until I started building the catkin Workspace.

And nodelet_tutorial_math failed to build but not for the same reason that is answered in the installation tutorial. This is what I get:

> cd /Users/ejalaa/Development/ros_installation/my_install/build_isolated/nodelet_tutorial_math && /Users/ejalaa/Development/ros_installation/my_install/install_isolated/env.sh make -j4 -l4

[ 50%] Building CXX object CMakeFiles/nodelet_math.dir/src/plus.cpp.o
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:23:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:610:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:79:9: error:
      no member named 'strcoll' in the global namespace
using ::strcoll;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:80:9: error:
      no member named 'strxfrm' in the global namespace
using ::strxfrm;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:82:9: error:
      no member named 'memchr' in the global namespace; did you mean 'wmemchr'?
using ::memchr;
      ~~^
/usr/include/wchar.h:150:10: note: 'wmemchr' declared here
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
         ^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:23:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:610:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:86:9: error:
      no member named 'strcspn' in the global namespace
using ::strcspn;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:88:9: error:
      no member named 'strpbrk' in the global namespace
using ::strpbrk;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:90:9: error:
      no member named 'strrchr' in the global namespace; did you mean 'strchr'?
using ::strrchr;
      ~~^
/System/Library/Frameworks/Kernel.framework/Headers/string.h:81:14: note:
      'strchr' declared here
extern char     *strchr(const char *s, int c);
                 ^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:23:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:610:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:92:9: error:
      no member named 'strspn' in the global namespace
using ::strspn;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:94:9: error:
      no member named 'strstr' in the global namespace; did you mean 'strnstr'?
using ::strstr;
      ~~^
/System/Library/Frameworks/Kernel.framework/Headers/string.h:80:14: note:
      'strnstr' declared here
extern char     *strnstr(char *s, const char *find, size_t slen);
                 ^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:23:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:610:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:99:98: error:
      no member named 'strpbrk' in the global namespace; did you mean simply
      'strpbrk'?
  ...char* strpbrk(      char* __s1, const char* __s2) {return ::strpbrk(__s1...
                                                               ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:99:46: note:
      'strpbrk' declared here
inline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char* __s1, c...
                                             ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:100:88: error:
      no member named 'strrchr' in the global namespace; did you mean simply
      'strrchr'?
  ...char* strrchr(      char* __s, int __c) {return ::strrchr(__s, __c);}
                                                     ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:100:46: note:
      'strrchr' declared here
inline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s, in...
                                             ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:101:99: error:
      no member named 'memchr' in the global namespace; did you mean simply
      'memchr'?
  ...void* memchr(      void* __s, int __c, size_t __n) {return ::memchr(__s...
                                                                ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:101:46: note:
      'memchr' declared here
inline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, in...
                                             ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:102:97: error:
      no member named 'strstr' in the global namespace; did you mean simply
      'strstr'?
  ...char* strstr(      char* __s1, const char* __s2) {return ::strstr(__s1, ...
                                                              ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:102:46: note:
      'strstr' declared here
inline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1, co...
                                             ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:106:9: error:
      no member named 'strtok' in the global namespace
using ::strtok;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:109:9: error:
      no member named 'strerror' in the global namespace
using ::strerror;
      ~~^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28:
In file included from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:29:
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base.hpp:45:
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp:18:
In file included from /usr/local/include/boost/detail/sp_typeinfo.hpp:20:
In file included from /usr/local/include/boost/core/typeinfo.hpp:119:
In file included from /usr/local/include/boost/core/demangle.hpp:14:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:438:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cwchar:186:49: error:
      declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* _...
                                                ^
/usr/include/wchar.h:150:10: note: target of using declaration
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
         ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:82:9: note:
      using declaration
using ::memchr;
        ^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:33:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28:
In file included from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:29:
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base.hpp:45:
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp:18:
In file included from /usr/local/include/boost/detail/sp_typeinfo.hpp:20:
In file included from /usr/local/include/boost/core/typeinfo.hpp:119:
In file included from /usr/local/include/boost/core/demangle.hpp:14:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:646:54: error:
      no matching function for call to 'memchr'
        {return __n == 0 ? NULL : (const char_type*) memchr(__s, to_int_...
                                                     ^~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:101:46: note:
      candidate function not viable: no known conversion from
      'const char_type *' (aka 'const char *') to 'void *' for 1st argument;
      take the address of the argument with &
inline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, in...
                                             ^
In file included from /Users/ejalaa/Development/ros_installation/my_install/src/common_tutorials/nodelet_tutorial_math/src/plus.cpp:30:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/pluginlib/class_list_macros.h:40:
In file included from /Users/ejalaa/Development/ros_installation/my_install/install_isolated/include/class_loader/class_loader.h:34:
In file included from /usr/local/include/boost/thread/recursive_mutex.hpp:16:
In file included from /usr/local/include/boost/thread/pthread/recursive_mutex.hpp:11:
In file included from /usr/local/include/boost/thread/exceptions.hpp:22:
In file included from /usr/local/include/boost/system/system_error.hpp:14:
In file included from /usr/local/include/boost/system/error_code.hpp:19:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ostream:140:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/locale:871:44: error:
      use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                           ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/locale:871:53: error:
      no type named 'type' in the global namespace
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                                  ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/locale:871:73: error:
      use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                                                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/nodelet_math.dir/src/plus.cpp.o] Error 1
make[1]: *** [CMakeFiles/nodelet_math.dir/all] Error 2
make: *** [all] Error 2

I can't figure out what to do ?
Apparently there is a similar issue on mikepurvis git

Thank you

@spaghetti-
Copy link
Contributor

This can be solved by passing -DCMAKE_FIND_FRAMEWORK=LAST as the very first CMake argument.

@wjwwood
Copy link
Member

wjwwood commented Jan 3, 2017

I don't know how to better fix this (better than the work around). If anyone know how please speak up. I might look into it again next time I update OS X.

@spaghetti-
Copy link
Contributor

AFAIK adding the CMake argument to the toplevel cmake list (with an if clause) does not introduce any regressions.

@qingxia0702
Copy link

hi,ejalaa12
I have confuse with the same promble,Did you resolve it?

@qingxia0702
Copy link

Sorry for bad English, yesterday I had update macOS to Sierra and use Xcode 8.2.1 to compile it ,But the problem is still here. I have no idea now, anyone know it?

@ghost
Copy link

ghost commented Jan 23, 2017

The problem is due to the inclusion of the wrong string.h(from kernel framework instead of the standard library). -DCMAKE_FIND_FRAMEWORK=LAST did not resolve the problem on my side.

I found the culprit to be the FindUUID CMake module. It is located at ${ros_ws}/src/cmake_modules/cmake/Modules/FindUUID.cmake. Changing from find_path(UUID_INCLUDE_DIRS uuid/uuid.h) to find_path(UUID_INCLUDE_DIRS ossp/uuid.h) worked for me. Be sure to install ossp-uuid via homebrew first.

@bgromov
Copy link

bgromov commented Jan 24, 2017

@jundazhu Thanks for discovering it.

Note for others: to make this solution work it might be necessary to remove build_isolated/nodelet_core and devel_isolated/nodelet_core directories first (did the trick for me).

@emrainey
Copy link

emrainey commented Feb 3, 2017

Which CMake files or config procedures have to get modified during the Mac OS X build? No one seems to mention this.

@argrento
Copy link

argrento commented Mar 7, 2017

@jundazhu, your solution does not work for me, even with the @bgromov's note.

Also adding -DCMAKE_FIND_FRAMEWORK=LAST to the build workspace command ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST do not work.

@bgromov
Copy link

bgromov commented Mar 8, 2017

@argrento Have you tried to wipe the whole build_isolated and devel_isolated? That what worked for me on another macOS.

@argrento
Copy link

argrento commented Mar 8, 2017

@bgromov yes, thus I exclude 'nodelet_tutorial_math' from the build tree.

@mikaelarguedas
Copy link
Member

@argrento can you try to downgrade class_loader to version 3.4 to identify if this is the root of the problem? (you can post your comments on ros/class_loader#44)
Thanks!

@argrento
Copy link

argrento commented Mar 9, 2017

@mikaelarguedas yesterday I tried to use Mac OS X installer. I added -DCMAKE_FIND_FRAMEWORK=LAST to the build options and saw no error, all was good. So the solution by @jundazhu should work.

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Mar 9, 2017

@argrento glad it worked for you too

@folkwang
Copy link

folkwang commented Mar 14, 2017

@argrento what macOS version are you using? I'm on Sierra and the installer script you mentioned will fail in qt discovery for me.
tweaking CMAKE_FIND_FRAMEWORK don't work for me, and I have ossp-uuid installed from brew

@argrento
Copy link

argrento commented Mar 14, 2017

@folkwang I have 10.11.6. I had an issue with Qt as well. Section 4.2 helped me.

@folkwang
Copy link

@argrento ah yeah. i did a clean rebuild and it works. thanks!

@ilidar
Copy link

ilidar commented Jun 20, 2017

Had same problem with macOS Sierra 10.15.2 and ROS Kinetic, all suggestions didn't work for me, so I've removed ${UUID_INCLUDE_DIRS} ${UUID_LIBRARIES} from nodelet package.

Before:

catkin_package(
  INCLUDE_DIRS include ${UUID_INCLUDE_DIRS}
  LIBRARIES nodeletlib ${UUID_LIBRARIES}
  CATKIN_DEPENDS bondcpp message_runtime pluginlib rosconsole roscpp std_msgs
  DEPENDS Boost
)

After:

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES nodeletlib
  CATKIN_DEPENDS bondcpp message_runtime pluginlib rosconsole roscpp std_msgs
  DEPENDS Boost
)

Hopefully this could help someone and won't brake something else :P.

@Joschka1
Copy link

@ilidar thank you, that fixed it for me to and now it compiles fine :)
it also fixed the rqt_gui_cpp error for me!

@tfoote
Copy link
Member

tfoote commented Aug 14, 2017

Since this has a workaround could someone please add this to the http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source and then we can close this ticket?

@ejalaa12
Copy link
Contributor Author

Hi, sorry everyone, I haven't followed this issue closely lately. Besides, I don't get this error anymore, probably because I did several updates meanwhile. However, It seems that this issue has been resolved. Should I close the ticket or wait for someone to add it to the tutorial ? @tfoote

@tfoote
Copy link
Member

tfoote commented Aug 19, 2017

If this is no longer an issue with recent updates we can close this out as we don't need to update the documentation. Thanks for the followup @ejalaa12

@tfoote tfoote closed this as completed Aug 19, 2017
@Tobias-Fischer
Copy link
Contributor

This problem still seems to happen with lunar. It would be great if someone could add this to the Homebrew troubleshooting page.

@lupusorina
Copy link

The problem is due to the inclusion of the wrong string.h(from kernel framework instead of the standard library). -DCMAKE_FIND_FRAMEWORK=LAST did not resolve the problem on my side.

I found the culprit to be the FindUUID CMake module. It is located at ${ros_ws}/src/cmake_modules/cmake/Modules/FindUUID.cmake. Changing from find_path(UUID_INCLUDE_DIRS uuid/uuid.h) to find_path(UUID_INCLUDE_DIRS ossp/uuid.h) worked for me. Be sure to install ossp-uuidvia homebrew first.

This solution worked for me to solve the issue on Lunar and OS Sierra

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

No branches or pull requests