0

I am trying to build openblas and it requires me to run this CmakeList.txt i've been following instructions carefully untill now.I'm not used to cmake and so i don't know what's going on.This is the cmnakeList.txt file which i got from https://github.com/mlpack/mlpack/blob/master/src/mlpack/CMakeLists.txt

# Recurse into the bindings to do any necessary configuration there.
add_subdirectory(bindings)
# Recurse into methods/ to get the definitions of any bindings.
add_subdirectory(methods)

# If necessary, configure the tests.
if (BUILD_TESTS)
  add_subdirectory(tests)
else ()
  # Add convenience target to tell the user they need BUILD_TESTS if they try to
  # build mlpack_test.
  add_custom_target(mlpack_test
      ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/CMake/TestError.cmake)
endif ()

# At install time, we simply install the src/ directory to include/ (though we
# omit bindings/ and tests/).
install(FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/../mlpack.hpp"
    DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/base.hpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/core.hpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/namespace_compat.hpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/prereqs.hpp"
    DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/mlpack/")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/core" DESTINATION
    "${CMAKE_INSTALL_INCLUDEDIR}/mlpack")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/methods" DESTINATION
    "${CMAKE_INSTALL_INCLUDEDIR}/mlpack")

# Extract the version number.
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/core/util/version.hpp"
  VERSION_HPP_CONTENTS)
string(REGEX REPLACE ".*#define MLPACK_VERSION_MAJOR ([0-9]+).*" "\\1"
  MLPACK_VERSION_MAJOR "${VERSION_HPP_CONTENTS}")
string(REGEX REPLACE ".*#define MLPACK_VERSION_MINOR ([0-9]+).*" "\\1"
  MLPACK_VERSION_MINOR "${VERSION_HPP_CONTENTS}")
string(REGEX REPLACE ".*#define MLPACK_VERSION_PATCH [\"]?([0-9x]+)[\"]?.*"
  "\\1" MLPACK_VERSION_PATCH "${VERSION_HPP_CONTENTS}")

set(PACKAGE_VERSION
  "${MLPACK_VERSION_MAJOR}.${MLPACK_VERSION_MINOR}.${MLPACK_VERSION_PATCH}")

post_python_bindings()
post_julia_setup()
post_go_setup()

# If we are building R-bindings, we have to run some setup after we
# recurse into methods/.  If not, this macro is empty.
post_r_setup()

# If we are building Markdown documentation, we have to run some setup after we
# recurse into methods/.  If not, this function is empty.
post_markdown_setup()


When I try to run this in my cl I get :

CMake Error at CMakeLists.txt:18 (install):
  install FILES given no DESTINATION!
fabian
  • 80,457
  • 12
  • 86
  • 114
  • You run `cmake` for a **wrong source directory**. It should be a **top-level** directory of the project - https://github.com/mlpack/mlpack/tree/master, but you run CMake with a source directory [src/mlpack](https://github.com/mlpack/mlpack/tree/master/src/mlpack). BTW, before the error message you should got the **warnings** about missing calls to `cmake_minimum_required` and `project`. Why do you ignore the warnings? – Tsyvarev Jul 23 '23 at 23:16

0 Answers0