Open Shaunlipy opened 5 years ago
Compile openblas from source. The package of Ubuntu repos do not have lapacke.h
Small addition to @sziraqui's suggestion (by the way it works for me), to build OpenFace on ARM you will also need to comment section with x86 SIMD options in CMakeLists.txt:
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.7)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -msse -msse2 -msse3")
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse -msse2 -msse3")
endif ()
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse -msse2 -msse3")
endif ()
An addition to the original question and @sziraqui ' comment
Ive been successful with installing based on Ubuntu repros
sudo apt-get install liblapack-dev liblapacke-dev libopenblas-dev # not sure this is necessary
And then in cmake/modules/FindOpenBLAS.cmake
add the two lines
/usr/include/aarch64-linux-gnu/
and
/usr/lib/aarch64-linux-gnu/
in the include and lib search paths.
As a side note. I got errors with dlib-19.13:
...
undefined reference to `pthread_create'
...
cannot find -lpthreads
...
undefined reference to `sgesv'
...
But I was successful with dlib-19.22. And got a working OpenFace installation after removing the arguments for SSE SIMD as suggested by pi-null-meazon
jetson@tegra-ubuntu:~/OpenFace/build$ make Scanning dependencies of target LandmarkDetector [ 2%] Building CXX object lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o g++-8: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? g++-8: error: unrecognized command line option ‘-msse2’ g++-8: error: unrecognized command line option ‘-msse3’ lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/build.make:62: recipe for target 'lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o' failed make[2]: [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/all' failed make[1]: [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
I encountered the following problem when compiling the project, I would like to ask how to solve it ah
Have a look into "https://github.com/TadasBaltrusaitis/OpenFace/issues/479", same errors reported when compiling on a Jetson device (no SSE CPU instructions?)
This error indicates that CMake is unable to locate the OpenBLAS library. To resolve this, you need to ensure that OpenBLAS is installed on your system and that CMake can find it.
Here is a step-by-step plan to resolve this issue:
Install OpenBLAS: Ensure that OpenBLAS is installed on your system. You can install it using a package manager.
Set OpenBLAS Environment Variables: Set the environment variables to help CMake locate OpenBLAS.
Configure CMake: Modify your CMakeLists.txt
or provide the necessary paths when running CMake.
For macOS, you can use Homebrew to install OpenBLAS:
brew install openblas
Set the environment variables to point to the OpenBLAS installation. You can add these lines to your shell configuration file (e.g., .bashrc
, .zshrc
):
export OpenBLAS_HOME=$(brew --prefix openblas)
export OpenBLAS_INCLUDE_DIR=$OpenBLAS_HOME/include
export OpenBLAS_LIB_DIR=$OpenBLAS_HOME/lib
Modify your CMakeLists.txt
to include the paths to OpenBLAS:
set(OpenBLAS_INCLUDE_DIR $ENV{OpenBLAS_INCLUDE_DIR})
set(OpenBLAS_LIB_DIR $ENV{OpenBLAS_LIB_DIR})
find_package(OpenBLAS REQUIRED)
include_directories(${OpenBLAS_INCLUDE_DIR})
link_directories(${OpenBLAS_LIB_DIR})
target_link_libraries(your_target_name ${OpenBLAS_LIBRARIES})
Alternatively, you can provide the paths directly when running CMake:
cmake -DOpenBLAS_INCLUDE_DIR=$OpenBLAS_INCLUDE_DIR -DOpenBLAS_LIB_DIR=$OpenBLAS_LIB_DIR ..
This should help CMake locate the OpenBLAS library and resolve the error.
I am compiling it on my Jetson Nano
Response from Copilot
Step 1: Install OpenBLAS
For macOS, you can use Homebrew to install OpenBLAS:
Does Jetson Nano run macOS?
I am compiling it on my Jetson Nano
Response from Copilot
Step 1: Install OpenBLAS
For macOS, you can use Homebrew to install OpenBLAS:
Does Jetson Nano run macOS?
I missed that part. I was experiencing the same issue on macOS and thought this might be helpful.
It definitly will be helpful for others!!
I am compiling it on my Jetson Nano. I have openblas installed at:
libopenblas.so.0 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libopenblas.so.0 libopenblas.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libopenblas.so
But when I execute the "Cmake -D ..."
I still got error:
-- Could not find OpenBLAS include, defaulting to using OpenFace vended ones -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off CMake Error at cmake/modules/FindOpenBLAS.cmake:103 (MESSAGE): Could not find OpenBLAS Call Stack (most recent call first): CMakeLists.txt:14 (find_package)
Should I link the openblas somehow?