rcsoccersim / rcssserver

The RoboCup Soccer Simulator Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacOS installation Problem

bbrighttaer opened this issue · comments

Hi all, I am trying to set up the server on a macOS Monterey v12.5. I have installed boost using macports. Running g++ -v I get:

Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

When I run ./configure everything seems okay. However, running make, I run into:

~/robocup-soccer/rcssserver-17.0.1/rcss/clang/coach_lang_parser.ypp:103.9-16: syntax error, unexpected identifier, expecting string
make[3]: *** [coach_lang_parser.cpp] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I also tried using CMake
Running cmake .. after cd build I get:

-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.2.12") 
-- Found BISON: /usr/bin/bison (found version "2.3") 
-- Found FLEX: /usr/bin/flex (found version "2.6.4") 
-- Found Boost: /opt/local/include (found version "1.76.0") found components: system filesystem 
-- Looking for C++ include sys/socket.h
-- Looking for C++ include sys/socket.h - found
-- Looking for C++ include sys/param.h
-- Looking for C++ include sys/param.h - found
-- Looking for C++ include sys/time.h
-- Looking for C++ include sys/time.h - found
-- Looking for C++ include netinet/in.h
-- Looking for C++ include netinet/in.h - found
-- Looking for C++ include arpa/inet.h
-- Looking for C++ include arpa/inet.h - found
-- Looking for C++ include netdb.h
-- Looking for C++ include netdb.h - found
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include poll.h
-- Looking for C++ include poll.h - found
-- Looking for C++ include pwd.h
-- Looking for C++ include pwd.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: ~/robocup-soccer/rcssserver-17.0.1/build

Running make I get:

[  1%] Building CXX object rcss/net/CMakeFiles/RCSSNet.dir/addr.cpp.o
~/robocup-soccer/rcssserver-17.0.1/rcss/net/addr.cpp:207:17: warning: private field 'm_error' is not used [-Wunused-private-field]
    Addr::Error m_error;
                ^
~/robocup-soccer/rcssserver-17.0.1/rcss/net/addr.cpp:208:9: warning: private field 'm_errno' is not used [-Wunused-private-field]
    int m_errno;
        ^
2 warnings generated.
[  2%] Building CXX object rcss/net/CMakeFiles/RCSSNet.dir/socket.cpp.o
[  3%] Building CXX object rcss/net/CMakeFiles/RCSSNet.dir/socketstreambuf.cpp.o
[  4%] Building CXX object rcss/net/CMakeFiles/RCSSNet.dir/tcpsocket.cpp.o
[  4%] Building CXX object rcss/net/CMakeFiles/RCSSNet.dir/udpsocket.cpp.o
[  5%] Linking CXX shared library librcssnet.dylib
[  5%] Built target RCSSNet
[  6%] Building CXX object rcss/conf/CMakeFiles/RCSSConfParser.dir/parser.cpp.o
In file included from ~/robocup-soccer/rcssserver-17.0.1/rcss/conf/parser.cpp:28:
~/robocup-soccer/rcssserver-17.0.1/rcss/conf/builder.hpp:849:27: warning: unused parameter 'value' [-Wunused-parameter]
                        V value )
                          ^
1 warning generated.
[  7%] Building CXX object rcss/conf/CMakeFiles/RCSSConfParser.dir/builder.cpp.o
In file included from ~/robocup-soccer/rcssserver-17.0.1/rcss/conf/builder.cpp:26:
~/robocup-soccer/rcssserver-17.0.1/rcss/conf/builder.hpp:849:27: warning: unused parameter 'value' [-Wunused-parameter]
                        V value )
                          ^
1 warning generated.
[  8%] Building CXX object rcss/conf/CMakeFiles/RCSSConfParser.dir/statushandler.cpp.o
[  9%] Building CXX object rcss/conf/CMakeFiles/RCSSConfParser.dir/streamstatushandler.cpp.o
[ 10%] Linking CXX shared library librcssconfparser.dylib
Undefined symbols for architecture arm64:
  "boost::filesystem::path::operator/=(boost::filesystem::path const&)", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
  "boost::filesystem::detail::current_path(boost::system::error_code*)", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
  "boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
  "boost::filesystem::detail::absolute(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
  "boost::filesystem::path::parent_path() const", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
  "boost::filesystem::path::root_directory() const", referenced from:
      rcss::conf::Parser::include(char const*, char const*) in parser.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rcss/conf/librcssconfparser.3.0.0.dylib] Error 1
make[1]: *** [rcss/conf/CMakeFiles/RCSSConfParser.dir/all] Error 2
make: *** [all] Error 2

I suppose the issue here may be ld: symbol(s) not found for architecture arm64. If so, how can I resolve it?

I've been searching online for some hours now on how to resolve this but to no avail. I would appreciate any help on this.
Thanks so much!

It seems to be a problem that occurred when bison built the parser.
What version of bison are you using?

Unfortunately, macOS is not actively supported at this time (mainly because I don't have the latest mac environment).
I recommend using a virtual environment on macOS.

Bison version is:

bison (GNU Bison) 2.3

Probably, the major version of bison should be 3.
In the case of Ubuntu 20.04,

$ bison -V
bison (GNU Bison) 3.5.1

Thanks, @hidehisaakiyama. I updated bison to 3.8.2 and I have been able to set the server up.