Не могу найти пакет X11 на WSL - PullRequest
0 голосов
/ 01 мая 2020

Я пытаюсь построить проект с открытым исходным кодом на WSL, используя cmake. Сначала я получаю эти две ошибки, которые я не понимаю:

CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
 configure_file Problem configuring file
Call Stack (most recent call first):
 CMakeLists.txt:2 (project)

The CXX compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
 configure_file Problem configuring file
Call Stack (most recent call first):
 CMakeLists.txt:2 (project)

и для X11:

Searching X11
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find X11 (missing: X11_X11_LIB)
Call Stack (most recent call first):
 /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
 /usr/share/cmake-3.16/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
 CMakeLists.txt:18 (FIND_PACKAGE)

Вот предоставленный cmakelist.txt:

#CMake for the gard Project
project(GARD)

cmake_minimum_required(VERSION 2.4.0)

#Set the path to the Cmake Modules
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")
MESSAGE("Path to Cmake Modules is " ${CMAKE_MODULE_PATH})

MESSAGE("The source directory of the project is " ${GARD_SOURCE_DIR})


MESSAGE("")
MESSAGE("STEP 1 : SEARCHING FOR NEEDED MODULES")
MESSAGE("")

MESSAGE("Searching X11")
FIND_PACKAGE(X11 REQUIRED)
IF(X11_FOUND)
    MESSAGE(" X11 include path: " ${X11_INCLUDE_DIR})
    MESSAGE(" X11 library path: " ${X11_LIBRARIES})
ENDIF(X11_FOUND)

MESSAGE("Searching LAPACK AND BLAS")
find_package(LAPACK)
IF(LAPACK_FOUND)
    MESSAGE(" LAPACK library path: " ${LAPACK_LIBRARIES})
    MESSAGE(" BLAS library path: " ${BLAS_LIBRARIES})
ENDIF(LAPACK_FOUND)

MESSAGE("Searching CIMG")
find_package(CImg)
IF(CIMG_FOUND)
    MESSAGE(" CIMG include path: " ${CIMG_INCLUDE_DIR})
ENDIF(CIMG_FOUND)

MESSAGE("Searching pthread")
FIND_LIBRARY(PTHREADS_LIBRARY pthread
  PATHS /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu
  )
IF(PTHREADS_LIBRARY)
    MESSAGE(" Pthread library path: " ${PTHREADS_LIBRARY})
ENDIF(PTHREADS_LIBRARY)

MESSAGE("Searching Graphviz")
find_package(GraphViz)
IF(GRAPHVIZ_FOUND)
    MESSAGE(" Graphviz library path: " ${GRAPHVIZ_LIBRARIES})
    MESSAGE(" Graphviz include path: " ${GRAPHVIZ_INCLUDE_DIRS})
    SET(GRAPHVIZ_SUPPORT "#define GRAPHVIZ_SUPPORT")
ENDIF(GRAPHVIZ_FOUND)

CONFIGURE_FILE(GraphVizConfig.h.cmake ${CMAKE_SOURCE_DIR}/include/core/GraphVizConfig.h) 

find_package(OpenMP)
if(OPENMP_FOUND)
    message("openMP found")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

MESSAGE("Searching FLANN")
find_package(Flann)
IF(FLANN_FOUND)
    MESSAGE(" FLANN include path: " ${FLANN_INCLUDE_DIR})
    include_directories(${FLANN_INCLUDE_DIR})
    SET(FLANN_SUPPORT "#define FLANN_SUPPORT")
ELSE(FLANN_FOUND)
    MESSAGE(" FLANN include path not found")
    SET(FLANN_SUPPORT "")
ENDIF(FLANN_FOUND)

include(ProcessorCount)
ProcessorCount(N)

if(NOT N EQUAL 0)
    set(AVAILABLE_CORES "#define AVAILABLE_CORES ${N}")
else(NOT N EQUAL 0)
    set(AVAILABLE_CORES "#define AVAILABLE_CORES 1")
endif()

CONFIGURE_FILE(FlannConfig.h.cmake ${CMAKE_SOURCE_DIR}/include/core/FlannConfig.h)

MESSAGE("")

MESSAGE("")
MESSAGE("STEP 2 : SET INCLUDE AND LIBRARY PATHS")
MESSAGE("")
SET(GARD_INCLUDE_DIR    ${GARD_SOURCE_DIR}/include)


IF(LAPACK_FOUND)
    SET(LINK_LIBRARIES ${X11_LIBRARIES} ${PTHREADS_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${GRAPHVIZ_LIBRARIES})
    SET(CIMG_USE_LAPACK "#define cimg_use_lapack")
ELSE()
    SET(LINK_LIBRARIES ${X11_LIBRARIES} ${PTHREADS_LIBRARY} ${GRAPHVIZ_LIBRARIES})
ENDIF()

CONFIGURE_FILE(CimgConfig.h.cmake ${CMAKE_SOURCE_DIR}/include/core/CimgConfig.h)

MESSAGE("")
MESSAGE("STEP 3 : Documentation generation")
MESSAGE("")

MESSAGE("Searching DOXYGEN")
INCLUDE(${CMAKE_MODULE_PATH}/FindDoxygen.cmake)
IF(DOXYGEN_FOUND)
    MESSAGE("DOXYGEN Dir " ${DOXYGEN_DIR})
    MESSAGE("GENERATING DOCUMENTATION")
    SET(ENV{GARD_INCLUDE_DIR} "${GARD_SOURCE_DIR}/include")
    EXEC_PROGRAM("cd docs;${DOXYGEN_DIR}/doxygen doc.txt"
    OUTPUT_VARIABLE MY_OUTPUT
    )
ENDIF(DOXYGEN_FOUND)

MESSAGE(STATUS "Link libraries:  ${LINK_LIBRARIES}")


MESSAGE("")
MESSAGE("STEP 4 : COMPILATION")
MESSAGE("")


add_subdirectory (${GARD_SOURCE_DIR}/examples)
# add_subdirectory (${GARD_SOURCE_DIR}/operators)

Можете ли вы помочь, пожалуйста? Я новичок в cmake и WSL. Я использую WSL на Windows 10, и я установил библиотеку X11 с «sudo apt-get install libx11-dev». Команда 'cmake.' работает в терминале bash и выглядит следующим образом:

ananass@DESKTOP-R1E6G2S:/mnt/c/Users/ananass/gard$
...