=================================================================
on cmd:
C:\Users\tianfang\Desktop\tianfang\src\hello>cmake -G “Green Hills MULTI” -T c:\ghs\comp_202214 -D GHS_OS_DIR=c:\ghs\int19015 -D GHS_BSP_NAME=platform-zynq-mp -D GHS_PRIMARY_TARGET=arm64_integrity.tgt -D GHS__BSP_NAME=platform-zynq-mp -D GHS__ARCH_NAME=arm64 -S . -B c:\build\hello
– The C compiler identification is GHS 2022.1.4
– The CXX compiler identification is GHS 2022.1.4
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/ghs/comp_202214/ccintarm64.exe - skipped
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/ghs/comp_202214/cxintarm64.exe - skipped
– Configuring done
– Generating done
CMake Warning:
Manually-specified variables were not used by the project:
GHS__ARCH_NAME
GHS__BSP_NAME
– Build files have been written to: C:/build/hello
Then exe gbuild:
c:\build\hello>gbuild -top myhello.top.gpj
macro not defined(__ARCH_NAME) …
macro not defined(__ARCH_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__ARCH_NAME) …
macro not defined(__ARCH_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__BSP_NAME) …
macro not defined(__ARCH_NAME) …
Building C:\build\hello\myhello.top.gpj
Compiling hello.c because hello.o does not exist
Output from Compiling hello.c:
“C:\Users\tianfang\Desktop\tianfang\src\hello\hello.c”, line 4: warning #951-D:
return type of function “main” must be “int”
void main()
^
Linking hello_test because it does not exist
Output from Linking hello_test.gpj:
ccintarm64: Warning: Cannot open library libinit.a
ccintarm64: Warning: Cannot open library libutil.a
ccintarm64: Warning: Cannot open library libINTEGRITY.a
[elxr] (error #21) cannot find library -linit
Error: build failed
c:\build\hello>
I’m new for multi ide on windows, I also look for info in multi manul, but failed to build them. any suggestions?
Never used the GHS generator, but according to the manual you need to specify the architecture with -A and there are no variables with two underscores as in your example.
Specifying the primary target should also be not necessary, as it seems to be the default. And for whatever reason the manual says to use CMake style path for -T.
So something like this should work:
-- The C compiler identification is GHS 2022.1.4
-- The CXX compiler identification is GHS 2022.1.4
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/ghs/comp_202214/ccintarm64.exe - skipped
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/ghs/comp_202214/cxintarm64.exe - skipped
CMake Warning at CMakeLists.txt:52 (find_package):
By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "gflags", but
CMake did not find one.
Could not find a package configuration file provided by "gflags" with any
of the following names:
gflagsConfig.cmake
gflags-config.cmake
Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
"gflags_DIR" to a directory containing one of the above files. If "gflags"
provides a separate development package or SDK, be sure it has been
installed.
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for execinfo.h
-- Looking for execinfo.h - not found
-- Looking for glob.h
-- Looking for glob.h - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - not found
-- Looking for libunwind.h
-- Looking for libunwind.h - not found
-- Looking for memory.h
-- Looking for memory.h - not found
-- Looking for pwd.h
-- Looking for pwd.h - not found
-- Looking for stdint.h
Could you please give some suggestions? How does cmake(check_include_file function) search include path on windows? @fdk17
When you assign to CMAKE_FIND_ROOT_PATH, it expects a list, but you’ve provided a single quoted string with space-separated values. Remove the quotes from your set(CMAKE_FIND_ROOT_PATH ...) call. Also note that wildcards are not supported, so c:/ghs/comp_202214/**ansi** is unlikely to do what you are probably expecting it to.
C:\ghs\src\glog-master>cmake -G “Green Hills MULTI” -A arm64 -T c:\ghs\comp_202214 -D GHS_OS_DIR=c:\ghs\int19015 -D GHS_BSP_NAME=platform-zynq-mp -D BUILD_SHARED_LIBS=ON -S . -B c:\ghs\build\glogtest --fresh --toolchain C:\ghs\toolchain.cmake
– The CXX compiler identification is GHS 2022.1.4
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/ghs/comp_202214/cxintarm64.exe - skipped
– Could NOT find GTest (missing: GTest_DIR)
CMake Warning at CMakeLists.txt:82 (find_package):
By not providing “Findgflags.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “gflags”, but
CMake did not find one.
Could not find a package configuration file provided by “gflags” (requested
version 2.2.2) with any of the following names:
gflagsConfig.cmake
gflags-config.cmake
Add the installation prefix of “gflags” to CMAKE_PREFIX_PATH or set
“gflags_DIR” to a directory containing one of the above files. If “gflags”
provides a separate development package or SDK, be sure it has been
installed.
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in posix
– Looking for pthread_create in posix - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - not found
– Check if compiler accepts -pthread
– Check if compiler accepts -pthread - no
– Could NOT find Threads (missing: Threads_FOUND)
– Could NOT find Unwind (missing: Unwind_INCLUDE_DIR Unwind_LIBRARY)
– Looking for _Unwind_Backtrace
– Looking for _Unwind_Backtrace - not found
– Looking for _Unwind_GetIP
– Looking for _Unwind_GetIP - not found
– Looking for C++ include dlfcn.h
– Looking for C++ include dlfcn.h - not found
– Looking for C++ include glob.h
– Looking for C++ include glob.h - not found
– Looking for C++ include inttypes.h
– Looking for C++ include inttypes.h - not found
– Looking for C++ include memory.h
– Looking for C++ include memory.h - not found
– Looking for C++ include pwd.h
– Looking for C++ include pwd.h - not found
– Looking for C++ include stdint.h
log of cmake config:
– Looking for C++ include inttypes.h
– Looking for C++ include inttypes.h - not found
CMake Debug Log at CMakeLists.txt:108 (find_file):
find_file called with the following settings:
=================================
inttypes.h is not found.
And this debug only print the search path of find_file() macro, not print for check_include_file_cxx() macro, right? How to print search path for check_include_file_cxx() macro if I am corrected?
You can insert macros into the top level project by using GHS_GPJ_MACROS. Something like set(GHS_GPJ_MACROS "__ARCH_NAME=arm64" "__BSP_NAME=platform-zynq-mp") should insert the macros into the top level project. This variable needs to be prior to a project() call like in a toolchain file, or on the command line, or in the same CMakeLists.txt file as the project() command.