I am trying to compile dolfin on openSUSE Leap 42.3. I get an error with CMake when it tries to find Eigen3. I have Eigen3.3.4 installed on my machine and the error is
CMake Error at cmake/modules/FindEigen3.cmake:42 (file):
file failed to open for reading (No such file or directory):
/usr//usr/include/eigen3/Eigen/src/Core/util/Macros.h
I don't know why the extra /usr/ is popping up at the beginning. Can anyone help me? I can't find a solution online.
Okay, this was an...interesting, but perhaps silly error. Forgive me...I'm new to openSUSE. I originally installed eigen3 through YaST. This did not come with a CMakeList.txt file, so naturally I was confused by the answer in c++ - Unable to find Eigen3 with CMake. Moreover I was confused because Eigen is just header files, so naturally I assumed there would be nothing to make.
Long story short, there are MakeList's for Eigen. You just have to download the tarball from eigen.tuxfamily.org, then build them with cmake.
dolfin? I want to know are you in the CFD area.
I also have Eigen installed in my leap 42.3. But i installed it from the official website of Eigen. I think you may have a try and then specify the folder of the Eigne in Cmake-gui.
Good luck to you.
Related
I'm a *nix user, installing LLVM is easy for me, just download the precompiled file, set LLVM_DIR, and you're done. But I'm having a lot of problems with Windows ...
I downloaded LLVM-<version>-win64.exe from the GitHub release, but I can't find LLVMConfig.cmake file. Then I tried to compile LLVM from the source following this documentation.
When I started compiling my own project, I got this error:
'C:/<...>/Debug/libLLVMSupport.lib', needed by '<...>.exe', missing and no known rule to make it
I guess maybe I'm missing some compile options. but I can't find the documentation for LLVM_ENABLE_PROJECTS or BUILD_SHARED_LIBS, not even a list of component names.
I tried to add -DBUILD_SHARED_LIBS=ON but CMake told me BUILD_SHARED_LIBS option is not supported on Windows.
I'm interested in trying out Vulkan for myself, but I'm having difficulty getting CMake to link to it reliably. I decided to use CMake's FindVulkan module... or at least how I think it should work. Here's how I did it:
# Hey CMake. Look for Vulkan.
find_package(Vulkan REQUIRED)
# Alright, no errors? Tell me what you found!
message("Vulkan found? " ${VULKAN_FOUND})
message("Alright, where is it? " ${VULKAN_LIBRARY})
message("And I can include it? " ${VULKAN_INCLUDE_DIR})
And a little later in the file:
# Let's make a library and link vulkan
include_directories(${VULKAN_INCLUDE_DIR})
add_library(myLib myLib.cpp myLib.h)
target_link_libraries(myLib ${VULKAN_LIBRARY})
So, I get my results! First off, my CMake output:
Vulkan found? TRUE
Alright, where is it? VULKAN_LIBRARY-NOTFOUND
And I can include it? C:/VulkanSDK/1.0.65.1/Include
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
VULKAN_LIBRARY (ADVANCED)
linked by target "TOVE" in directory C:/Users/User/Desktop/TOVE
Odd, looks like you found my include directory, but you can't find my library. The messages in the middle are actually GLFW. I kept them in just incase they meant something more. Finally, CMake stops with an error.
Some additional testing reveals that both ${VULKAN_LIBRARIES} and ${VULKAN_INCLUDE_DIRS} are blank. As expected, swapping them out with their singular counterparts makes Visual Studio 2017 mountains of confused about my vulkan/vulkan.h include.
I can't find any case on the internet where someone gets a VULKAN_LIBRARY-NOTFOUND, but there might be another library that has similar issues. Why am I finding only half of the information here? Is it an issue with Vulkan or CMake, or am I just really bad at writing with CMake. I'm relatively new to CMake, and I'm just experimenting with it so I apologize if it was just me misusing some important function or something among those lines.
I had the same error while trying to compile GLFW 3.2.1 on Windows. The problem is that GLFW CMakeLists uses its own FindVulkan.cmake in "${GLFW_SOURCE_DIR}/CMake/modules" which seems a bit outdated.
Taking some code from the FindVulkan.cmake inside CMake distribution (3.10) to modify the GLFW file works as expected and VULKAN_LIBRARY cache var is filled with the path of the .lib file.
I am having a problem when loading CMake on CLion. I'm attempting to setup my proper environment for Arduino programming.
I'm probably missing something obvious, but I was unable to find a functional solution to this. Could anyone give me a hint as to what is causing the following errors?
Error:The CMAKE_C_COMPILER:
avr-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
Error:The CMAKE_CXX_COMPILER:
avr-g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
I got it working following the steps given in the arduino-cmake repo. If you're working on windows make sure you have the arduino sdk installed. And set the correct path in to the sdk.
If you're working on linux make sure you have all the correct dependencies installed as specified in the readme.md in the github repo.
And last but not least, ensure that de cmake directory and toolchain file are present in the project folder.
See
https://github.com/arduino-cmake/arduino-cmake
For proper instructions.
So trying to CMake libgit on windows, ive build a valid libssh2 but I'm getting this error when compiling libgit
checking for module 'libssh2'
package 'libssh2' not found
LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
Configuring done
now ive tried setting the default prefix path and ive tried setting library paths but I just cant get it to see my libssh2? any ideas?
its getting quite frustrating as I have it right here and it cant find it :D
maybe someone could tell me the correct path it should be installed?
Kind regards
Rob
****************Update 1****************
so i pulled out of the make file this....seems to have changed but as far as i can see PKG_CHECK_MODULES(LIBSSH2 libssh2) is the check, maybe it doesnt set LIBSSH2_FOUND?
# Optional external dependency: libssh2
IF (USE_SSH)
PKG_CHECK_MODULES(LIBSSH2 libssh2)
ENDIF()
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
#SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${LIBSSH2_LDFLAGS}")
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS)
ENDIF()
ELSE()
MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
ENDIF()
ive tried setting LIBSSH2_INCLUDE_DIRS /LIBSSH2_INCLUDE_DIR and LIBSSH2_LIBRARIES to no avail?
****************Update 2****************
So as per sugested its searching for the .pc file. well i found it....pointed it directly at it and it still couldnt find it? i even pointed it several directories up from it. the paths in the pc file seem to match the locations i would expect.? is this make file just completly borked?
checking for module 'libssh2'
package 'libssh2' not found
LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
****************Update 3****************
So update 3 i installed a binary of openssl on windows, further download libssh2-master and used cmake gui to build a visual studio solution which had no errors, the solution compiled and built. I made an install and package from the solution and installed in the suggested default location, i also took the header files, and library files and put them in my vc folder, and once i tried building the shared lib and put the dll in system32 etc so ive tried quite a lot :) libgit still cant find it
Hope thats a bit more info
****************Update 4****************
So fixed it in the end... i went back through the git history and blamed the make file. found someone originally wrote it with FIND_PACKAGE but changed it to suit their own needs.
so i changed it back and used the below. no longer complains and finds what it needs and compiles and works. so yay thanks for your help
IF (USE_SSH)
FIND_PACKAGE(LIBSSH2)
ENDIF()
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2")
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS)
ENDIF()
I actually started a new thread on this, i successfully managed it in the end. Answer is on
libgit2 with libssh2 and libopenssl on windows
so effectively
LIBSSH2_FOUND (set it to TRUE)
LIBSSH2_INCLUDE_DIRS
LIBSSH2_LIBRARY_DIRS
When i compile example2.cpp with armadillo makefile and run it i am getting an error message
error: det(): use of ATLAS or LAPACK needs to be enabled
How do i fix that? I have similar errors when i try to use solve. Details of my setup are:
Ubuntu Lucid Lynx 10.04
Armadillo version: 2.4.2 (Loco Lounge Lizard)
ATLAS 3.9.51
BOOST 1.48.0
g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
Atlas was installed before armadillo was, armadillo installation was configured with Cmake. I am far from an expert in cmake, but i thought that it was supposed to find ATLAS when i generated makefiles with it. Armadillo documentation seem to say that if i install with cmake i don't need to do any manual enabling of ATLAS. I tried to manually hack example2.cpp by inserting
#define ARMA_USE_ATLAS
before the headers, but it just generates a bunch of errors regarding missing stuff on Cblas. Maybe there is a step missing to allow cmake to find ATLAS. It feels i am missing something simple but key. Any help would be greatly appreciated.
Additional Detail:
Edit: for whatever reason i cannot add comment anymore, so i am posting a reply to #Appleman1234 answer below here.
I compiled armadillo and ATLAS from source. I thought that ATLAS has LAPACK and BLAS bundled in and optimized. When i compiled it, i passed a location to lapack tar like
./configure --shared --with-netlib-lapack-tarfile=/<path>/lapack-3.3.1.tgz
I also see in atlas lib directory the following files:
libatlas.a, libcblas.a, libf77blas.a, liblapack.a, libptcblas.a, libptf77blas.a libsatlas.so, libtatlas.so
which seem to indicate that blas, cblas, and lapack are installed on the system. However, CMakeCache.txt in armadillo seem to indicate that cmake didn't find BLAS, CBLAS, CLAPACK as follows
BLAS_LIBRARY:FILEPATH=BLAS_LIBRARY-NOTFOUND
There is no notion of ATLAS in CMakeCache.txt, so i assume that it wasn't found either. Maybe i am mistaken, but it seems that i somehow need to point cmake to ATLAS, i just don't know how. I could also be at error assuming that ATLAS has BLAS, LAPACK and CBLAS. I thought i compiled them as a part of ATLAS, but i could be wrong. Would appreciate your comments.
Solution to the problem:
What Dirk suggested almost worked. The problem as i mentioned in one of the replies to his post was cmake was balking. I misdiagnosed that as a problem with cmake not finding clapack. In fact, after looking more carefully at cmake output i realised it had problems with not finding good compiler or rather dragging its feet when it decided to use as compiler /usr/bin/c++. So i did CXX=g++ and then cmake again which worked fine. After that armadillo compiled fine.
Did you install armadillo from source ?
What did cmake output when running cmake . or ./configure ?
The latter just calls cmake ..
Did it output the values below ?
-- CLAPACK_FOUND = YES
-- CBLAS_FOUND = YES
If they are not YES, then according to CMakeLists.txt, ARMA_USE_ATLAS is set to false and ATLAS isn't used.
In order to use det or solve, install CLAPACK and CBLAS if you want to use ATLAS or just install LAPACK.
As armadillo exists in Debian / Ubuntu, you could simply install all the known build-dependencies to ensure you have all the -dev packages you need:
edd#max:~$ sudo apt-get build-dep armadillo
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
edd#max:~$
Appears that my system in complete in that regard.