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

CMake Error at Firmware/CMakeLists.txt #3099

Closed
zshn25 opened this issue Oct 30, 2015 · 18 comments
Closed

CMake Error at Firmware/CMakeLists.txt #3099

zshn25 opened this issue Oct 30, 2015 · 18 comments

Comments

@zshn25
Copy link

zshn25 commented Oct 30, 2015

I followed the instructions from https://pixhawk.org/dev/ros/sitl

I created and configured the workspace manually. Everything went well untill the last step.

When I run catkin_make, it gave the following error messages

CMake Error at Firmware/CMakeLists.txt:158 (include):
  include could not find load file:

    configs/nuttx_px4fmu-v2_default


CMake Error at Firmware/CMakeLists.txt:170 (message):
  configs/nuttx_px4fmu-v2_default must implement px4_os_prebuild_targets


-- Configuring incomplete, errors occurred!
See also "/home/zee/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/zee/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
@killerlayup
Copy link

I have the same issue, pls help me

@devbharat
Copy link
Contributor

Can you try the updated documentation at dev.px4.io ? Do you specifically want to compile the firmware for ros, or just want a general sitl setup(provided in the updated doc on the link above) ?

@zshn25
Copy link
Author

zshn25 commented Nov 2, 2015

I already installed the toolchain from dev.px4.io. I want to compile the Firmware for ROS which includes SITL too.

@killerlayup
Copy link

I want to compile the Firmware for ROS which includes SITL too.

@devbharat
Copy link
Contributor

I am not sure, but I guess the ROS compilation has some issues right now, you could go to previous commit master before the CMake branch was merged in.

@TarekTaha
Copy link
Contributor

Same issue here, anyone knows what changes introduced this recently ?

1 similar comment
@killerlayup
Copy link

Same issue here, anyone knows what changes introduced this recently ?

@jgoppert
Copy link
Member

jgoppert commented Nov 2, 2015

It still works. The ros build is tested on every commit. Try "make ros"

On Mon, Nov 2, 2015 at 7:59 AM, killerlayup notifications@github.com
wrote:

Same issue here, anyone knows what changes introduced this recently ?


Reply to this email directly or view it on GitHub
#3099 (comment).

@killerlayup
Copy link

@jgoppert you mean 'rosmake ?

@zshn25
Copy link
Author

zshn25 commented Nov 4, 2015

Still the same error.
screenshot from 2015-11-04 15 26 32

Please help!!

@killerlayup
Copy link

@zshn25
do you have free time?
we can discuss on gitter.im if you want to

@killerlayup
Copy link

here is my gitter link:
https://gitter.im/killerlayup/jMAV

@jonbinney
Copy link
Contributor

The basic problem I'm seeing with the ROS build (that gets run when catkin_make is called) is that Firmware/CMakeLists.txt assumes that CMAKE_SOURCE_DIR is the Firmware directory, but in the case of catkin_make, that isn't the case.

In a catkin workspaces, you typically have:

workspace_root_folder/
    src/
       /Firmware
       /Some_other_ROS_repo
       ....

Catkin seems to set CMAKE_SOURCE_DIR to workspace_root_folder/src/
Changing CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR gets me a bit further, but then it fails with:

CMake Error: File /home/jbinney/ws/px4/src/cmake/posix/apps.h_in does not exist.
CMake Error at Firmware/cmake/posix/px4_impl_posix.cmake:104 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  Firmware/src/firmware/posix/CMakeLists.txt:4 (px4_posix_generate_builtin_commands)


fatal: Not a git repository (or any of the parent directories): .git
-- GIT_DESC = 
CMake Error at Firmware/cmake/common/px4_base.cmake:710 (string):
  string sub-command SUBSTRING requires four arguments.
Call Stack (most recent call first):
  Firmware/CMakeLists.txt:332 (px4_create_git_hash_header)

@jonbinney
Copy link
Contributor

I wasn't too clear in the previous comment; I was referring to chaging line https://github.com/PX4/Firmware/blob/b3bb8adbc5d3498bb95865820ec7a62bbf14c28e/CMakeLists.txt#L156 to replace CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR

@wkyoun
Copy link

wkyoun commented Jan 3, 2016

Try this

catkin_make --cmake-args -DCONFIG=ros_sitl_simple

instead of catkin_make

@brandonr49
Copy link

Has this been fixed?
I just had the same error zshn25 posted.

@brandonr49
Copy link

Nevermind. This was my mistake.

@LorenzMeier
Copy link
Member

We changed the way how things work, so closing this.

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

9 participants