Feedback on build system xmake/xcommon etc

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
BritishCat
Member++
Posts: 20
Joined: Tue Oct 24, 2023 11:16 am

Post by BritishCat »

Hello. I've followed all the instructions you provided, but it doesn't work. It seems like the file xcommon.cmake hasn't been found. Also, there might be missing required software. What should i do next to build the reference applications?
Work@DESKTOP-QVIAP68 /d/xmos/proj/sw_usb_audio (develop)
$ cmake -G "Unix Makefiles" -B build
CMake Error at CMakeLists.txt:2 (include):
include could not find requested file:

/xcommon.cmake


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_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
I currently have the following versions installed software
C:\Users\Work>Cmake --version
cmake version 3.28.0-rc5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

C:\Users\Work>Git --version
git version 2.42.0.windows.2

C:\Users\Work>gcc --version
gcc (Rev7, Built by MSYS2 project) 13.1.0
Copyright (C) 2023 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.


User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

For now you will also have to set env variable XMOS_CMAKE_PATH to the location of the xcommon_cmake folder, this will need to be done until it's xcommon_cmake isreleased with the XMOS tools and it is added to the general setup script.. (This is in the documentation PDF as linked previously - section 2.2)
User avatar
BritishCat
Member++
Posts: 20
Joined: Tue Oct 24, 2023 11:16 am

Post by BritishCat »

Sorry, I've allready done all of these instructions, and still have the same problem. So i understood this sys env Variable must be an address of some CMake lybaries. But after installation CMake i can't find anything like `xcommon_cmake` in my file system. I tried to enter this command how it has been writen in instructions
set XMOS_CMAKE_PATH=C:\Users\MY WIN USERNAME\xcommon_cmake
in windows comand prompt, XTC command prompt in bash env. and without it. Nothing happened I'm in desperation. What am I doing wrong?
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You would need to replace MY WIN USERNAME etc to a correct and valid path to the xcommon_cmake folder
User avatar
BritishCat
Member++
Posts: 20
Joined: Tue Oct 24, 2023 11:16 am

Post by BritishCat »

Ofcourse I did it and had not any resoults yet. I red the instructions and you'r massages attentively many times. It said - just only add the path to the variable and run the command to compill, but it doessn't work that way! Because there is no any folder or file with name xcommon_cmake after installation CMake. Later, I realised (maybe I'm wrong, there where any information about it ) that I need to download libary by this link: https://github.com/xmos/xcommon_cmake.git Than put it into
C:\Users\User(my current user name in windows)\ and put it adress link into the XMOS_CMAKE_PATH sys.env. Variable. Next I tried to build an application and got other error
Work@DESKTOP-QVIAP68 /d/xmos/proj/sw_usb_audio/app_usb_aud_xk_316_mc (develop)
$ cmake -G "Unix Makefiles" -B build
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.
-- Configuring incomplete, errors occurred!
I don't know what to do now and how make it work. Please help me, I'm in a big sorrow about it
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Try setting CMAKE_MAKE_PROGRAM to xmake for the moment.
User avatar
BritishCat
Member++
Posts: 20
Joined: Tue Oct 24, 2023 11:16 am

Post by BritishCat »

Ross wrote: Sat Nov 25, 2023 8:38 pm Try setting CMAKE_MAKE_PROGRAM to cmake for the moment.
I understand so I need to install make program. I've installed https://www.mingw-w64.org this tools includes compillers and make tool. Than accociate var CMAKE_MAKE_PROGRAM with make.exe used

Code: Select all

cmake -DCMAKE_MAKE_PROGRAM=C:\w64devkit\bin\make.exe\ -B build
.

Than I tried to bild the referense applications, and got the following horrors instead of results. It’s too bad that I have to guess how to do this, because there is no clear description. The process started, the program even tried to download the libraries, but something went wrong. What I need to do now?
Work@DESKTOP-QVIAP68 /d/xmos/proj/sw_usb_audio (develop)
$ cmake -G "Unix Makefiles" -B build
-- Configuring application: app_usb_aud_xk_316_mc
-- Found build configs:
-- 1AMi2o2xxxxxx
-- 1SMi2o2xxxxxx
-- 2AMi10o10xssxxx
-- 2AMi16o8xxxaxx
-- 2AMi2o2xxxxxx
-- 2AMi8o16xxxxax
-- 2AMi8o8xxxxxx
-- 2AMi8o8xxxxxx_mix8
-- 2AMi8o8xxxxxx_tdm8
-- 2ASi8o8xxxxxx_tdm8
-- 2SMi8o8xxxxxx
-- 2SSi8o8xxxxxx
CMake Warning at C:/Users/Work/xcommon_cmake/xcommon.cmake:510 (message):
XMOS_DEPS_ROOT_DIR is deprecated; please use XMOS_SANDBOX_DIR instead
Call Stack (most recent call first):
app_usb_aud_xk_316_mc/CMakeLists.txt:56 (XMOS_REGISTER_APP)


-- Adding module lib_xua
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_xua/lib_xua/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_316_mc/CMakeLists.txt:56 (XMOS_REGISTER_APP)


-- Adding module lib_i2c
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_i2c/lib_i2c/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_316_mc/CMakeLists.txt:56 (XMOS_REGISTER_APP)


-- Generating commands for Pre-Compilation Analysis (PCA)
-- Configuring application: app_usb_aud_xk_216_mc
-- Found build configs:
-- 1AMi2o2xxxxxx
-- 2AMi10o10xssxxx
-- 2ASi10o10xssxxx
-- 2ASi16o16xxxxxx_tdm8
CMake Warning at C:/Users/Work/xcommon_cmake/xcommon.cmake:510 (message):
XMOS_DEPS_ROOT_DIR is deprecated; please use XMOS_SANDBOX_DIR instead
Call Stack (most recent call first):
app_usb_aud_xk_216_mc/CMakeLists.txt:43 (XMOS_REGISTER_APP)


-- Adding module lib_xua
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_xua/lib_xua/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_216_mc/CMakeLists.txt:43 (XMOS_REGISTER_APP)


-- Adding module lib_i2c
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_i2c/lib_i2c/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_216_mc/CMakeLists.txt:43 (XMOS_REGISTER_APP)


-- Generating commands for Pre-Compilation Analysis (PCA)
-- Configuring application: app_usb_aud_xk_evk_xu316
-- Found build configs:
-- 1AMi2o2xxxxxx
-- 2AMi2o2xxxxxx
CMake Warning at C:/Users/Work/xcommon_cmake/xcommon.cmake:510 (message):
XMOS_DEPS_ROOT_DIR is deprecated; please use XMOS_SANDBOX_DIR instead
Call Stack (most recent call first):
app_usb_aud_xk_evk_xu316/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Adding module lib_xua
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_xua/lib_xua/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_evk_xu316/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Adding module lib_i2c
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_i2c/lib_i2c/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_evk_xu316/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Generating commands for Pre-Compilation Analysis (PCA)
-- Configuring application: app_usb_aud_xk_evk_xu316_extrai2s
-- Found build configs:
-- 1AMi2o2xxxxxx
-- 2AMi2o2xxxxxx
CMake Warning at C:/Users/Work/xcommon_cmake/xcommon.cmake:510 (message):
XMOS_DEPS_ROOT_DIR is deprecated; please use XMOS_SANDBOX_DIR instead
Call Stack (most recent call first):
app_usb_aud_xk_evk_xu316_extrai2s/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Adding module lib_xua
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_xua/lib_xua/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_evk_xu316_extrai2s/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Adding module lib_i2c
CMake Error at C:/Users/Work/xcommon_cmake/xcommon.cmake:722 (include):
include could not find requested file:

D:/XMOS/proj/lib_i2c/lib_i2c/lib_build_info.cmake
Call Stack (most recent call first):
C:/Users/Work/xcommon_cmake/xcommon.cmake:528 (XMOS_REGISTER_DEPS)
app_usb_aud_xk_evk_xu316_extrai2s/CMakeLists.txt:30 (XMOS_REGISTER_APP)


-- Adding module lib_i2s
-- Adding module lib_xassert
-- Adding module lib_logging
-- Generating commands for Pre-Compilation Analysis (PCA)
-- Configuring incomplete, errors occurred!
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Are you doing this all from an XTC tools command prompt? (you shouldn't have to CMAKE_MAKE_TOOL, xcommon_cmake will set this to xmake if it's not set)
Do you have git installed?
User avatar
BritishCat
Member++
Posts: 20
Joined: Tue Oct 24, 2023 11:16 am

Post by BritishCat »

Hello, I have made a little progress. Today, I reinstalled all the tools, and it started working correctly!!! The program downloaded all libraries from GitHub by itself and built the "build" folder!!! I'm very happy about this, but I couldn't finish it. I selected this new "build" folder in comand promot and tried to run xmake
Unfortunately, instead of a binary file, there are again two errors
Work@DESKTOP-QVIAP68 /d/xmos/proj/sw_usb_audio/app_usb_aud_xk_316_mc/build (develop)
$ xmake
/usr/bin/sh: -c: line 1: syntax error near unexpected token `('
/usr/bin/sh: -c: line 1: `C:/Program Files (x86)/XMOS/XTC/15.2.1/bin/xmake -s -f CMakeFiles/Makefile2 all'
xmake: *** [all] Error 2
It's a pity I'm so close to success...
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

What does xmake VERBOSE=1 give you?

Does your build directory have a bracket in it's path?