I'm encountering an error in building one of my ExternalProjects:
mingw32-make.exe[3]: *** No targets specified and no makefile found. Stop.
Here is the relevant code used to build it within my project:
FIND_PACKAGE(sphinxbase)
if (${SPHINXBASE_FOUND})
INCLUDE_DIRECTORIES(${SPHINXBASE_INCLUDE_DIR}/sphinxbase/)
else ()
ExternalProject_Add(
sphinxbase
GIT_REPOSITORY "https://github.com/syb0rg/sphinxbase.git"
#GIT_SHALLOW TRUE
SOURCE_DIR ${CMAKE_BINARY_DIR}/lib/sphinxbase
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE ON
LOG_DOWNLOAD ON
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_TEST ON
LOG_INSTALL ON
)
ExternalProject_Get_Property(sphinxbase SOURCE_DIR)
ExternalProject_Get_Property(sphinxbase BINARY_DIR)
SET(SPHINXBASE_SOURCE_DIR ${SOURCE_DIR})
SET(SPHINXBASE_BINARY_DIR ${BINARY_DIR})
SET(SPHINXBASE_LIBRARIES ${SPHINXBASE_SOURCE_DIR}/bin/Debug/x64/sphinxbase.lib)
SET(DEPENDENCIES ${DEPENDENCIES} sphinxbase)
INCLUDE_DIRECTORIES(${SPHINXBASE_SOURCE_DIR}/include/win32)
INCLUDE_DIRECTORIES(${SPHINXBASE_SOURCE_DIR}/include)
endif ()
SET(LIBS ${LIBS} ${SPHINXBASE_LIBRARIES})
${CMAKE_BINARY_DIR} is set correctly to C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build, and here is what part of the folder looks like:
As you can see, I have a Makefile present at the specified location. What's going on here? Why can't CMake/MinGW find it?
Supplemental build information, link to full project
My program's configure log:
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Release
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find sphinxbase (missing: SPHINXBASE_LIBRARY SPHINXBASE_INCLUDE_DIR)
-- Could NOT find pocketsphinx (missing: POCKETSPHINX_LIBRARY POCKETSPHINX_INCLUDE_DIR)
-- Could NOT find LibSndFile (missing: LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
-- Could NOT find tritium (missing: TRITIUM_LIBRARY TRITIUM_INCLUDE_DIR)
-- Any missing dependencies will be downloaded upon running "make"
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build
And build log:
[ 2%] Performing build step for 'PortAudio'
-- PortAudio build command succeeded. See also C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build/build-data/src/PortAudio-stamp/PortAudio-build-*.log
[ 4%] No install step for 'PortAudio'
[ 6%] Completed 'PortAudio'
[ 17%] Built target PortAudio
Scanning dependencies of target sphinxbase
[ 20%] Creating directories for 'sphinxbase'
[ 22%] Performing download step (git clone) for 'sphinxbase'
-- sphinxbase download command succeeded. See also C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build/build-data/src/sphinxbase-stamp/sphinxbase-download-*.log
[ 24%] No patch step for 'sphinxbase'
[ 26%] No update step for 'sphinxbase'
[ 28%] No configure step for 'sphinxbase'
[ 31%] Performing build step for 'sphinxbase'
CMakeFiles\sphinxbase.dir\build.make:110: recipe for target 'build-data/src/sphinxbase-stamp/sphinxbase-build' failed
CMakeFiles\Makefile2:103: recipe for target 'CMakeFiles/sphinxbase.dir/all' failed
Makefile:82: recipe for target 'all' failed
Stop using MinGW.
MinGW has not been updated since 2013. It has been replaced by Cygwin and
MSYS2. The MinGW project doesn’t even offer a 64-bit compiler.
Cygwin can be installed in about 3 minutes, I would give it a try.
Related
I'm actualy trying to compile a project on windows with the CMakeList.txt that I used to compile the project on linux.
Unfortunatly when I try to compile with windows powershell, cmake is saying :
cmake . -G "MinGW Makefiles"
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find SDL2_image (missing: SDL2_IMAGE_LIBRARIES)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/FindSDL2_image.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
At the first time it didn't scared me cause I know that I have to download every library and link them to the cmake.
After I download every library like this : screenshot of the files
I tried to link them into my cmake,
firstly adding them to my Environment Variables :screenshot
but that didn't work, he always says "impossible to find SDL2_image when its perfectly working on linux with the cmakeFound...
W/E if someone knows how to compile or add a library to cmake on windows it could be insane for me.
OS: MacOS 12.4
Installed cmake with
brew install cmake
cmake version 3.23.3
Installed clang with
xcode-select --install
clang++ version is 13.1.6
Trying to build ccls:
git clone https://github.com/MaskRay/ccls.git
mkdir build && cd build
cmake ..
And getting following output
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
CMake Error at CMakeLists.txt:72 (find_package):
By not providing "FindClang.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Clang", but
CMake did not find one.
Could not find a package configuration file provided by "Clang" with any of
the following names:
ClangConfig.cmake
clang-config.cmake
Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set
"Clang_DIR" to a directory containing one of the above files. If "Clang"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/Users/umed/projects/MaskRay/ccls/build/CMakeFiles/CMakeOutput.log".
See also "/Users/umed/projects/MaskRay/ccls/build/CMakeFiles/CMakeError.log".
Is there anyway to make brew's cmake work with system clang?
The question is not correct. CMake uses the system clang successfully, but it can't find clang libraries required by the project.
The Build manual lists the requirements, one of them is
Clang+LLVM headers and libraries, version >= 7
You get errors because you have not provided that dependency.
brew install llvm#13
I have an issue when running CMake on Windows 10 when avast antivirus is running.
I wrote a small basic CMakeLists.txt :
cmake_minimum_required(VERSION 3.10)
# set the project name
project(RayTracing)
# add the executable
add_executable(rat_tracing main.cpp)
When I run cmake -G "MSYS Makefiles" CMakeLists.txt with Avast activated I get::
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
Failed to open
C:/Users/pc/Documents/C++/MyRayTracing/CMakeFiles/CMakeTmp/CMakeLists.txt
Permission denied
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:4 (project)
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/msys64/mingw64/bin/gcc.exe
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:56 (try_compile):
Failed to open
C:/Users/pc/Documents/C++/MyRayTracing/CMakeFiles/CMakeTmp/CMakeLists.txt
Permission denied
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Check for working C compiler: C:/Program Files/msys64/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"C:/Program Files/msys64/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/pc/Documents/C++/MyRayTracing/CMakeFiles/CMakeOutput.log".
See also "C:/Users/pc/Documents/C++/MyRayTracing/CMakeFiles/CMakeError.log".
But when I disable Avast, everything works fine and I get :
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/pc/Documents/C++/MyRayTracing
I've done some research, but no one seems to have had the same problem. The most similar cases are those where Avast thinks Cmake is a virus.
Thx.
While working on another small c++ project, I find a solution to this problem.
Create a small "Hello word !" program.
main.cpp
#include <iostream>
int main() {
std::cout << "Hello word ! " << std::endl;
return 0;
}
And a small CMakeLists.txt.
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
# set the project name
project(Tutorial)
# add the executable
add_executable(Tutorial main.cpp)
The use cmake or cmake-gui to configure and build the project.
At this point, a warning from Avast will appear. It will say that CMakeLists.txt is trying to modify a protected directory, in my case it was "C:/Users/pc/Documents/" and will ask if you allow it or not.
Authorize it and it will work on any other project.
When i used vcpkg to install SEAL, it occurs this:
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: seal:x86-windows
Vcpkg version: 2021-01-13-unknownhash
Additionally, attach any relevant sections from the log files above.
C:\src\vcpkg\vcpkg\buildtrees\seal\config-x86-windows-dbg-out.log
-- The CXX compiler identification is MSVC 19.28.29335.0
-- The C compiler identification is MSVC 19.28.29335.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type (CMAKE_BUILD_TYPE): Debug
-- Microsoft SEAL debug mode: ON
-- Microsoft GSL: found
-- Found ZLIB: optimized;C:/src/vcpkg/vcpkg/installed/x86-windows/lib/zlib.lib;debug;C:/src/vcpkg/vcpkg/installed/x86-windows/debug/lib/zlibd.lib (found suitable version "1.2.11", minimum required is "1.2.11")
-- ZLIB: found
-- Configuring incomplete, errors occurred!
See also "C:/src/vcpkg/vcpkg/buildtrees/seal/x86-windows-dbg/CMakeFiles/CMakeOutput.log".
C:\src\vcpkg\vcpkg\buildtrees\seal\config-x86-windows-dbg-err.log
CMake Error at CMakeLists.txt:186 (message):
Zstandard: must be static
what's the maining of "Zstandard: must be static" ???
Please tell me how to fix it or how to install SEAL on Windows. Thanks!
SEAL requires Zstandard to be built statically. You can only use vcpkg to install a static SEAL if you want to have Zstandard support. To do this, specify the triple as follows (for example): .\vcpkg install seal:windows-x64-static.
I tried several adaptations, compiling monero under Windows 10, but I am still getting with mingw64 the compilation error message below. openssl is installed als under mingw64. The mingw64 environment is up-to-date.
# make release-static-win64
mkdir -p build/"MINGW64_NT-10.0-18362/master"/release
cd build/"MINGW64_NT-10.0-18362/master"/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=../../../../cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 ../../../.. && make
-- Found PythonInterp: D:/apps/msys64/mingw64/bin/python.exe (found version "3.8")
-- CMake version 3.15.5
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: D:/apps/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe
-- Check for working C compiler: D:/apps/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: D:/apps/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe
-- Check for working CXX compiler: D:/apps/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: D:/apps/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe
-- Building build tag win-x64
-- Found Git: D:/apps/msys64/usr/bin/git.exe (found version "2.24.1")
-- Checking submodules
-- Submodule 'external/miniupnp' is up-to-date
-- Submodule 'external/unbound' is up-to-date
-- Submodule 'external/rapidjson' is up-to-date
-- Submodule 'external/trezor-common' is up-to-date
-- Submodule 'external/randomx' is up-to-date
-- Could not find DEVELOPER_LOCAL_TOOLS in env (not required)
-- BOOST_IGNORE_SYSTEM_PATHS defaults to OFF
-- Could not find DEVELOPER_LIBUNBOUND_OLD in env (not required)
-- Building for a 64-bit system
-- Building internal libraries as static
-- MSYS location: D:/apps
-- Using LMDB as default DB type
-- looking for liblzma
-- Could not find libunwind (missing: LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES)
-- Stack trace on exception disabled
CMake Error at D:/apps/msys64/mingw64/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
D:/apps/msys64/mingw64/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
D:/apps/msys64/mingw64/share/cmake-3.15/Modules/FindOpenSSL.cmake:413 (find_package_handle_standard_args)
CMakeLists.txt:400 (find_package)
Any ideas how to solve?