HKUST-Aerial-Robotics / FUEL

An Efficient Framework for Fast UAV Exploration
GNU General Public License v3.0
922 stars 194 forks source link

Could NOT find nlopt (missing: nlopt_DIR) #40

Closed QgZhan closed 2 years ago

QgZhan commented 2 years ago

Does NLOPT have version requirements? I'm testing this project on Ubuntu 18.04(ROS Melodic). When I run catkin_make, it raises this error:

-- looking for PCL_PEOPLE
-- Could NOT find nlopt (missing: nlopt_DIR)
-- Could not find the required component 'nlopt'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "nlopt" with any of
  the following names:

    nloptConfig.cmake
    nlopt-config.cmake

  Add the installation prefix of "nlopt" to CMAKE_PREFIX_PATH or set
  "nlopt_DIR" to a directory containing one of the above files.  If "nlopt"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  FUEL/fuel_planner/bspline_opt/CMakeLists.txt:13 (find_package)

-- Configuring incomplete, errors occurred!
See also "/mnt/SLAM/fuel_uav/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/SLAM/fuel_uav/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

I have tried to install nlopt-2.7.1 and nlopt-2.6.2, and set the "nlopt_DIR" in FUEL/fuel_planner/bspline_opt/CMakeLists.txt, as:

cmake_minimum_required(VERSION 2.8.3)
project(bspline_opt)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall")
set(nlopt_DIR "/root/nlopt-2.6.2")

find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  visualization_msgs
  plan_env
  active_perception
  cv_bridge
  nlopt
)

However, this error still be raised. After install nlopt, I tried to find "nloptConfig.cmake" and "nlopt-config.cmake" by "locate" commond, but return nothing. I can't find this two files. May I ask whether the version I installed is wrong or the installation method is wrong?

QgZhan commented 2 years ago

Sorry, I have missed the first commond sudo apt-get install libarmadillo-dev ros-melodic-nlopt. It's OK now.