CMake Error during OpenFAST building - C++ API on Linux #1109
Replies: 3 comments 24 replies
-
Hi @leopagamonci See this section of the FindMPI CMake docs: https://cmake.org/cmake/help/latest/module/FindMPI.html#variables-for-locating-mpi. I would try setting the MPI_HOME environment variable to the directory containing the mpi libraries. For example export MPI_HOME=/usr/lib/
cmake .. Let me know how this works for you. |
Beta Was this translation helpful? Give feedback.
-
Hi @rafmudaf , I have worked on the message("YAML_CPP_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR}") I get the following during building:
The find_package (PkgConfig REQUIRED)
pkg_search_module (yaml-cpp_PC yaml-cpp)
find_library (yaml-cpp_LIBRARY
NAMES yaml-cpp
HINTS
${yaml-cpp_PC_LIBDIR}
${yaml-cpp_PC_LIBRARY_DIRS})
**find_path (yaml-cpp_INCLUDE_DIR
NAMES yaml-cpp/yaml.h
PATH_SUFFIXES yaml-cpp
HINTS
/usr/include/
/usr/include/yaml-cpp/)**
mark_as_advanced (
yaml-cpp_LIBRARY
yaml-cpp_INCLUDE_DIR)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (yaml-cpp
REQUIRED_VARS
yaml-cpp_LIBRARY
yaml-cpp_INCLUDE_DIR
VERSION_VAR yaml-cpp_PC_VERSION)
set (yaml-cpp_LIBRARIES ${yaml-cpp_LIBRARY})
set (yaml-cpp_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR})
if (yaml-cpp_FOUND AND NOT (TARGET yaml-cpp::yaml-cpp))
add_library (yaml-cpp::yaml-cpp UNKNOWN IMPORTED)
set_target_properties (yaml-cpp::yaml-cpp
PROPERTIES
IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIRS})
endif () I am pretty sure that I am missing something, maybe the correct match of the names inside the CMake file and the Findyaml one. Thanks, Leonardo |
Beta Was this translation helpful? Give feedback.
-
As an alternative to the methods we've discussed in other replies here, I'm wondering if the best solution is to simply distribute the C++ API as a shared object through conda. @leopagamonci do you need to change the source code? If not, I'll compile the library on my linux computer and post it here to see how it works. Sound good? |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to build OpenFAST v3.0 with C++API enabled on a Linux machine with cmake3 command but I get this:
cmake3 -B build
-- Enabling Fortran 2008 features
-- A library with LAPACK API found.
-- Setting system file as: src/SysGnuLinux.f90
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIB_NAMES MPI_Fortran_F77_HEADER_DIR MPI_Fortran_MODULE_DIR MPI_Fortran_WORKS)
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND MPI_Fortran_FOUND)
Call Stack (most recent call first):
/usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake3/Modules/FindMPI.cmake:1717 (find_package_handle_standard_args)
glue-codes/openfast-cpp/CMakeLists.txt:24 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/pagamonci/OpenFAST/openfast2/openfast/build/CMakeFiles/CMakeOutput.log".
See also "/home/pagamonci/OpenFAST/openfast2/openfast/build/CMakeFiles/CMakeError.log".
Here are the two log files outputted:
CMakeError.log
CMakeOutput.log
From a first overview, it seems that"mpi.h" and "mpif.h" files are not found. What would be the quickest solution to solve this problem? Moreover, I am wondering if I missed other problems, so I kindly ask you what you would suggest
Thank you in advance for you kind response,
Leonardo
Beta Was this translation helpful? Give feedback.
All reactions