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

Newbie trouble with building library with CMakeList #7

Closed
HatedFate opened this issue Sep 27, 2021 · 2 comments
Closed

Newbie trouble with building library with CMakeList #7

HatedFate opened this issue Sep 27, 2021 · 2 comments

Comments

@HatedFate
Copy link

HatedFate commented Sep 27, 2021

Hello, I am working within a robot operating system (ROS) that is built using catkin_make (build system for ROS). catkin_make my program using a CMakeLists.txt file (I think you may have some experience with this from: https://answers.ros.org/question/266550/how-to-use-fuzzylite-on-my-workspace-via-cmakelists/). I'd downloaded your software from: https://www.fuzzylite.com/downloads/ and extracted the files into my ROS workspace. A generalization of my current workspace is here:

workspace
├── CMakeLists.txt
├── scripts
         ├── fuzzylite-6.0
         ├── missions
         │       ├── fuzzy
         │                └── fuzzy.h

Inside the CMakeLists.txt I'd copied the code from https://github.com/fuzzylite/fuzzylite/blob/release/examples/application/CMakeLists.txt into the CMakeLists.txt provided by catkin. I changed set(FL_HOME ${PROJECT_SOURCE_DIR}/../../fuzzylite/) to set(FL_HOME /scripts/fuzzylite-6.0/fuzzylite/).
However, when I tried to build the program I receive the error:

-- ==> add_subdirectory(quantum_drone)
Finding FuzzyLiteLibrary locally at /scripts/fuzzylite-6.0/fuzzylite/release/bin
=====================================
FuzzyLite Demo v6.0

FL_HOME=/scripts/fuzzylite-6.0/fuzzylite
FL_LIBRARY_NAME=fuzzylite-static
FuzzyLiteLibrary=FuzzyLiteLibrary-NOTFOUND

FL_BACKTRACE=ON
FL_STATIC=ON
FL_DEBUG=OFF
CMAKE_BUILD_TYPE=Release
CMAKE_CXX_COMPILER_ID=GNU
CMAKE_CXX_COMPILER_VERSION=7.5.0
CMAKE_CXX_FLAGS=
COMPILE_DEFINITIONS:
-- Defined: ROS_BUILD_SHARED_LIBS=1
-- Defined: ROS_BUILD_SHARED_LIBS=1
=====================================

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FuzzyLiteLibrary
    linked by target "binary" in directory /home/kannachan/drone/src/quantum_drone

-- Configuring incomplete, errors occurred!
See also "/home/kannachan/drone/build/CMakeFiles/CMakeOutput.log".
See also "/home/kannachan/drone/build/CMakeFiles/CMakeError.log".
Makefile:712: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

I assume that the path to the file is incorrect, but I checked many different ways to solve it and still end in no result. I'm not if I actually installed the library correctly (I simply extracted the files from the zip file downloaded from your webiste), so I am very confuse on what my mistake actually is. Appreciate it if you could help me with this!

@jcrada
Copy link
Member

jcrada commented Oct 15, 2021

Hi, sorry for the late reply! I just read your message.

Maybe the library is not found because of set(FL_HOME /scripts/fuzzylite-6.0/fuzzylite/)? I think the path is not valid because scripts is not at the root directory of your drive? Easy to check is next time you change the fuzzylite home, make sure that the path exists (try cd $FL_HOME, or whatever value FL_HOME has
FL_HOME=/scripts/fuzzylite-6.0/fuzzylite

@HatedFate
Copy link
Author

Thanks for the reply! I managed to get it to work, but I am quite new to fuzzy logic and I'd just finished programming a fuzzy system for yaw control. The program compiled without any errors, at first everything looked fine, but when I attempted to test it, I get nan output except when the input is 0. I will make another post regarding this issue soon (I assume the input didn't activate any rules so I get nan outputs). Appreciate your help!

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

2 participants