question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure passing MAKEFLAGS to catkin_make_isolated on FreeBSD

See original GitHub issue

I’m attempting to install ROS Kinetic on FreeBSD 12.1 (at my peril).

I’m following the ‘from source’ instructions at: http://wiki.ros.org/kinetic/Installation/Source

I am performing step 2.1.3 (Building the catkin workspace), which directs invoking catkin_make_isolated as follows: ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

I get the following output:

==> Processing catkin package: 'catkin'
...
==> make -j4 -l4 in '$PATH/ros_catkin_ws/build_isolated/catkin'
...
<== Failed to process package 'catkin':
Command '['make', '-j4', '-l4']' returned non-zero exit status 2

This seems to be due to FreeBSD make not having the loading average flag -l.

I have tried both setting the MAKEFLAGS and ROS_PARALLEL_JOBS environment variables to avoid setting the -l flag. E.g., set ROS_PARALLEL_JOBS='-j4'.

The result is that it sends a flag -pn to make, as follows:

==> Processing catkin package: 'catkin'
...
==> make -j4 in '$PATH/ros_catkin_ws/build_isolated/catkin'
...
<== Failed to process package 'catkin':
Command '['make', '-pn']' returned non-zero exit status 2

Interestingly, it appears that it’s invoking make -j4, but then says that the actual flag sent to make is -pn.

I have also attempted to set the flags when invoking catkin_make_isolated, but get the same result (with -pn). For example: ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -j4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dirk-thomascommented, Jan 17, 2020

The make flags -j and -j are only added conditionally, see https://github.com/ros/catkin/blob/4d4467502337a76b23a14372cc6659f12ee68d5b/python/catkin/builder.py#L323-L325. If you pass job flags in any other way the logic won’t be triggered (and doesn’t add the -l flag which isn’t supported on your platform).

Possible options:

  • you pass --make-args -j4
    • (the argument must contain a valid job argument otherwise the default logic might get triggered)
  • set MAKEFLAGS=-j4 (the command won’t show these since they are set as an environment variable)
    • (the argument must contain a valid job argument otherwise the default logic might get triggered)
  • set ROS_PARALLEL_JOBS=-j4
    • these argument are passed as is to the command and therefore will be shown and it doesn’t matter what they contain - it always overrides the default logic

The -pn argument is likely coming from this invocation: https://github.com/ros/catkin/blob/4d4467502337a76b23a14372cc6659f12ee68d5b/python/catkin/builder.py#L458 which is trying to determine the available targets. Maybe that option is not supported by make on your platform either? If that is the case can you please post the version of make you are using. Are there any alternative options in your make version to enumerate the available targets?

0reactions
dirk-thomascommented, Jan 21, 2020

The existing options are in the form of --use-* since they also pass different arguments to CMake to change the generator.

I don’t mind either or. Naming the new option --use-gmake sounds good to me too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

failure of catkin_make_isolated on FreeBSD - ROS Answers
I'm attempting to install ROS Kinetic on FreeBSD 12.1 (at my peril). ... I have tried both setting the MAKEFLAGS and ROS_PARALLEL_JOBS ...
Read more >
make(1) - FreeBSD
Variables passed on the command line are still exported via the MAKEFLAGS environment variable. This op- tion may be useful on systems which...
Read more >
6.5. Building Mechanisms - FreeBSD Documentation
This is achieved by passing -jX flag to make(1) running on vendor code. This is the default build behavior of ports. Unfortunately, not...
Read more >
make - FreeBSD
Expand the value and pass it to the shell for execution and as- sign the ... .MAKEFLAGS The environment variable MAKEFLAGS may contain...
Read more >
make - FreeBSD
Makefile -i Ignores error codes returned by commands. ... Notice that flags passed by way of MAKEFLAGS are only displayed when the -d,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found