Disclaimer: I'm a noob at building/make/packages/cmake.
My goal: Use xtensor-blas
library in C++
My env: Win10 x64, CLion2021
My problem: Can't get the simplest examples to compile. Sth about project dependencies.
I tried:
1) downloading and compiling openBLAST manually using every tutorial I could google - always stopped at different problems. Either I don't have "nmake" or build failed for some reason, or I get "undefined reference" etc. - I've been overwhelmed for a couple of days. A step-by-step walkthrough would be appreciated.
2) the closest I got was using anaconda conda install -c conda-forge openblas
, then copy-pasting "include" directories from xtl
,xtensor
,xtensor-blas
to my project. My CMakeLists.txt:
cmake_minimum_required(VERSION 3.19)
project(tstxtensor3)
set(CMAKE_CXX_STANDARD 20)
add_executable(tstxtensor3 main.cpp)
include_directories(.)
add_definitions(-DHAVE_CBLAS=1)
set(OpenBLAS_DIR c:/Users/pruglo/anaconda3/envs/evn/Library/share/cmake/OpenBLAS/)
find_package(OpenBLAS REQUIRED)
if (OpenBLAS_FOUND)
include_directories(${OpenBLAS_INCLUDE_DIRS})
target_link_libraries(tstxtensor3 c:/Users/pruglo/anaconda3/envs/evn/Library/lib/openblas.lib ${OpenBLAS_LIBRARY})
else ()
message("OpenBLAS NOT FOUND!")
endif ()
Cmake loads successfuly, and OpenBLAS_FOUND
is true
. But when I compile my cpp, I get error while loading shared libraries: openblas.dll: cannot open shared object file: No such file or directory Process finished with exit code 127
Note: OpenBLAS_INCLUDE_DIRS
expands to c:/Users/pruglo/anaconda3/envs/evn/Library/include/openblas
and OpenBLAS_LIBRARY
expands to c:/Users/pruglo/anaconda3/envs/evn/Library/bin/openblas.dll
Extra questions:
- do I need LAPACK or other stuff for
xtensor-blas
? - can I build my project portably so that I don't need to install everything for every pc I develop on?