English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 02 March 2023, 12:30   #1
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Building ACE as library

Hello,

Has anyone tried building ACE (Amiga C Engine) as the libace.a library? At first glance, everything seems to work:
  1. I installed everything I needed (most importantly AmigaCMakeCrossToolchains)
  2. I use Bartman's GCC version from the VSCode extension bartmanabyss.amiga-debug
  3. CMake works fine, it creates a Makefile without errors
  4. Make also finishes without errors.
  5. However, the building process ends up by creating object files only, the linking does not start - it looks there is no effort to create a library
  6. At the same time, according to https://github.com/AmigaPorts/ACE/bl...talling/ace.md section "Building standalone library", nothing else is needed.
  7. Unfortunately, I don't understand the CMake syntax, but it seems to me that CMakeLists.txt does not contain any commands to create the library and that the result of the build process should be really .obj files...

Any advice please?

Thanks a lot
STeN

CMake output
Code:
? cmake .. -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=d:/future2/rim_misc/helloworld/AmigaCMakeCrossToolchains/m68k-bartman.cmake -DTOOLCHAIN_PATH=c:/Users/petr.mazanec/.vscode/extensions/bartmanabyss.amiga-debug-1.7.1/bin/win32/opt -DM68K_CPU=68000 -DM68K_FPU=soft -DTOOLCHAIN_PREFIX=m68k-amiga-elf
-- The C compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/petr.mazanec/.vscode/extensions/bartmanabyss.amiga-debug-1.7.1/bin/win32/opt/bin/m68k-amiga-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/petr.mazanec/.vscode/extensions/bartmanabyss.amiga-debug-1.7.1/bin/win32/opt/bin/m68k-amiga-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at CMakeLists.txt:7 (set):
  Cannot set "ACE_DIR": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [ACE] Using mini std
-- Configuring done (5.4s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    M68K_FPU

-- Build files have been written to: D:/future2/rim_misc/ace/ace_lib/build
Make output
Code:
D:\future2\rim_misc\ace\ace_lib\build (master -> origin)
? make
[  2%] Building C object CMakeFiles/ace.dir/src/ace/managers/audio.c.obj
[  4%] Building C object CMakeFiles/ace.dir/src/ace/managers/blit.c.obj
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c: In function '_blitCheck':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:36:15: warning: unused parameter 'uwLine' [-Wunused-parameter]
   36 |         UWORD uwLine, const char *szFile
      |         ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:36:35: warning: unused parameter 'szFile' [-Wunused-parameter]
   36 |         UWORD uwLine, const char *szFile
      |                       ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c: In function 'blitSafeCopy':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:225:32: warning: unused parameter 'uwLine' [-Wunused-parameter]
  225 |         UBYTE ubMinterm, UWORD uwLine, const char *szFile
      |                          ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:225:52: warning: unused parameter 'szFile' [-Wunused-parameter]
  225 |         UBYTE ubMinterm, UWORD uwLine, const char *szFile
      |                                        ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c: In function 'blitSafeCopyAligned':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:307:15: warning: unused parameter 'uwLine' [-Wunused-parameter]
  307 |         UWORD uwLine, const char *szFile
      |         ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:307:35: warning: unused parameter 'szFile' [-Wunused-parameter]
  307 |         UWORD uwLine, const char *szFile
      |                       ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c: In function 'blitSafeCopyMask':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:410:61: warning: unused parameter 'uwLine' [-Wunused-parameter]
  410 |         WORD wWidth, WORD wHeight, const UWORD *pMsk, UWORD uwLine, const char *szFile
      |                                                       ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:410:81: warning: unused parameter 'szFile' [-Wunused-parameter]
  410 |         WORD wWidth, WORD wHeight, const UWORD *pMsk, UWORD uwLine, const char *szFile
      |                                                                     ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c: In function '_blitRect':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:436:30: warning: unused parameter 'uwLine' [-Wunused-parameter]
  436 |         UBYTE ubColor, UWORD uwLine, const char *szFile
      |                        ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/blit.c:436:50: warning: unused parameter 'szFile' [-Wunused-parameter]
  436 |         UBYTE ubColor, UWORD uwLine, const char *szFile
      |                                      ~~~~~~~~~~~~^~~~~~
[  6%] Building C object CMakeFiles/ace.dir/src/ace/managers/copper.c.obj
[  8%] Building C object CMakeFiles/ace.dir/src/ace/managers/game.c.obj
[ 10%] Building C object CMakeFiles/ace.dir/src/ace/managers/joy.c.obj
[ 12%] Building C object CMakeFiles/ace.dir/src/ace/managers/key.c.obj
[ 14%] Building C object CMakeFiles/ace.dir/src/ace/managers/log.c.obj
[ 16%] Building C object CMakeFiles/ace.dir/src/ace/managers/memory.c.obj
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c: In function '_memEntryAdd':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:33:42: warning: unused parameter 'uwLine' [-Wunused-parameter]
   33 |         void *pAddr, ULONG ulSize, UWORD uwLine, const char *szFile
      |                                    ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:33:62: warning: unused parameter 'szFile' [-Wunused-parameter]
   33 |         void *pAddr, ULONG ulSize, UWORD uwLine, const char *szFile
      |                                                  ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c: In function '_memEntryDelete':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:75:42: warning: unused parameter 'uwLine' [-Wunused-parameter]
   75 |         void *pAddr, ULONG ulSize, UWORD uwLine, const char *szFile
      |                                    ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:75:62: warning: unused parameter 'szFile' [-Wunused-parameter]
   75 |         void *pAddr, ULONG ulSize, UWORD uwLine, const char *szFile
      |                                                  ~~~~~~~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c: In function 'memEntryCheckTrash':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:126:40: warning: unused parameter 'uwLine' [-Wunused-parameter]
  126 |         const tMemEntry *pEntry, UWORD uwLine, const char *szFile
      |                                  ~~~~~~^~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/memory.c:126:60: warning: unused parameter 'szFile' [-Wunused-parameter]
  126 |         const tMemEntry *pEntry, UWORD uwLine, const char *szFile
      |                                                ~~~~~~~~~~~~^~~~~~
[ 18%] Building C object CMakeFiles/ace.dir/src/ace/managers/mouse.c.obj
[ 20%] Building C object CMakeFiles/ace.dir/src/ace/managers/ptplayer.c.obj
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c: In function 'setAudioDone':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c:969:42: warning: unused parameter 'pChannelData' [-Wunused-parameter]
  969 | static void setAudioDone(tChannelStatus *pChannelData) {
      |                          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c: In function 'printVoices':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c:990:42: warning: unused parameter 'pVoices' [-Wunused-parameter]
  990 | static void printVoices(const tModVoice *pVoices) {
      |                         ~~~~~~~~~~~~~~~~~^~~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c: In function 'intPlay':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c:1313:39: warning: unused parameter 'pCustom' [-Wunused-parameter]
 1313 | static void intPlay(volatile tCustom *pCustom) {
      |                     ~~~~~~~~~~~~~~~~~~^~~~~~~
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c: In function 'intDmaOn':
D:/future2/rim_misc/ace/ace_lib/src/ace/managers/ptplayer.c:1408:40: warning: unused parameter 'pCustom' [-Wunused-parameter]
 1408 | static void intDmaOn(volatile tCustom *pCustom) {
      |                      ~~~~~~~~~~~~~~~~~~^~~~~~~
[ 22%] Building C object CMakeFiles/ace.dir/src/ace/managers/rand.c.obj
[ 24%] Building C object CMakeFiles/ace.dir/src/ace/managers/sprite.c.obj
[ 26%] Building C object CMakeFiles/ace.dir/src/ace/managers/state.c.obj
[ 28%] Building C object CMakeFiles/ace.dir/src/ace/managers/system.c.obj
[ 30%] Building C object CMakeFiles/ace.dir/src/ace/managers/timer.c.obj
[ 32%] Building C object CMakeFiles/ace.dir/src/ace/managers/viewport/camera.c.obj
[ 34%] Building C object CMakeFiles/ace.dir/src/ace/managers/viewport/scrollbuffer.c.obj
[ 36%] Building C object CMakeFiles/ace.dir/src/ace/managers/viewport/simplebuffer.c.obj
[ 38%] Building C object CMakeFiles/ace.dir/src/ace/managers/viewport/tilebuffer.c.obj
[ 40%] Building C object CMakeFiles/ace.dir/src/ace/utils/bitmap.c.obj
[ 42%] Building C object CMakeFiles/ace.dir/src/ace/utils/bmframe.c.obj
[ 44%] Building C object CMakeFiles/ace.dir/src/ace/utils/chunky.c.obj
[ 46%] Building C object CMakeFiles/ace.dir/src/ace/utils/custom.c.obj
[ 48%] Building C object CMakeFiles/ace.dir/src/ace/utils/dir.c.obj
[ 51%] Building C object CMakeFiles/ace.dir/src/ace/utils/extview.c.obj
[ 53%] Building C object CMakeFiles/ace.dir/src/ace/utils/file.c.obj
[ 55%] Building C object CMakeFiles/ace.dir/src/ace/utils/font.c.obj
[ 57%] Building C object CMakeFiles/ace.dir/src/ace/utils/palette.c.obj
[ 59%] Building C object CMakeFiles/ace.dir/src/ace/utils/sprite.c.obj
[ 61%] Building C object CMakeFiles/ace.dir/src/ace/utils/string.c.obj
[ 63%] Building C object CMakeFiles/ace.dir/src/ace/utils/tag.c.obj
[ 65%] Building C object CMakeFiles/ace.dir/src/fixmath/fix16.c.obj
[ 67%] Building C object CMakeFiles/ace.dir/src/fixmath/fix16_exp.c.obj
[ 69%] Building C object CMakeFiles/ace.dir/src/fixmath/fix16_sqrt.c.obj
[ 71%] Building C object CMakeFiles/ace.dir/src/fixmath/fix16_str.c.obj
[ 73%] Building C object CMakeFiles/ace.dir/src/fixmath/fix16_trig.c.obj
[ 75%] Building C object CMakeFiles/ace.dir/src/fixmath/fract32.c.obj
[ 77%] Building C object CMakeFiles/ace.dir/src/fixmath/uint32.c.obj
[ 79%] Building ASM object CMakeFiles/ace.dir/src/bartman/gcc8_a_support.s.obj
[ 81%] Building C object CMakeFiles/ace.dir/src/bartman/gcc8_c_support.c.obj
[ 83%] Building C object CMakeFiles/ace.dir/src/mini_std/ctype.c.obj
[ 85%] Building C object CMakeFiles/ace.dir/src/mini_std/errno.c.obj
[ 87%] Building C object CMakeFiles/ace.dir/src/mini_std/intrin.c.obj
[ 89%] Building C object CMakeFiles/ace.dir/src/mini_std/printf.c.obj
[ 91%] Building C object CMakeFiles/ace.dir/src/mini_std/stdio_file.c.obj
[ 93%] Building C object CMakeFiles/ace.dir/src/mini_std/stdio_putchar.c.obj
[ 95%] Building C object CMakeFiles/ace.dir/src/mini_std/stdlib.c.obj
[ 97%] Building C object CMakeFiles/ace.dir/src/mini_std/string.c.obj
[100%] Building C object CMakeFiles/ace.dir/src/mini_std/strtoul.c.obj
[100%] Built target ace
8bitsten is offline  
Old 03 March 2023, 08:19   #2
KaiN
Registered User
 
Join Date: Sep 2018
Location: Poland
Posts: 15
Uhhh... Yeah. This way of building ACE is not so supported atm because it's not optimal way to do things.

ACE's CMakeLists.txt builds it as an "object library", which means a bunch of .obj files which are in turn linked into your executable if you do so using ACE. This allows for a whole lot more link-time optimizations than linking with .a file.

I'll bring back support for that later today by introducting cmake parameter, so you can do something like `cmake .. -DACE_STATIC_LIBRARY=ON` and add specific docs on how to invoke it. In the meantime you can try changing line:

Code:
add_library(${TARGET_NAME} OBJECT ${SOURCES} ${HEADERS})
into:

Code:
add_library(${TARGET_NAME} STATIC ${SOURCES} ${HEADERS})
Or modify things on your side to link with .o files, but I guess it's painful thing to do manually without CMake's target_link_libraries().
KaiN is offline  
Old 03 March 2023, 18:42   #3
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
@KaiN

Thanks a lot! I might have thought of that, but I'm just a total CMake noob and a beginner. I used it for the first time in ACE - it took me two hours today to figure out how to automatically copy the build to the shared directory in WinUAE, so that I don't have to do it manually every time... Something that I would have within a minute in Makefile - one must learn...

-------------

I have one more stupid question please - what about the logs please? The documentation says to use "-DCMAKE_BUILD_TYPE=Debug". I've tried all kinds of ways, but the log file is not created... More hours lost Can you help me with this please?

Thanks a lot.

STeN
8bitsten is offline  
Old 04 March 2023, 08:17   #4
KaiN
Registered User
 
Join Date: Sep 2018
Location: Poland
Posts: 15
I've just merged in the changes (see PR: https://github.com/AmigaPorts/ACE/pull/184 ). I've elaborated docs on standalone builds and added a bit more info about logging, see "Hello world" example. In short:

- if you want to have the logging as well as extra safety checks, you need the ACE_DEBUG define
- if you want to log to file and you're using generic/main.h, you need to specify the GENERIC_MAIN_LOG_PATH define. The reason is that logging to file is a large performance hit because of a need of turning on the OS each time you try to write to file.
- alternatively, you can use logging to UAE console by specifying ACE_DEBUG_UAE define. This is the most lightweight approach. It either logs to UAE console window (you need to enable it first inside the emulator!) or the Debug Console in vscode if you use Bartman's plugin.

Also, there are no stupid questions - just missing/old documentation which I consider a bug.
KaiN is offline  
Old 04 March 2023, 19:22   #5
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
@KaiN
Thanks for help, it works great!

Next are game states, keyboard, mouse, bitmaps and sprites… I am sure more questions will come… BTW is there some Discord or this forum is the best way to ask questions?

Have a nice day
STeN
8bitsten is offline  
Old 05 March 2023, 08:52   #6
KaiN
Registered User
 
Join Date: Sep 2018
Location: Poland
Posts: 15
You can catch me:
- here
- in ACE's github issues/discussions
- on AmigaDev discord (see link here)there's dedicated ACE channel
- I also check the AmigaGameDev discord regularly

so pick your poison. The discord thingy is the best approach here because that's what I'm usually looking at
KaiN is offline  
Old 05 March 2023, 11:37   #7
8bitsten
Registered User
 
Join Date: Apr 2022
Location: Brno
Posts: 30
Wow, that's great. This forum and Discord are great options. Thx.
8bitsten is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working on Converting the 17Bit PD Library and Assassins Library to ADF TheDrisk Amiga scene 5 24 April 2022 00:14
Problems building the asm version of render.library Rixa Coders. System 0 07 October 2020 22:49
HELP: Opus5, KingCON, SysInfo.library (Sysmon.library) triangle Michael support.Apps 6 10 March 2014 14:08
Ace alexh AMR contributions 6 14 August 2011 15:47
Anyone have ACE no. 40? Galaxy AMR data problems 2 18 December 2007 21:00

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:28.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.14833 seconds with 13 queries