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 couldn't find OpenMp #1231

Open
JianghanZHang opened this issue Mar 20, 2024 · 3 comments
Open

CMake couldn't find OpenMp #1231

JianghanZHang opened this issue Mar 20, 2024 · 3 comments
Labels
question Further information is requested

Comments

@JianghanZHang
Copy link

JianghanZHang commented Mar 20, 2024

Bug description

Hello,

I encountered the following error when trying to build and install crocoddyl with multi-threading from source in a Conda environment.

After running cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_MULTITHREADS=ON
I got:
CMake Error at cmake/find-external/OpenMP/FindOpenMP.cmake:222 (try_compile): Failed to configure test project build system. Call Stack (most recent call first): cmake/find-external/OpenMP/FindOpenMP.cmake:549 (_openmp_get_flags) CMakeLists.txt:165 (find_package)

Reproduction steps

Upon creating a new Conda environment and activate

conda install python==3.10

conda install cmake==3.23 pkg-config colcon-common-extensions -c conda-forge

conda install catkin_pkg empy lark -c conda-forge

conda install ncurses -c conda-forge

conda install websockets

conda install matplotlib

conda install -c conda-forge robot_descriptions

pip install pybullet

conda install pinocchio

conda install conda-forge::libgomp

conda install conda-forge::example-robot-data

conda install conda-forge::gcc

conda install conda-forge::gxx

System

  • OS: Ubuntu 22.04
  • Crocoddyl version: 2.0.2
  • Conda version: 24.1.2-0

It appears to me that CMake somehow couldn't find the installed OpenMp, but I have no clue how to fix it - even if I manually set CMAKE_MODULE_PATH, CMAKE_C_COMPILER, CMAKE_CPP_COMPILER, cmake still unable to find the OpenMp.

I appreciate your help.
Thanks!

@JianghanZHang JianghanZHang added the bug Something isn't working label Mar 20, 2024
@cmastalli cmastalli added question Further information is requested and removed bug Something isn't working labels Mar 20, 2024
@cmastalli
Copy link
Member

Hi @JianghanZHang

The issue appears when installing cmake v3.23. Please do:

conda remove cmake==3.23
conda install cmake

@nim65s is this expected to have a broken compilation with cmake v3.23?

@nim65s
Copy link
Collaborator

nim65s commented Mar 20, 2024

In my tests, this works for CMake 3.14 to 3.18, is broken from 3.20 to 3.25, and works again since 3.26.
It is not expected, but I don't think it is worth fixing.

@cmastalli
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants