Build fails on Mac OSX 10.14 with error libtcmalloc not found

Requests regarding how to set up experiments in ARGoS.
argosj
Posts: 4
Joined: Wed Sep 23, 2020 10:15 am

Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby argosj » Fri Sep 25, 2020 5:33 pm

Hi,
I have been trying to install since the past 3 days, i did install all the dependencies too, i have installed google-perftools with brew and cmake has detected the gperftools at

Code: Select all

"Found GooglePerfTools: /usr/local/lib/libtcmalloc.dylib"
However the build fails with the error:

Code: Select all

[100%] Linking CXX executable argos3_prof ld: library not found for -ltcmalloc
I did try the option HPX_WITH_MALLOC=system, i still get the same error, and i am not able to resolve this by myself. Can someone please help, Thank you.
-J

Edit : I think something has to be changed in src/testing/CMakeLists.txt file at lines:

Code: Select all

if(ARGOS_BUILD_FOR_SIMULATOR AND GOOGLEPERFTOOLS_FOUND) add_executable(argos3_prof ${CMAKE_SOURCE_DIR}/core/simulator/query_plugins.cpp ${CMAKE_SOURCE_DIR}/core/simulator/main.cpp) target_link_libraries(argos3_prof tcmalloc profiler
at line tcmalloc profiler.

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby pincy » Fri Sep 25, 2020 6:01 pm

Please uninstall google perftools. It's just for internal development.
I made ARGoS.

argosj
Posts: 4
Joined: Wed Sep 23, 2020 10:15 am

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby argosj » Sun Sep 27, 2020 6:27 pm

Thank you for the quick reply pincy, i did uninstall google perftools but the error repeats.

This is the output of cmake

Code: Select all

CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is AppleClang 11.0.0.11000033 -- The CXX compiler identification is AppleClang 11.0.0.11000033 -- 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 DLFCN: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libdl.tbd -- Found Pthreads: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libpthread.tbd -- Could NOT find GooglePerfTools (missing: GOOGLEPERFTOOLS_LIBRARY GOOGLEPERFTOOLS_INCLUDE_DIR) -- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.20") found components: doxygen dot -- Found ASCIIDoc: /usr/local/bin/asciidoc -- Found Lua53: /usr/local/lib/liblua5.3.dylib (found version "5.3") -- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework -- Found GLUT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework -- Configuring done -- Generating done -- Build files have been written to: /Users/josyulakrishna/Desktop/argos3/src
Error:

Code: Select all

[ 99%] Built target argos3plugin_simulator_prototype [ 99%] Linking CXX executable argos3_prof ld: library not found for -ltcmalloc clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [testing/argos3_prof] Error 1 make[1]: *** [testing/CMakeFiles/argos3_prof.dir/all] Error 2 make: *** [all] Error 2
Can i just skip the testing package all together?

argosj
Posts: 4
Joined: Wed Sep 23, 2020 10:15 am

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby argosj » Sun Sep 27, 2020 6:52 pm

Output after compiling without testing

Code: Select all

[INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/core/libargos3core_simulator.dylib" [WARNING] Error opening directory "/Users/josyulakrishna/Desktop/argos3/build/testing/": No such file or directory [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/e-puck/libargos3plugin_simulator_epuck.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/eye-bot/libargos3plugin_simulator_eyebot.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/foot-bot/libargos3plugin_simulator_footbot.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/generic/libargos3plugin_simulator_genericrobot.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/prototype/libargos3plugin_simulator_prototype.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/robots/spiri/libargos3plugin_simulator_spiri.dylib" [WARNING] Error opening directory "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/visualizations/qt-opengl/": No such file or directory [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/entities/libargos3plugin_simulator_entities.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/physics_engines/dynamics2d/libargos3plugin_simulator_dynamics2d.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/physics_engines/dynamics3d/libargos3plugin_simulator_dynamics3d.dylib" [WARNING] Error opening directory "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/physics_engines/physx/": No such file or directory [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/physics_engines/pointmass3d/libargos3plugin_simulator_pointmass3d.dylib" [INFO] Loaded library "/Users/josyulakrishna/Desktop/argos3/build/plugins/simulator/media/libargos3plugin_simulator_media.dylib" [WARNING] Error opening directory "/usr/local/lib/argos3/": No such file or directory AVAILABLE ACTUATORS [ differential_steering (default) ] The differential steering actuator. [ directional_leds (default) ] The directional LEDs actuator. [ footbot_distance_scanner (default) ] The foot-bot distance scanner actuator. [ footbot_gripper (default) ] The footbot gripper actuator. [ footbot_turret (default) ] The foot-bot turret actuator. [ gripper (default) ] The Gripper actuator. [ joints (default) ] The prototype joints actuator: controls a prototype entity's joints. [ leds (default) ] The LEDs actuator. [ magnets (default) ] The (electro)magnet actuator. [ quadrotor_position (default) ] The quadrotor position actuator. [ quadrotor_speed (default) ] The quadrotor speed actuator. [ radios (default) ] A generic radio actuator to send messages to nearby radios. [ range_and_bearing (default) ] The range and bearing actuator. [ tags (default) ] The tags actuator. AVAILABLE SENSORS [ battery (default) ] A generic battery level sensor. [ cameras (default) ] A generic multi-camera sensor capable of running various algorithms [ colored_blob_omnidirectional_camera (rot_z_only) ] A generic omnidirectional camera sensor to detect colored blobs. [ colored_blob_perspective_camera (default) ] A generic perspective camera sensor to detect colored blobs. [ differential_steering (default) ] A generic differential steering sensor. [ epuck_proximity (default) ] The E-Puck proximity sensor. [ eyebot_light (rot_z_only) ] The eye-bot light sensor (optimized for 2D). [ eyebot_proximity (default) ] The eye-bot proximity sensor. [ footbot_base_ground (rot_z_only) ] The foot-bot base ground sensor. [ footbot_distance_scanner (rot_z_only) ] The foot-bot distance scanner sensor (optimized for 2D). [ footbot_light (rot_z_only) ] The foot-bot light sensor (optimized for 2D). [ footbot_motor_ground (rot_z_only) ] The foot-bot motor ground sensor. [ footbot_proximity (default) ] The foot-bot proximity sensor. [ footbot_turret_encoder (default) ] The foot-bot turret encoder sensor. [ ground (rot_z_only) ] A generic ground sensor (optimized for 2D). [ joints (default) ] The prototype joints sensor: monitors a prototype entity's joints. [ light (default) ] A generic light sensor. [ positioning (default) ] A generic positioning sensor. [ proximity (default) ] A generic proximity sensor. [ radios (default) ] A generic radio sensor to receive messages from nearby radios. [ range_and_bearing (medium) ] The range-and-bearing sensor. AVAILABLE PHYSICS ENGINES [ dynamics2d ] A 2D dynamics physics engine. [ dynamics3d ] A 3D dynamics physics engine [ pointmass3d ] A 3D point-mass physics engine. AVAILABLE MEDIA [ directional_led ] Manages directional LED entities. [ led ] Manages the LEDs. [ radio ] Enables communication between a radio actuator and radio sensor. [ range_and_bearing ] It simulates the communication across range-and-bearing-equipped robots. [ tag ] Manages tag entities. AVAILABLE VISUALIZATIONS AVAILABLE ENTITIES [ box ] A stretchable 3D box. [ cylinder ] A stretchable cylinder. [ e-puck ] The e-puck robot. [ eye-bot ] The eye-bot robot, developed in the Swarmanoid project. [ floor ] It contains the properties of the arena floor. [ foot-bot ] The foot-bot robot, developed in the Swarmanoid project. [ light ] A colored light. [ prototype ] A generic and configurable entity [ spiri ] The spiri robot, developed by Pleiades Robotics.

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby pincy » Sun Sep 27, 2020 7:20 pm

I have a Mac and I can't reproduce the error you find. It's OK for libtcmalloc not to be installed. The CMake script should not compile argos3_prof, but it does on your system. I am not sure why this is happening. Check the value of the variable GOOGLEPERFTOOLS_FOUND in CMakeCache.txt, it should be unset or false.

Out of curiosity, why are you installing ARGoS manually instead of using Homebrew? And why are you running it from the sources? That's not the way you should proceed. Especially running ARGoS from the build directory should be done if you know what you're doing. You will have errors. The correct procedure is to install ARGoS system-wide.

Since you compile ARGoS manually from the sources, make sure to compile with -DCMAKE_BUILD_TYPE=Release or ARGoS will be very slow.

Also consider that the testing folder is for me to test stuff out - not for other people to learn ARGoS. If you want to learn ARGoS, use the argos3-example repository after installing the simulator system-wide.
I made ARGoS.

argosj
Posts: 4
Joined: Wed Sep 23, 2020 10:15 am

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby argosj » Sun Sep 27, 2020 8:37 pm

I have chosen to compile manually since the brew install fails with the following errors

Code: Select all

Updating Homebrew... ==> Installing argos3 from ilpincy/argos3 ==> Downloading https://github.com/ilpincy/argos3/archive/3.0.0-beta56.tar.gz Already downloaded: /Users/josyulakrishna/Library/Caches/Homebrew/downloads/aa6b792a608d99d9c005f22899917c6fd308939eed58fd83a40035fd1e5fd632--argos3-3.0.0-beta56.tar.gz ==> cmake ../src -DARGOS_BUILD_NATIVE=ON -DCPACK_PACKAGE_VERSION_MAJOR=3 -DCPACK_PACKAGE_VERSION_MINOR=0 -DCPAC ==> make Last 15 lines from /Users/josyulakrishna/Library/Logs/Homebrew/argos3/02.make: using ::islessgreater; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace using ::isunordered; ~~^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:330:9: error: no member named 'isunordered' in the global namespace using ::isunordered; ~~^ 13 errors generated.
I couldn't fix that so i decided to manually compile from the source.

I did check my CMakeCache.txt the only lines with GOOGLEPERFTOOLS are

Code: Select all

//Google PerfTools header location GOOGLEPERFTOOLS_INCLUDE_DIR:PATH=GOOGLEPERFTOOLS_INCLUDE_DIR-NOTFOUND //Google PerfTools library location GOOGLEPERFTOOLS_LIBRARY:FILEPATH=GOOGLEPERFTOOLS_LIBRARY-NOTFOUND
can i add the line GOOGLEPERFTOOLS_FOUND=False ?

Thank you I'll use -DCMAKE_BUILD_TYPE=Release for the compilation

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby pincy » Sun Sep 27, 2020 10:17 pm

Can you send me the build log that corresponds to the "brew install" command? I need to check it to understand what's going on. I never encountered this kind of problem. The CMakeCache.txt file is fine, there is nothing to do there and the if() that uses GOOGLEPERFTOOLS_FOUND should not go through. There seems to be something about your machine's configuration I can't guess with the information I have.
I made ARGoS.

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Build fails on Mac OSX 10.14 with error libtcmalloc not found

Postby pincy » Sun Sep 27, 2020 10:23 pm

I just googled the "brew install" error you reported. The cause seems to be related to your Xcode installation. See the following links: The first link also reports a solution. Hopefully that solves your problem too.
I made ARGoS.


Return to “How to... ?”