"Conversion to non-scalar type is requested" error on linux terminal using cmake - c++

I faced an issue when i try to generate CodeLite using CMake. I encountered it during 'make -j4' step. it shows "Conversion to non-scalar type is requested".
'''
[ 68%] Built target codelitephp
[ 68%] Built target codelite-make
[ 69%] Built target codelite-terminal
[ 83%] Built target wxCrafter
[ 83%] [ 83%] [ 83%] Building CXX object LiteEditor/CMakeFiles/codelite.dir/CompilerMainPage.cpp.o
Building CXX object LiteEditor/CMakeFiles/codelite.dir/CompilersFoundDlgBase.cpp.o
Building CXX object LiteEditor/CMakeFiles/codelite.dir/CompilersFoundDlg.cpp.o
[ 83%] Building CXX object LiteEditor/CMakeFiles/codelite.dir/CompilersFoundDlg_liteeditor_bitmaps.cpp.o
[ 83%] Building CXX object LiteEditor/CMakeFiles/codelite.dir/CompilersModifiedDlg.cpp.o
/home/osboxes/Desktop/codelite-13.0/LiteEditor/CompilerMainPage.cpp: In member function ‘void CompilerMainPage::InitializeTools()’:
/home/osboxes/Desktop/codelite-13.0/LiteEditor/CompilerMainPage.cpp:543:76: error: conversion from ‘wxPGIterator<wxPGProperty,wxPropertyGridPageState>’ to non-scalar type ‘wxPGIterator<const wxPGProperty,const wxPropertyGridPageState>’ requested
wxPropertyGridConstIterator iter = m_pgMgrTools->GetGrid()->GetIterator();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
[ 83%] Building CXX object LiteEditor/CMakeFiles/codelite.dir/ConfigManagerBaseDlg.cpp.o
make[2]: *** [LiteEditor/CMakeFiles/codelite.dir/CompilerMainPage.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [LiteEditor/CMakeFiles/codelite.dir/all] Error 2
make: *** [all] Error 2
'''
Anyone can help me resolve the issue? I followed this GitHub link. It seems like there might be something wrong with the 'cmake' step. Greatly appreciate it if anyone can help me solve it!

This problem doesn't seem to be related to CMAKE rather than to the actual compilation.
I don't know the library personally but as far as I can tell from the wiki page you shared, it seems maybe those instructions might be outdated because it's dated from 2018 but there's recent changes in the library.
I would check the dependencies versions to see if they match with the one that the maintainer specifies in the README.md

I had similar problem when trying to compile CodeLite 13 on CentOS 7.6 clone OS. Manage to solve it by replacing following code string on line 543 of CompilerMainPage.cpp file,
located in "LiteEditor" subfolder:
wxPropertyGridConstIterator iter = m_pgMgrTools->GetGrid()->GetIterator();
by following code statement:
const wxPropertyGrid* pgrid = m_pgMgrTools->GetGrid();
wxPropertyGridConstIterator iter = pgrid->GetIterator();
Save that file and repeat compilation. In my case issue was solved and I could use now CodeLite 13 for my development projects (unfortunately CodeLite not available in rpm format for CentOS 7.x)

Related

No rule to make target `/usr/bin/openssl/lib', needed by `examples/example_ssl'. Stop

I am trying to build a C++ library(https://github.com/ipkn/crow) on macOS 12.0.1(Monterey).
Since I am learning C++ since yesterday, I have no clue what to do next with error message like this:
ld: warning: dylib (/usr/local/lib/libboost_system-mt.dylib) was built for newer macOS version (12.0) than being linked (11.3)
ld: warning: dylib (/usr/local/lib/libboost_thread-mt.dylib) was built for newer macOS version (12.0) than being linked (11.3)
[ 19%] Built target example_chat
Consolidate compiler generated dependencies of target example_ssl
[ 23%] Building CXX object examples/CMakeFiles/example_ssl.dir/ssl/example_ssl.cpp.o
make[2]: *** No rule to make target `/usr/bin/openssl/lib', needed by `examples/example_ssl'. Stop.
make[1]: *** [examples/CMakeFiles/example_ssl.dir/all] Error 2
make: *** [all] Error 2
/usr/bin/openssl is actually the result when which openssl is executed
My question: As a toddler in C++, how to debug an error message like this? What I have to learn as prerequisites ?

cmake error when i have tried to build a compilining?

i have tried to compline a repository via "https://github.com/giglio0/DRAGON-G4-LaBr3.git" but while the compiling, i have taken a error. I don't Know why it is? i am not a coder. Just i want to build this repository and run the simulation with changing some parameters. The error output is;
Scanning dependencies of target LaBr3_v4
[ 9%] Building CXX object CMakeFiles/LaBr3_v4.dir/LaBr3_v4.cc.o
[ 18%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorConstruction.cc.o
[ 27%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorMessenger.cc.o
[ 36%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/EventAction.cc.o
[ 45%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/HistoManager.cc.o
/home/cancan/Gatev9/example_Geant4/LaBr/LaBr3/src/HistoManager.cc:29:10: fatal error: TH1D.h: No such file or directory
29 | #include <TH1D.h>
| ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/LaBr3_v4.dir/build.make:134: CMakeFiles/LaBr3_v4.dir/src/HistoManager.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/LaBr3_v4.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
can anybody help me?
Apparently you need to install the ROOT library, see: https://root.cern.ch/doc/master/classTH1.html
BTW, the READ.me of the application you want to compile, DRAGON-G4-LaBr3, is awful.
After your advice, i install root-6.22.06 again with use this command;
cmake -DCMAKE_INSTALL_PREFIX=/home/cancan/Gatev9/root-6.22.06-install /home/cancan/Gatev9/root-6.22.06 -Dall=ON
i learned from somewhere if i use "-Dall=ON", i can install all libraries of root but it has not still worked.

Cannot find lpublic library

Trying to compile my project on Centos 8.2 using cmake 3.12, im facing with the following error:
cannot find -lpublic
here is full log:
[ 20%] Building CXX object CMakeFiles/ .cpp.o
[ 40%] Building CXX object CMakeFiles/ .cpp.o
[ 60%] Linking CXX shared library .so
[ 60%] Built target myproj
Scanning dependencies of target nist01
[ 80%] Building CXX object CMakeFiles/ .cpp.o
[100%] Linking CXX executable
/usr/bin/ld: cannot find -lpublic
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/nist01.dir/build.make:85: ...] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/...] Error 2
make: *** [Makefile:84: all] Error 2
Tried to find something on the internet, but nothing shown up.
Thanks for your help.
That seems like you try to link against the target "public", which is a suspicious target name. It might be target_link_libraries command with lowercase public instead of uppercase one, like target_link_libraryies(nist01 public something) instead of target_link_libraries(nist01 PUBLIC something).

Zephyr build error when trying to switch board target

I am trying to build zephyr sample code that is meant for board A for board B (i.e. build was written for code A but I need to change it so that it works with board B). I keep coming across this error and I am not sure how to get past it. I have replaced the /board, /soc, and /dts subfolders with appropriate files for my board. I changed the Makefile to target my board and it is successfully finding it.
This is the error:
cmake -B build -DBOARD=my_project_name ./
-- Using out-of-tree SOC definition
-- Zephyr version: 2.2.0
-- Found PythonInterp: /opt/homebrew/bin/python3.6 (found suitable version "3.6.2", minimum required is "3.6")
-- git describe failed: fatal: Not a git repository (or any of the parent directories): .git;
BUILD_VERSION is left undefined
-- Selected BOARD my_project_name
-- Found west: /usr/local/bin/west (found suitable version "0.7.2", minimum required is "0.6.0")
-- Loading /Users/my_name/file_dir/Firmware/projects/my_project_name/boards/arm/my_project_name/my_project_name.dts as base
Devicetree header saved to '/Users/my_name/file_dir/Firmware/projects/my_project_name/build/zephyr/include/generated/devicetree_unfixed.h'
Parsing /Users/my_name/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/Kconfig
Loaded configuration '/Users/my_name/file_dir/Firmware/projects/my_project_name/boards/arm/my_project_name/my_project_name_defconfig'
Merged configuration '/Users/my_name/file_dir/Firmware/projects/my_project_name/prj.conf'
Configuration saved to '/Users/my_name/file_dir/Firmware/projects/my_project_name/build/zephyr/.config'
Kconfig header saved to '/Users/my_name/file_dir/Firmware/projects/my_project_name/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /Users/my_name/file_dir/third-party/toolchains/gcc-arm-none-eabi-8-2018/arm-gcc-macos/bin/arm-none-eabi-gcc
-- Cache files will be written to: /Users/my_name/Library/Caches/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/my_name/file_dir/Firmware/projects/my_project_name/build
make -C build
Scanning dependencies of target driver_validation_h_target
[ 1%] Generating include/generated/driver-validation.h
[ 1%] Built target driver_validation_h_target
Scanning dependencies of target kobj_types_h_target
[ 2%] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h
[ 2%] Built target kobj_types_h_target
Scanning dependencies of target syscall_list_h_target
[ 2%] Generating misc/generated/syscalls.json
[ 3%] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[ 5%] Built target syscall_list_h_target
Scanning dependencies of target offsets
[ 6%] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
In file included from /Users/my_name/file_dir/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/arch/arm/include/aarch32/cortex_m/stack.h:23,
from /Users/my_name/file_dir/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/arch/arm/include/kernel_arch_data.h:33,
from /Users/my_name/file_dir/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/arch/arm/core/offsets/offsets_aarch32.c:26,
from /Users/my_name/file_dir/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/arch/arm/core/offsets/offsets.c:12:
/Users/my_name/file_dir/third-party/zephyr/zephyr_rtos/v2.2.0/zephyr/include/arch/arm/aarch32/cortex_m/cmsis.h:92:2: error: #error "DT_NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value."
#error "DT_NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value."
^~~~~
make[3]: *** [zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj] Error 1
make[2]: *** [zephyr/CMakeFiles/offsets.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [zephyr_project] Error 2
I have already checked to make sure that soc.h has #include <devicetree.h>. I'm not sure what else I can try now so any help is appreciated. Thanks!
Found the solution: I had to add dts_fixup.h to the bottom of my soc folder.

nvcc fatal : Value 'sm_13' is not defined for option 'gpu-architecture'

I am writing, because I have a problem with the installation of lama and therein the compilation of CUDA. I followed the tutorial on this page
http://libama.sourceforge.net/doc/d5/de9/page_linuxinstallation.html
and the command "make" gives me the following error:
[Kraut#Wzmbx001 build44]$ make
Scanning dependencies of target log4lama
[ 0%] Building CXX object logging/CMakeFiles/log4lama.dir/GenLogger.cpp.o
[ 1%] Building CXX object logging/CMakeFiles/log4lama.dir/GenLoggerCreator.cpp.o
[ 1%] Building CXX object logging/CMakeFiles/log4lama.dir/Level.cpp.o
[ 2%] Building CXX object logging/CMakeFiles/log4lama.dir/Logger.cpp.o
[ 2%] Building CXX object logging/CMakeFiles/log4lama.dir/LoggerProvider.cpp.o
[ 3%] Building CXX object logging/CMakeFiles/log4lama.dir/SourceLocation.cpp.o
Linking CXX shared library liblog4lama.so
[ 3%] Built target log4lama
[ 3%] Building NVCC (Device) object lama/cuda/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_CUDACOOUtils.cu.o
nvcc fatal : Value 'sm_13' is not defined for option 'gpu-architecture'
CMake Error at cuda_compile_generated_CUDACOOUtils.cu.o.cmake:202 (message):
Error generating
/opt/OpenFOAM/lama/build44/lama/cuda/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_CUDACOOUtils.cu.o
make[2]: *** [lama/cuda/CMakeFiles/cuda_compile.dir/./cuda_compile_generated_CUDACOOUtils.cu.o] Error 1
make[1]: *** [lama/cuda/CMakeFiles/amacuda.dir/all] Error 2
make: *** [all] Error 2
I looked for solutions to this problem and found these three answers, which seem to be closest to my problem:
https://devtalk.nvidia.com/default/topic/762051/jetson-tk1/compile-issues/?offset=4#4786865
How can i tell PyCUDA which GPU to use?
http://sourceforge.net/p/viennacl/mailman/message/34316211/
In these threads it is mentioned, that one should change or comment out the "-arch=sm_13"-option in a "Makefile" or a file "~.cmake". However I have no idea where to find this file, where I can modify this option. Can anybody help and guide me to where this file is located?
The problem appears to be quite common, since this option refers to the gpu-architecture supported by CUDA. I have CUDA-7.5 on my system, so from searching for a solution to this issue I understand, that sm_13 is not supported anymore. So I hope changing this will solve this problem - Just need to know where!
It would appear that the supported architectures are defined here in CompilerFlags.cmake :
### choosing the right compute capability
### we just start from version 1.3 ( 1.0 - 1.2 is not supported )
LIST ( APPEND CC_CHOICES "13" "20" "21" "30" "35" )
set ( CUDA_COMPUTE_CAPABILITY "13" CACHE STRING "CUDA compute capability (supported up from 13)" )
set ( CACHE CUDA_COMPUTE_CAPABILITY PROPERTY STRINGS ${CC_CHOICES} )
checkValue( ${CUDA_COMPUTE_CAPABILITY} "${CC_CHOICES}" )
mark_as_advanced ( CUDA_COMPUTE_CAPABILITY )
modify those as required