WSL, CMake &openMP copy_FILE error

Hey

 

I'm trying to run this cmake but I keep getting an error >

 

cmake_minimum_required(VERSION 3.10.2)
project(debugCrash)

set(CMAKE_CXX_STANDARD 17)

find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" -std=c++17 -fopenmp)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

add_executable(debugCrash main.cpp)


CMake Error at /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:306 (try_compile):
Cannot copy output executable

'/mnt/d/RnD/debugCrash/cmake-build-debug/CMakeFiles/CMakeTmp/cmTC_03c85'

to destination specified by COPY_FILE:

'/mnt/d/RnD/debugCrash/cmake-build-debug/CMakeFiles/FindOpenMP/ompver_C.bin'

 

Wht do I do ? :- )

 

---

Edit I'm also getting

  Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY)

Despite installing openGl

1
5 comments

Hi!

>Despite installing openGl

How have you installed OpenGL on your WSL instance? If you try building the project directly on WSL (not in CLion), does it work?

0

I'll check that as soon as I get back to pc. But what about OpenMP ? that is preinstalled with gcc so what do I do there ?

0

I believe I tried this

https://stackoverflow.com/questions/34001996/how-to-use-cmake-to-find-and-link-openglmesa-package-in-ubuntu

and

https://wiki.qt.io/Install_Qt_5_on_Ubuntu

 

No luck so far, neither openMP or openGL works. I didnt try native project on WSL yet, all I tried now is to run cmake.

0

>I didnt try native project on WSL yet, all I tried now is to run cmake.

Please try transferring your CMake project to WSL and building it there using Terminal. It will help to determine whether the issue is CLion-related or not.

0
Avatar
Permanently deleted user

I can also say I have been getting this issue on WSL2 when attempting to find OpenGL with CMake.

 

I installed OpenGL and FreeGLUT through the command:

sudo apt-get install freeglut3-dev
find_package(OpenGL REQUIRED) # This fails with the same error
0

Please sign in to leave a comment.