I'm trying to install Geant4 (version is 4.10.07.p01) and I got error refering to expat library priorities. I find a similar problem here Geant4 does not find Expat library and I followed the advice given. Since it's the first time I get into non-Windows OS, it is hard for me to understand some things. I changed the value to OFF but now I get the errors:
CMake Error at analysis/g4tools/CMakeLists.txt:36 (install):
install FILES given no DESTINATION
#but there is no CMakeLists.txt file in analysis/g4tools
CMake Error at analysis/CMakeLists.txt:36 (include):
include could not find load file:
Geant4MacroLibraryTargets
#but there is no CMakeLists.txt file in analysis
CMake Error at analysis/CMakeLists.txt:51 (GEANT_GLOBAL_LIBRARY_TARGET):
Unknown CMake command "GEANT4_GLOBAL_LIBRARY_TARGET"
#but there is no CMakeLists.txt file in analysis
Any help is welcome
Related
Following this post, if I run cmake .. inside my build folder with no options I get the error:
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
which I can solve by running
cmake .. -D CMAKE_MAKE_PROGRAM:PATH=/mingw64/bin/mingw32-make
However, I want to set the CMAKE_MAKE_PROGRAM from inside the CMakeLists.txt file. I tried the
if(MSYS)
set(CMAKE_MAKE_PROGRAM /mingw64/bin/mingw32-make)
endif(MSYS)
but it doesn't work. I would appreciate it if you could help me know how I can resolve this problem.
P.S.1. Here is the code.
P.S.2. I tried the
set(CMAKE_MAKE_PROGRAM /mingw64/bin/mingw32-makemingw32-make CACHE FILEPATH "" FORCE)
as suggested in the comments but it did not help.
P.S.3. My operating system is Windows 10 version 1909, and I'm running the above commands in MSYS2 terminal MSYS_NT-10.0-18363
Ok, I think I solved the problem. From here, I needed to install the MSYS2's make:
pacman -S make
This seems like a trend too me. I have recently had several problems in MSYS2 which have been resolved by removing the MinGW package and replacing it with the MSYS2 package. So it tells me that when working inside MSYS2 I should favor MSYS2 packages if they are available.
I'm trying to compile a simple Hello_world example using the Smooth component (https://github.com/PerMalmberg/Smooth), and get error: include could not find load file:
../lib/compiler_options.cmake.
It seems that COMPONENT_DIR is not set, but I'm not aware whether/where to set this, or where this should have been set.
I've been staring at this too long, and am not finding the (apparently) obvious problem. Anyone any thoughts?
ERROR
Note: You are using Python 3.8.0. Python 3 support is new, please report any problems you encounter. Search for 'Setting
the Python Interpreter' in the ESP-IDF docs if you want to use Python 2.7.
Checking Python dependencies...
Python requirements from C:\Esp32_tools\esp-idf-v3.3\requirements.txt are satisfied.
Running cmake in directory C:\Temp\esp\testCPP\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized C:\Temp\esp\testCPP"...
Warn about uninitialized values.
-- Building for target esp32
-- ccache will be used for faster builds
CMake Error at C:/Temp/esp/testCPP/externals/smooth/smooth_component/CMakeLists.txt:21 (include):
include could not find load file:
../lib/compiler_options.cmake
Call Stack (most recent call first):
C:/Esp32_tools/esp-idf-v3.3/tools/cmake/scripts/expand_requirements.cmake:107 (include)
C:/Esp32_tools/esp-idf-v3.3/tools/cmake/scripts/expand_requirements.cmake:217 (expand_component_requirements)`
CMake Error at C:/Esp32_tools/esp-idf-v3.3/CMakeLists.txt:39 (message):
Failed to expand component requirements
VERSION
C:\Temp\esp\testCPP>cmake --version
cmake version 3.13.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
CMakeLists.txt
set(CMAKE_CXX_STANDARD 17)
if(${ESP_PLATFORM})
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# Include Smooth as a component
set(EXTRA_COMPONENT_DIRS
externals/smooth/smooth_component)
project(name_of_your_project)
else()
# Empty project when not building for ESP (i.e. when loading the project into an IDE with already configured tool chains for native Linux)
endif()```
CMake Error at C:/Esp32_tools/esp-idf-v3.3/CMakeLists.txt:39 (message):
Failed to expand component requirements
You are missing this line in CMakeLists.txt
https://github.com/espressif/esp-idf/blob/master/examples/get-started/hello_world/CMakeLists.txt#L3
I'm trying to compile libzip on Windows using CMake to generate makefiles. Libzip needs zlib so I'm doing the following:
mkdir build
cd build
cmake -DZLIB_LIBRARY=../../../zlib-1.2.11 -DZLIB_INCLUDE_DIR=../../../zlib-1.2.11 ..
This doesn't work, however. I get the following error:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Why is that? I have defined ZLIB_LIBRARY and ZLIB_INCLUDE_DIR to point to the latest zlib.
I've also tried the following:
mkdir build
cd build
cmake .. -DZLIB_LIBRARY=../../../zlib-1.2.11 -DZLIB_INCLUDE_DIR=../../../zlib-1.2.11
When I run CMake like this, I get the following two warnings:
CMake Warning:
Manually-specified variables were not used by the project:
ZLIB_INCLUDE_DIR
ZLIB_LIBRARY
In comparison to the first approach, however, build files are now written to my build directory. When running nmake, however, only zlib seems to get built. libzip itself isn't built at all.
I'm out of ideas here. What am I doing wrong?
To answer my own question, using relative paths for ZLIB_LIBRARY and ZLIB_INCLUDE_DIR was the problem. When using absolute paths, it works just fine. Furthermore, ZLIB_LIBRARY needs to point to the library itself. Here is my final build line which works:
cmake -DZLIB_INCLUDE_DIR=d:\mystuff\zlib-1.2.11 -DZLIB_LIBRARY=d:\mystuff\zlib-1.2.11\build\zlibstatic.lib -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release ..
I've already compiled and installed libzypp, but when I want to compile zypper then Cmake returns an error:
CMake Error at CMakeLists.txt:11 (INCLUDE):
INCLUDE could not find load file:
ZyppCommon
CMake Error at CMakeLists.txt:24 (GENERATE_PACKAGING):
Unknown CMake command "GENERATE_PACKAGING".
-- Configuring incomplete, errors occurred!
See also "/home/origincode/zypper/CMakeFiles/CMakeOutput.log".
Environment
My OS: Fedora 26
gcc version:7.1.1
cmake version:3.9.1
The reason is, that CMake does not find the file ZyppCommon.cmake which contains the definition of the macro GENERATE_PACKAGING. The file is part of libzypp (located in cmake/modules/ZyppCommon.cmake).
You have three options:
Install libzypp, then zypper's CMake will find the file.
You have to include the path to the file to the CMake prefix path.
If you use some Suse / openSuse dritribution, installing libzypp-devel does install the required file.
If you have it installed, maybe you have to clear the CMake cache.
I'm trying to build an application via cmake 3.9.0. Cmake keeps complaining about the inability to find the tiff library: CMake error at CMakeModules/FindPackageHandleStandardArgs.cmake:51 (Message): Could not find REQUIRED package TIFF). I tried to install the library via sudo apt-get install libtiff5-dev but was still getting the same message. Then I checked-out the source code for libtiff 4 and built it from the source. Now I think we can hint the cmake with the location where to look for the libtiff via setting the variables TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS, etc as described here: https://cmake.org/cmake/help/v3.6/module/FindTIFF.html. However I have failed in wiring the right values for the variables. Can somebody show me an example of sample libtiff instalation and the sample values for the configuration variable in order cmake would find the TIFF. Or is here another option how to show CMake where does the TIFF library lie?
cd build
cmake -DTIFF_INCLUDE_DIR=<dir> -DTIFF_LIBRARY=<filename> -GNinja ..
cmake --build .
Alternatively, you can modify the variables in your CMakeLists.txt before calling find_package():
set(TIFF_INCLUDE_DIR "<dir>")
set(TIFF_LIBRARY "<filename>")
find_package(TIFF)
add_executable(myexe TIFF::TIFF)
where <dir> is the include directory path and <filename> is the exact file path to the library.