Eclipse IDE installation Details, org.eclipse.swt.win32.win32.x86_64 is present but not in Run Config, or the Platform Config, or ".product" file - eclipse-plugin

Unable to include the 64 bit version of SWT jar as it does not show up in any of the list in the ".product" file, the run configuration or the Target platform dialogs.
I have verified that is it installed by looking under the Eclipse IDE installation Details.
Eclipse.org Standard Widget Toolkit for Windows 3.110.0.v20190305-0602 org.eclipse.swt.win32.win32.x86_64
I expect to see org.eclipse.swt.win32.win32.x86_64 but only find org.eclipse.swt.win32.win32.x86
eclipse.buildId=unknown
java.version=1.8.0_211
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product x.product -password (omitted)
Command-line arguments: -product x.product -data C:\Users\ \x-workspace/../runtime-Complete_64BW10.product -dev file:C:/Users/ /x-workspace/.metadata/.plugins/Complete_64BW10.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -password (omitted) -password (omitted)

Related

How to make working CUDA 11.6 with CMake 3.23 and MSVC 2019

I cannot find a solution to manage how to use the langage CUDA in a CMake project on Windows with the standard MSVC 2019 compiler.
I am trying to configure and compile this hello-cmake-cuda repository (also described in this blog post).
CMakeLists.txt file contents:
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(hello LANGUAGES CXX CUDA)
enable_language(CUDA)
add_executable(hello hello.cu)
Here is the output to the cmake .. command, run from within the build directory:
PS C:\GitRepo\cuda_hello\build> cmake ..
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22000.
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:311 (message):
CMAKE_CUDA_ARCHITECTURES must be valid if set.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeError.log".
It means that architectures_tested from CMakeDetermineCUDACompiler.cmake:311 is empty...
How can I get CMake to complete its configuration and the simple program to build?
My development environment
Operating system: Windows 11 Version 10.0.22000 Build 22000
Compiler: Microsoft Visual Studio Community 2019 Version 16.11.11
CMake version is 3.23
CUDA version is 11.6
I have tried different versions of each soft and keep having the same issue. I have decided to stay with these versions at the moment.
My GPU is properly configured: It shows up with nvidia-smi, and I am also able to build and run the deviceQuery CUDA sample:
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "NVIDIA GeForce GTX 1650"
CUDA Driver Version / Runtime Version 11.6 / 11.6
CUDA Capability Major/Minor version number: 7.5
etc. etc. ...
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.6, CUDA Runtime Version = 11.6, NumDevs = 1
Result = PASS
My environment PATH variable:
PS C:\GitRepo\hello-cuda-cmake-master> $env:path -split ";"
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\libnvvp
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Python38\Scripts\
C:\Python38\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
C:\Program Files\PuTTY\
C:\Program Files (x86)\PuTTY\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\TortoiseSVN\bin
C:\Program Files\TortoiseGit\bin
C:\Program Files\Microsoft VS Code\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
C:\Program Files\Git\cmd
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.1.1\
C:\Program Files\CMake\bin
C:\Ruby30-x64\bin
C:\Users\Thibault GEFFROY\.cargo\bin
C:\Users\Thibault GEFFROY\AppData\Local\Microsoft\WindowsApps
C:\Program Files\OpenCppCoverage
C:\intelFPGA\20.1\modelsim_ase\win32aloem
What I've tried and hasn't worked
If I try to insert the wanted CMAKE_CUDA_ARCHITECTURES :
set(CMAKE_CUDA_ARCHITECTURES 75)
I get:
PS C:\GitRepo\cuda_hello\build> cmake ..
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22000.
-- The CUDA compiler identification is unknown
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:654 (message):
The CMAKE_CUDA_ARCHITECTURES:
75
do not all work with this compiler. Try:
instead.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeError.log".
If I try to use the FindCUDA module to set CMAKE_CUDA_ARCHITECTURES - the solution given by #alfC here - I get:
PS C:\GitRepo\cuda_hello\build> cmake ..
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA/select_compute_arch.cmake:120 (file):
file failed to open for writing (Permission denied):
/detect_cuda_compute_capabilities.cpp
Call Stack (most recent call first):
CMakeLists.txt:4 (CUDA_DETECT_INSTALLED_GPUS)
CMake Error: The source directory "CMAKE_FLAGS" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA/select_compute_arch.cmake:141 (try_run):
Failed to configure test project build system.
Call Stack (most recent call first):
CMakeLists.txt:4 (CUDA_DETECT_INSTALLED_GPUS)
CMake Error: TRY_COMPILE attempt to remove -rf directory that does not contain CMakeTmp:/detect_cuda_compute_capabilities.cpp
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeError.log".
finally, if I try to invoke find_package(CUDA), I get:
PS C:\GitRepo\cuda_hello\build> cmake ..
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA.cmake:677 (cmake_initialize_per_config_variable):
Unknown CMake command "cmake_initialize_per_config_variable".
Call Stack (most recent call first):
CMakeLists.txt:2 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/cuda_hello/build/CMakeFiles/CMakeError.log".
Edit 1:
Answer to #einpoklum solution this:
Thanks for the proposal but it doesn't work either.
Here is the output of the cmake -B build command in your repository:
PS C:\GitRepo\hello-cuda-cmake-master> cmake -B build
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22000.
-- The CUDA compiler identification is unknown
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
Failed to detect a default CUDA architecture.
Compiler output:
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/hello-cuda-cmake-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/hello-cuda-cmake-master/build/CMakeFiles/CMakeError.log".
The output is the same using PowerShell or a MSVC command prompt.
Here are the cmake variables and their value when using cmake-gui:
When using the simple nvcc build command: nvcc hello.cu from MSVC command prompt I get:
nvcc fatal   : Could not set up the environment for Microsoft Visual Studio using 'c:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX86/x86/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
The PATH is valid though, and the script vcvars64.bat exists at this location.
What happens if I add the find_package(CUDAToolkit) to the CMakeLists.txt
The new CMakeLists.txt:
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
find_package(CUDAToolkit)
project(hello LANGUAGES CUDA)
add_executable(hello hello.cu)
The output :
PS C:\GitRepo\hello-cuda-cmake-master> cmake -B build
-- Building for: Visual Studio 16 2019
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include (found version "11.6.124")
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22000.
-- The CUDA compiler identification is unknown
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
Failed to detect a default CUDA architecture.
Compiler output:
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
See also "C:/GitRepo/hello-cuda-cmake-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/GitRepo/hello-cuda-cmake-master/build/CMakeFiles/CMakeError.log".
Edit 2:
I am trying to compile the CUDA sample BlackScholes without CMake, with the MSVC 2019 solution provided.
I end up with this error:
Severity Code Description Project File Line Suppression State
Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_37,code=\"sm_37,compute_37\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" -gencode=arch=compute_86,code=\"sm_86,compute_86\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64" -x cu -I./ -I../../../Common -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\/include" -I../../../Common -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" --threads 0 -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Fdx64/Debug/vc142.pdb /FS /Zi /RTC1 /MTd " -o "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.6\cuda-samples\Samples\5_Domain_Specific\BlackScholes\x64\Debug\BlackScholes.cu.obj" "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.6\cuda-samples\Samples\5_Domain_Specific\BlackScholes\BlackScholes.cu"" exited with code 1. BlackScholes C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.6.targets 790
While using WSL 2 Ubuntu 20.4 and the following CUDA installation and these instructions to build the BlackScholes sample I get this output:
$ sudo make BlackScholes
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../../Common -m64 -maxrregcount=16 --threads 0 --std=c++11 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o BlackScholes.o -c BlackScholes.cu
nvcc warning : The 'compute_35', 'compute_37', 'sm_35', and 'sm_37' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
ptxas warning : For profile sm_86 adjusting per thread register count of 16 to lower bound of 24
ptxas warning : For profile sm_80 adjusting per thread register count of 16 to lower bound of 24
ptxas warning : For profile sm_70 adjusting per thread register count of 16 to lower bound of 24
ptxas warning : For profile sm_75 adjusting per thread register count of 16 to lower bound of 24
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../../Common -m64 -maxrregcount=16 --threads 0 --std=c++11 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o BlackScholes_gold.o -c BlackScholes_gold.cpp
nvcc warning : The 'compute_35', 'compute_37', 'sm_35', and 'sm_37' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o BlackScholes BlackScholes.o BlackScholes_gold.o
nvcc warning : The 'compute_35', 'compute_37', 'sm_35', and 'sm_37' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
mkdir -p ../../../bin/x86_64/linux/release
cp BlackScholes ../../../bin/x86_64/linux/release
$ ./BlackScholes
[./BlackScholes] - Starting...
GPU Device 0: "Turing" with compute capability 7.5
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
Options count : 8000000
BlackScholesGPU() time : 0.722482 msec
Effective memory bandwidth: 110.729334 GB/s
Gigaoptions per second : 11.072933
BlackScholes, Throughput = 11.0729 GOptions/s, Time = 0.00072 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.741792E-07
Max absolute error: 1.192093E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
Test passed
Beginning with CMake 3.18, we no longer use the FindCUDA.cmake module - neither directly nor via find_package(CUDA). This has been replaced with find_package(CUDAToolkit) (which used the FindCUDAToolkit.cmake module).
But actually, for your simple hello-world project - you don't even need to do that, since starting with CMake 3.8, CUDA is a "first-class citizen" language for CMake. Well, kind of. So, here's a CMakeLists.txt file you can use:
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
PROJECT(cuda_hello LANGUAGES CUDA)
add_executable(hello hello.cu)
I've tested this on a Windows 10 (Enterprise Evaluation) VM, using CUDA 11.6 and Visual Studio 16 (a.k.a. VS 2019).
Note: The version number in the cmake_minimum_required() line may be critical! With the version number at the cuda_hello repository - it doesn't work for me, since a CMAKE_CUDA_ARCHITECTURES value is demanded to be present.
Now, after you configure using CMake, you can run ccmake, where you'll see the CMAKE_CUDA_ARCHITECTURES value. Change it to what you want to use. Again, I'm offering you the simplest and most basic way to do things, not necessarily the fanciest and most robust.
I've set all of this up for you in a fork of the hello-cuda-cmake repository.
Try to add:
set(CMAKE_CUDA_ARCHITECTURES 60 61 62 70 72 75 86)
set(CMAKE_CUDA_COMPILER /usr/local/cuda-11.6/bin/nvcc)
check your CUDA arch in https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ and change the parameter of CMAKE_CUDA_ARCHITECTURES.
And link the CMAKE_CUDA_COMPILER to nvcc.
this is my full CMakeLists.txt:
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
set(CMAKE_CUDA_ARCHITECTURES 60 61 62 70 72 75 86)
set(CMAKE_CUDA_COMPILER /usr/local/cuda-11.6/bin/nvcc)
project(cudatest CUDA)
find_package(CUDAToolkit)
set(CMAKE_CUDA_STANDARD 14)
add_executable(cudatest main.cu)
set_target_properties(cudatest PROPERTIES
CUDA_SEPARABLE_COMPILATION ON)
My GPU is GeForce GTX 1660, CMake version 3.23, CUDA Version 11.6.
And this is a Docker image I made for developmenting some projects: https://github.com/GuangchenJ/cuda-dev, you can try to use it.
os env :
window 10 (visual studio 2022 Community)
cuda: cuda 11.6 , nvcc
cpp standard: 17
ide: vscode
cmake.
this project name is :hellogpu
cmake file:
cmake_minimum_required(VERSION 3.0.0)
project(hellogpu CUDA)
include(CTest)
enable_testing()
add_executable(${PROJECT_NAME} main.cu)
set_target_properties(${PROJECT_NAME} PROPERTIES
CUDA_SEPARABLE_COMPILATION ON)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
I had the same problem and I solved it by installing older version of CMake. More precisely: a version before 3.18.
Apparently CMake added first party language support for CUDA in 3.18 and that is where these nonsensical problems ("Try: indead") were coming from.

meson not producing any binary files

I have a C project using meson.
The meson file looks like this:
project('camtool', 'c', version : '0.0.1',default_options : ['c_std=c11'])
cxx = meson.get_compiler('c')
systemd_dep = cxx.find_library('systemd')
pthread_dep = cxx.find_library('pthread')
inc = include_directories('include')
subdir('include')
subdir('src')
executable('camtool', './src/test.c',
include_directories : inc,
dependencies : [systemd_dep,pthread_dep])
and my src/test.c looks like this:
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!")
return 0;
}
The output of meson build is:
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
Using 'PKG_CONFIG_PATH' from environment with value: '/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/lib/pkgconfig:/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/share/pkgconfig'
The Meson build system
Version: 0.56.0
Source dir: /workspaces/quark-v4l2
Build dir: /workspaces/quark-v4l2/build
Build type: cross build
Project name: camtool
Project version: 0.0.1
Using 'CFLAGS' from environment with value: ' -O2 -pipe -g -feliminate-unused-debug-types '
Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: ''
C compiler for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux (gcc 9.3.0 "x86_64-poky-linux-gcc (GCC) 9.3.0")
C linker for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux ld.bfd 2.34.0.20200220
C compiler for the build machine: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
C linker for the build machine: cc ld.bfd 2.31.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library systemd found: YES
Library pthread found: YES
Build targets in project: 1
Found ninja-1.10.0 at /opt/poky/3.1.6/sysroots/x86_64-pokysdk-linux/usr/bin/ninja
After i run meson build, i run find . | grep camtool but it does not find the binary.
Where do i find the binary produced by meson?
Okay, i found out the reason is i misunderstood some steps in meson.
Meson build seems to be a build setting generating the build folder, but not actually building anything.
To make it build, i had to run ninja from the build directory.
Running ninja gave me an error, as my test.c was missing a semicolon.
After adding the semicolon and rerunning ninja, the binary was produced

Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment whithin gitlab env

I've a strange phenomenom happening that I don't know how to investigate.
I hope someone already encountered this an can provide tips
I'm using gitlab CI to build some Qt based projects.
gitlab runner calls a script named build.sh that works just fine when I run it manually as "me" in my env dev.
However runner raises an error stating "Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment".
So I made sure g++ was available (g++ -version is OK) and in g++ is in PATH but pbm is still there.
here is part of the script where the problem resides and the investigation I performed
echo ">>>>>> now generating makefiles for ${PROJECT_FILE} <<<<<<"
export QTDIR=/usr/lib64/qt5
echo $QTDIR
echo QMAKESPEC is
qmake-qt5 -query QMAKE_SPEC
echo gcc version is
gcc --version
g++ --version
echo $PWD
whoami
$cmd_qMake -v
$cmd_qMake -makefile -o qMakefile ../src/${PROJECT_FILE}
echo PATH is $PATH
echo QMAKESPEC is
qmake-qt5 -query QMAKE_SPEC
echo gcc version is
gcc --version
g++ --version
and here is the output (sorry; this is in debug mode)
>>>>>> now generating makefiles for Communication.pro <<<<<<
+ export QTDIR=/usr/lib64/qt5
+ QTDIR=/usr/lib64/qt5
+ echo /usr/lib64/qt5
/usr/lib64/qt5
+ echo QMAKESPEC is
QMAKESPEC is
+ qmake-qt5 -query QMAKE_SPEC
linux-g++
+ echo gcc version is
gcc version is
+ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ g++ --version
g++ (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ echo /root/builds/3188cf72/0/EGNOS_V3/AIV-P/AIV-P/Shared/Communication/.buildchain
/root/builds/3188cf72/0/EGNOS_V3/AIV-P/AIV-P/Shared/Communication/.buildchain
+ whoami
root
+ qmake-qt5 -v
QMake version 3.1
Using Qt version 5.9.2 in /usr/lib64
+ qmake-qt5 -makefile -o qMakefile ../src/Communication.pro
Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
+ echo PATH is /opt/gcc-7.3.0/bin:/usr/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/bin
PATH is /opt/gcc-7.3.0/bin:/usr/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/bin
+ echo QMAKESPEC is
QMAKESPEC is
+ qmake-qt5 -query QMAKE_SPEC
linux-g++
+ echo gcc version is
gcc version is
+ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ g++ --version
g++ (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ for target in '"${TARGETS[#]}"'
As you can see, g++ seems available un runner's root PATH
So why is qMake failing?
Thanks for your help
Zaluum
I had the same error sudo apt install build-essential worked for me.
Well, finally found it!
Turns out that the error message is not clear at all or at least subject to interpretation.
It was not an issue with gcc that could not be found. It was however a problem with my env.
Root user did not have /usr/local/lib in its LD_LIBRARY_PATH (when I had it).
The reason why is needed is unclear to me but I suspect this is something to do with libisl being necessary for GCC 7.3.0 which is my QMAKE_CC.
Hope this helps somebody
Zaluum
In most of the cases, this is a problem with environment settings - especially path to compiler/toolchain etc.
On Windows it concerns PATH environment variable's setting. For example - when you use minGW toolchain with g++ you should have PATH set e.g.
C:\Qt\Tools\mingw810_64\bin
However sometimes setting it in Windows Control Panel is insufficient, because other application (you have installed) could play with PATH and overrided it. So I recommend to everyone facing this issue and fired all found possible solution, first - to check if printing PATH in cmd (command line Windows tool) follows PATH you have set in Control Panel. If not you can try:
Find reason for PATH is different,
Check if it is not problem described here: https://stackoverflow.com/a/65163187/8389251
Add new Windows User (new account) - and run there Qt Creator and compilation. (Still ensure you have properly set PATH in Control Panel)

Failed to configure CMake with Visual Studio 2010 Express

Can somebody help me please, I am trying to configure CMake with Visual Studio 2010 Express but it's failed. The whole error message is bellow :
The C compiler identification is MSVC 16.0.30319.1 The CXX compiler
identification is MSVC 16.0.30319.1 Check for working C compiler
using: Visual Studio 10 Check for working C compiler using: Visual
Studio 10 -- broken CMake Error at C:/Program Files/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "C:/Program Files/Microsoft Visual Studio
10.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/OpenCV2.2/build/CMakeFiles/CMakeTmp
Run Build
Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
cmTryCompileExec2312584318.vcxproj /p:Configuration=Debug
/p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 30/05/2013 20:16:01.
Project
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec2312584318.dir\Debug\".
Creating directory "C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.unsuccessfulbuild"
because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
"CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2312584318.dir\Debug\"
/Fd"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/Gd /TC /analyze- /errorReport:queue testCCompiler.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2312584318.dir\Debug\"
/Fd"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/Gd /TC /analyze- /errorReport:queue testCCompiler.c
testCCompiler.c
ManifestResourceCompile:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.embed.manifest.res" cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318_manifest.rc
Link:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE
/OUT:"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec2312584318.exe"
/INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
/MANIFEST
/ManifestFile:"cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG
/PDB:"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.pdb"
/SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:/OpenCV2.2/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2312584318.lib"
/MACHINE:X86
cmTryCompileExec2312584318.dir\Debug\cmTryCompileExec2312584318.exe.embed.manifest.res
cmTryCompileExec2312584318.dir\Debug\testCCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
[C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj]
Done Building Project
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj"
(default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
[C:\OpenCV2.2\build\CMakeFiles\CMakeTmp\cmTryCompileExec2312584318.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.64
CMake will not be able to correctly generate this project. Call
Stack (most recent call first): CMakeLists.txt:47 (project)
Configuring incomplete, errors occurred!
any advice?
Install the windows 7 SDK then install VC-Compiler-KB2519277. Fixed the issue for me.
Was having the same problem with CMake on win7x64. The problem relates to .NET 4.5. If you don't want to uninstall 4.5, and your Solution is already setup, make sure to disable incremental linking, otherwise you will not be able to build.
To fix your CMake issue, you will have to uninstall .NET 4.5 on your machine and re-install .NET 4.0 in order to get CMake to work (4.5 removes all of 4.0's assemblies, etc!)
Apparently can't install 4.0 while 4.5 is already installed, so use Windows Control Panel to do the uninstall (Control Panel\Programs\Programs and Features)
CMake does not consider this a bug, rather it is a MS issue.
If you have Net framework 4.5 installed, you have to update VS 2010 to SP1 in order to make some stuff work correctly. Sometimes you can overcome the problem by just setting off incremental build in project Configurations > Linker settings. If you have VS 2012 installed after VS 2010, then before updating the VS 2010, you need to search at MSDN for the article about avoiding dependencies. My guess is that you will have to uninstall newer versions before upgrading the older ones to new service packs. There is a set of pages in MSDN explaining each step. Just google them. I also had this problem with CMake. This is how i solved it. Furthermore, i already had Windows 7 SDK installed. So i am not sure if it is needed to be installed to solve this problem or not.
In my case installing the VC2010 Service Pack 1 solved my issue after a reboot.
Didn't installed the Windows SDK 7.1 at all or anything else.
If you don't want to re-install .NET Frameworks and/or making 400mb Windows SDK updates, try this lighter solution first.

install google eclipse plugin from command line using archive of the update site

I am trying to install google eclipse plugin from command line using steps from
http://www.lorenzobettini.it/2012/10/installing-eclipse-features-via-the-command-line/
I copied google eclipse plugin archive for eclipse juno into following directory :-
/home/ricky/_softwares/DevelopmentSoftwares/eclipsePluginsDropinsZipsFeatures/gae/
Now, i am trying to install google eclipse plugin from command line using below command :-
./eclipse -clean -purgeHistory -application org.eclipse.equinox.p2.director -noSplash -repository jar:file:/home/ricky/_softwares/DevelopmentSoftwares/eclipsePluginsDropinsZipsFeatures/gae/com.google.gdt.eclipse.suite.4.2.update.site_3.2.3.zip/ -installIUs file:/var/tmp/PPFs0awM0/updateSite/site.xml.Plugin
where file:/var/tmp/PPFs0awM0/updateSite/site.xml.Plugin is the identifier retrieved using below :-
Execution of command logs following error in eclipse/configuration directory :-
!SESSION 2013-05-07 01:42:13.111 -----------------------------------------------
eclipse.buildId=M20120914-1800
java.version=1.6.0_37
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -purgeHistory -application org.eclipse.equinox.p2.director -repository jar:file:/home/ricky/_softwares/DevelopmentSoftwares/eclipsePluginsDropinsZipsFeatures/gae/com.google.gdt.eclipse.suite.4.2.update.site_3.2.3.zip/ -installIUs file:/var/tmp/PPFs0awM0/updateSite/site.xml.Plugin
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product -clean -purgeHistory -application org.eclipse.equinox.p2.director -repository jar:file:/home/ricky/_softwares/DevelopmentSoftwares/eclipsePluginsDropinsZipsFeatures/gae/com.google.gdt.eclipse.suite.4.2.update.site_3.2.3.zip/ -installIUs file:/var/tmp/PPFs0awM0/updateSite/site.xml.Plugin
!ENTRY org.eclipse.osgi 4 0 2013-05-07 01:42:18.755
!MESSAGE Application error
!STACK 1
java.lang.IllegalArgumentException: Neither raw version nor format was specified: var
at org.eclipse.equinox.internal.p2.metadata.VersionParser.parse(VersionParser.java:165)
at org.eclipse.equinox.p2.metadata.Version.create(Version.java:79)
at org.eclipse.equinox.p2.metadata.Version.parseVersion(Version.java:141)
at org.eclipse.equinox.p2.metadata.VersionedId.<init>(VersionedId.java:59)
at org.eclipse.equinox.p2.metadata.VersionedId.parse(VersionedId.java:46)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.parseIUsArgument(DirectorApplication.java:217)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.processArguments(DirectorApplication.java:854)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.run(DirectorApplication.java:1031)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.start(DirectorApplication.java:1222)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Any pointers or links will be helpful.
Thanks in advance.. :)
Try using the command below instead.
./eclipse -application org.eclipse.equinox.p2.director -repository http://dl.google.com/eclipse/plugin/4.2 -installIUs com.google.gdt.eclipse.suite.e42.feature.feature.group -noSplash
The repository argument takes URLs and the id for the Google Plugin is com.google.gdt.eclipse.suite.e42.feature.feature.group. Take a look at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html