Page 1 of 3

Better Linux Install Experience?

Posted: Sat Sep 19, 2020 9:20 pm
by Timmy
Well, it seems my posts was missing in migration, so I decided to make a new topic instead. :cool:

Anyway, I was trying to get more people on WoS* to play more with z88dk, and I got a reaction that z88dk is very user-unfriendly to install on Linux.

So I tried this on my old, slow, and not a lot of internet, formerly vista, but now linux computer, and see how it works.

And it got stopped at a point where the installation asks to be online to access the sdcc svn server.

Is there anyway to just download that part in advance so that I don't have to do this on my old computer? My poor computer can't handle such a large slow download and I don't really want it to be online.

I don't even use the sdcc part, so if I can skip it altogether, that's fine too.

Also, any chance to add a test to detect the wrong z80asm program if someone has it installed and then tell the user to change it?

Maybe a binary version too, but I think I'd rather build myself. The Windows version is just so much easier to work with.

*Anyway, here's the link on WoS: https://worldofspectrum.org/forums/disc ... rial-z88dk (don't mind the poor quality code, i might fix it later)

Re: Better Linux Install Experience?

Posted: Sat Sep 19, 2020 9:57 pm
by dom
Thanks Timmy - I'm glad you've posted, sorry that your posts went missing - I took a snapshot of the db on Monday since it all seemed quiet. Hopefully there's not too much else missing.

The sdcc bit: Paulo did some tweaks a few weeks ago: https://github.com/z88dk/z88dk/pull/1562 so by default it won't compile sdcc so that one is already sorted! If you're running from the last release, the easiest thing to do is to "touch bin/zsdcc" which will prevent it from being built.

The wrong z80asm issue is a bit of a pain and I've come across it a few times, the "best" fix would be to rename z80asm to z88dk-z80asm as I did for quite a few of the other tools, however doing that will probably break quite a few 3rd party build scripts. So we're left with a couple of other solutions:

1. Do a check for the right z80asm as you suggest
2. Create a wrapper script z88dk-z80asm which then invokes z80asm in the same directory (only on unix)

I think 2. gets the best of both worlds: if you're invoking directly then you should know what z80asm is in your path, and if you're not then it's transparently handled for you.

Regarding binaries, I suppose these days creating a snap is the best way to do this? I'd need to look into the steps needed though and whether I can outsource the building/storage to something I don't have to pay for - I've got 221gb of nightly builds stored on the build machine.

On the other hand, a docker image is produced nightly: https://hub.docker.com/r/z88dk/z88dk (instructions here: https://github.com/z88dk/z88dk/wiki/Docker-Usage) which might be a good stop-gap or alternative.

Re: Better Linux Install Experience?

Posted: Sun Sep 20, 2020 9:16 am
by Timmy
No problem, it's definitely different although it seems I can't change the colours on this new forums. (I used to have a different stylesheet when logged in, to remind me that I have been logged in on the forums.)

But erm, I think I got a lot further now with my build, using "touch bin/sdcc".

It now ends with:

Code: Select all

make -C testsuite
make[1]: Entering directory `/root/z88dk/testsuite'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/z88dk/testsuite'
make: Entering directory `/root/z88dk/libsrc'
/bin/sh: line 2: @make: command not found
/bin/sh: line 2: @make: command not found
/bin/sh: line 2: @make: command not found
/bin/sh: line 2: @make: command not found
make[1]: *** [subdirs-clean] Error 127
make: *** [classic-clean] Error 2
make: Leaving directory `/root/z88dk/libsrc'
I can build dstar (i think, for the spectrum) but not the program i wrote earlier, with these errors:

Code: Select all

Error at file 'zx_screenstr_callee.asm' line 35: symbol 'zx_cyx2saddr_callee' not defined
Error at file 'zx_screenstr_callee.asm' line 35: symbol 'ASMDISP_ZX_CYX2SADDR_CALLEE' not defined
Errors in source file /root/z88dk/lib/config/../..//lib/target/zx/classic/spec_crt0.asm:
Error at file 'zx_screenstr_callee.asm' line 35: symbol 'zx_cyx2saddr_callee' not defined
Error at file 'zx_screenstr_callee.asm' line 35: symbol 'ASMDISP_ZX_CYX2SADDR_CALLEE' not defined
I think I am still missing some stuff. But I have no clue what is missing.
I have tried building some system specific libraries after that (i don't need most of the other systems like aquarius) but I still got this error. Maybe I have to build all of them but I feel like that takes a while, and it was 3AM in the morning, so I didn't try.

Your question on binaries/snap, I must say I have no answer for you (yet).
And as for z88dk-z80asm... I do see a lot of other z88dk- prefixed binaries in the bin directory.

Re: Better Linux Install Experience?

Posted: Sun Sep 20, 2020 9:29 pm
by dom
I've no idea at this point what's going on with your build - it looks like a bit of the makefile is being treated as a shell script but I've no idea what part of clean is causing it.

So, back to basics! What Linux are you running and did you install the prequisites here: https://github.com/z88dk/z88dk/wiki/ins ... inux--unix

The linking error is a "me" problem, a while back I switched from the classic ZX screen routines to the newlib ones. Unfortunately the xy coordinates are swapped round in newlib so the assembler written zx_screenstr didn't pick up the macro fudge. I'll fix it up.

With regard to the binary question, it looks like snapcraft will build and host automatically when I set up the project so I'll spend some time figuring out the syntax and setup.

Re: Better Linux Install Experience?

Posted: Mon Sep 21, 2020 5:19 pm
by Timmy
Lemme see... I've installed most of it, except sdcc of course. Today I've also installed everything (still except sdcc) but now also with libboost (which is just a huge install but doesn't seem to do anything).

The installation still got stuck there.

With the "build.sh -k" option I've installed everything now.

There were still some stuff like:

Code: Select all

--- Building Gameboy Library ---

make[1]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
TARGET=gb TYPE=gbz80 z80asm -d -I/root/z88dk/lib/config//../ -mgbz80 -DFORgb -DSTANDARDESCAPECHARS -x/root/z88dk/libsrc//gb_clib @./gb.lst

--- Building Hübler/Evert-MC Library ---

make[1]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
TARGET=hemc TYPE=z80 z80asm -d -I/root/z88dk/lib/config//../ -DSTANDARDESCAPECHARS -DFORhemc -x/root/z88dk/libsrc//hemc_clib @./hemc.lst
But that might be because I don't have sdcc installed.

As for the other problem, zx_screenstr() seems to work now.
But, functions using zx_cyx2saddr() are not working well any more.

This means that all of the old spectrum codes that used to use zx_cyx2saddr() (and other similar functions) are now obsolete (and broken).
I understand that it's an interesting idea. But all the documentation still use the old functions.
I feel like this is a big change, and it probably means that I have to rewrite my code examples to have my own version of zx_cyx2saddr() code instead.
Because it seems easier for me to support a tutorial that doesn't have to depend on the nightly version before or after september 2020.

Still, I'm glad that I managed to install it now, even if it was a bit complcated. :)

Re: Better Linux Install Experience?

Posted: Mon Sep 21, 2020 5:52 pm
by dom
Timmy wrote: Mon Sep 21, 2020 5:19 pm Lemme see... I've installed most of it, except sdcc of course. Today I've also installed everything (still except sdcc) but now also with libboost (which is just a huge install but doesn't seem to do anything).
Yeah, boost is just needed for sdcc so no problems.
The installation still got stuck there.
What version of Linux are you using? The build machines are obviously Linux based and run through the same script so I'm going to need to reproduce from the start.
There were still some stuff like:

Code: Select all

--- Building Gameboy Library ---

make[1]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
TARGET=gb TYPE=gbz80 z80asm -d -I/root/z88dk/lib/config//../ -mgbz80 -DFORgb -DSTANDARDESCAPECHARS -x/root/z88dk/libsrc//gb_clib @./gb.lst
That's good stuff - libraries building! So no problems there.
As for the other problem, zx_screenstr() seems to work now.
But, functions using zx_cyx2saddr() are not working well any more.

This means that all of the old spectrum codes that used to use zx_cyx2saddr() (and other similar functions) are now obsolete (and broken).
I understand that it's an interesting idea. But all the documentation still use the old functions.
I feel like this is a big change, and it probably means that I have to rewrite my code examples to have my own version of zx_cyx2saddr() code instead.
Because it seems easier for me to support a tutorial that doesn't have to depend on the nightly version before or after september 2020.
No, it's a cock-up, the compatibility #define had the arguments reversed, just for that function! The intention wasn't to break anything or cause any compatibility issues, just to reduce duplicate code.

Re: Better Linux Install Experience?

Posted: Mon Sep 21, 2020 6:26 pm
by Timmy
dom wrote: Mon Sep 21, 2020 5:52 pm
The installation still got stuck there.
What version of Linux are you using? The build machines are obviously Linux based and run through the same script so I'm going to need to reproduce from the start.
I use a version of Puppy Linux on this machine (because it's an old computer). So I don't think you should replicate that on your computer. That's why you see a lot of "/root" usage there. :D
That's good stuff - libraries building! So no problems there.
Yes, this works only after I used the "-k" option, but it works, and I can get things work now. Without the -k I would still be stuck just before the libraries being compiled. Also, if I set the z88dk path then I could have go to the libsrc directory and build myself, but it stopped if I used ./build.sh .
As for the other problem, zx_screenstr() seems to work now.
But, functions using zx_cyx2saddr() are not working well any more.
No, it's a cock-up, the compatibility #define had the arguments reversed, just for that function! The intention wasn't to break anything or cause any compatibility issues, just to reduce duplicate code.
So, do I need to download again? But for me, the version of yesterday (=current nightly), zx_cyx2saddr() had their parameters reversed. Note that this is cyx, and not the cxy version.

Re: Better Linux Install Experience?

Posted: Mon Sep 21, 2020 6:37 pm
by dom
Timmy wrote: Mon Sep 21, 2020 6:26 pmI use a version of Puppy Linux on this machine (because it's an old computer). So I don't think you should replicate that on your computer. That's why you see a lot of "/root" usage there. :D
I think you might win the "oldest hardware still in use" award, well apart form all those z80 machines! I've not used Puppy but since it's based off Ubuntu it should work...I'll see if I can set up a VM.
So, do I need to download again? But for me, the version of yesterday (=current nightly), zx_cyx2saddr() had their parameters reversed. Note that this is cyx, and not the cxy version.
The change is small: https://github.com/z88dk/z88dk/commit/a ... 7920f5f7f8 so just apply it manually yourself.

Re: Better Linux Install Experience?

Posted: Mon Sep 21, 2020 10:12 pm
by Timmy
dom wrote: Mon Sep 21, 2020 6:37 pm
So, do I need to download again? But for me, the version of yesterday (=current nightly), zx_cyx2saddr() had their parameters reversed. Note that this is cyx, and not the cxy version.
The change is small: https://github.com/z88dk/z88dk/commit/a ... 7920f5f7f8 so just apply it manually yourself.
Just a quick post to say that with this game, my code works again.

Re: Better Linux Install Experience?

Posted: Thu Sep 24, 2020 10:21 pm
by dom
Glad it's working again. Me and my fat fingers!

As an update:

- zcc now invokes z88dk-z80asm instead of z80asm, this should solve all the clash problems
- The bin/ folder after building now contains z88dk-z80asm and z80asm for compatibility reasons

In terms of the snap package, I've got devmode working with a bit of jiggery-pokery, the remaining things to do are:

- Move off devmode
- Build and include zsdcc
- Automatically register zcc, z88dk-z80asm, z88dk-tics as aliases
- Publish automatically

Re: Better Linux Install Experience?

Posted: Mon Sep 28, 2020 8:52 pm
by dom
I've managed to get a build working on most platforms, so there's an experimental snap file available at the snap-store: https://snapcraft.io/z88dk

I've not registered the aliases yet - but an end user can do that easily: https://github.com/z88dk/z88dk/wiki/Snap-usage

It's not going to help on Puppy unfortunately.

Re: Better Linux Install Experience?

Posted: Sat Oct 10, 2020 11:20 am
by cborn
Hi,
2 points:
it works for me on debian10
and
i am on the forum now so boardindex is working too !
so my experience realy got much better
thank you for providing z88dk!

Re: Better Linux Install Experience?

Posted: Sat Oct 10, 2020 9:09 pm
by dom
That's great - did you build it yourself or take the easy route out with a snap package?

Yes, apologies for that, the migration created two groups for "newly registered users", and I'd setup the permissions on the one that wasn't used.

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 4:28 pm
by cborn
Hi, probably this is the wrong tread, but i get this error with the latest nightly
Its still missing something despite installing all the new dependies, is it a perl package?

Code: Select all

g++ -std=gnu++17 -MMD -Wall -O3 -Isrc -Wextra -Werror -pedantic-errors -Isrc/cpp -c -o src/cpp/utils.o src/cpp/utils.cpp
In file included from src/cpp/utils.cpp:8:
src/cpp/utils.h: In function ‘std::__cxx11::string int_to_hex(T)’:
src/cpp/utils.h:53:11: error: ‘setfill’ is not a member of ‘std’
   << std::setfill('0') << std::setw(2)
           ^~~~~~~
src/cpp/utils.h:53:11: note: suggested alternative: ‘fill’
   << std::setfill('0') << std::setw(2)
           ^~~~~~~
           fill
src/cpp/utils.h:53:32: error: ‘setw’ is not a member of ‘std’
   << std::setfill('0') << std::setw(2)
                                ^~~~
src/cpp/utils.h:53:32: note: suggested alternative: ‘get’
   << std::setfill('0') << std::setw(2)
                                ^~~~
                                get
make[1]: *** [Makefile:77: src/cpp/utils.o] Error 1
make[1]: Leaving directory '/home/chris/z88dk/src/z80asm'
make: *** [Makefile:140: bin/z88dk-z80asm] Error 2


Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 4:40 pm
by dom
That's C++ 17 missing. There's a list of dependencies here: https://github.com/z88dk/z88dk/wiki/ins ... om-sources

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 5:59 pm
by cborn
Hi,
i have gcc-8 installed, i think its perl
perl 5.30 Larry Wall's Practical Extraction and Report Language

i have
5.28.1-6+deb10u1

maybe i have to migrate to debian 11, that is my plan anyway, but i have used al 4 off my bootable partitions.

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 7:44 pm
by derekfountain
I have gcc-9 installed, along with libstdc++-9-dev.

What does

dpkg -l | grep "libstdc++"

give you?

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 8:53 pm
by cborn
maybe even tomuch -8 ??

Code: Select all

$ dpkg -l | grep "libstdc++"
ii  libstdc++-8-dev:amd64                                       8.3.0-6                                 amd64        GNU Standard C++ Library v3 (development files)
ii  libstdc++6:amd64                                            8.3.0-6                                 amd64        GNU Standard C++ Library v3
ii  libstdc++6:i386                                             8.3.0-6                                 i386         GNU Standard C++ Library v3
ii  libstdc++6-armhf-cross                                      8.3.0-2cross1                           all          GNU Standard C++ Library v3

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 9:13 pm
by derekfountain
If you're running gcc-8 then the library package appears to be there. Check

gcc --version

You might have several versions of the compiler installed, many distros do that to maintain build compatibility with older projects.

Re: Better Linux Install Experience?

Posted: Thu Feb 17, 2022 10:20 pm
by cborn
I migth indeed,
i had and still have a big struggle with PCMENC, at least the build off it on my system
https://www.z88dk.org/forum/viewtopic.p ... enc#p19392
If some one has a working deb version i would like to download it.

Probably i have to much gcc installed.
but perl is one step behind aswell!!
i have 5.28 while 5.30 is needed as minimum

Re: Better Linux Install Experience?

Posted: Sun Feb 20, 2022 12:50 am
by cborn
I have an deb11 now and the lates z88dk works, it uses 'L' as common 'L'abel
cherio

Re: Better Linux Install Experience?

Posted: Sun Feb 20, 2022 1:09 am
by cborn
10 minutes is to short for editing:

question 1:
the two lines are very much identical, only 'Test::Cmd::Common' is extra in cspanm. if cspanm is done first, can the second list be shorter?

Code: Select all

      App::Prove Modern::Perl Capture::Tiny Capture::Tiny::Extended Path::Tiny File::Path Template Template::Plugin::YAML Test::Differences CPU::Z80::Assembler Test::HexDifferences Data::HexDump Object::Tiny::RW Regexp::Common List::Uniq
cpanm App::Prove                            Capture::Tiny::Extended            File::Path                                                   CPU::Z80::Assembler Test::HexDifferences               Object::Tiny::RW                List::Uniq Test::Cmd::Common 
question 2:
i am doing a real fresh install, on a new debian 11, that only installed for about 1-2 hours.
in the ubuntu perl reference some routine apear to be intsalled already.
is it psiible to add them to one of above lines?
or could this be due installe eg "build-essentials" although needed?
well, for me there are 3 lists doing 2 things.
if its al possible with cspanm, with out harming, is that a solotion?
or should i distinguish the test department realy?
then there should be only 2 lines i supose????
but i guess i am "through" anyway.
thanks for z88dk!!!

Re: Better Linux Install Experience?

Posted: Sun Feb 20, 2022 1:21 am
by cborn
all 3 perl lines compared, but is the way they are installed different ??

Code: Select all

      App::Prove Modern::Perl Capture::Tiny Capture::Tiny::Extended Path::Tiny File::Path Template Template::Plugin::YAML Test::Differences CPU::Z80::Assembler Test::HexDifferences Data::HexDump Object::Tiny::RW Regexp::Common List::Uniq
cpanm App::Prove                            Capture::Tiny::Extended            File::Path                                                   CPU::Z80::Assembler Test::HexDifferences               Object::Tiny::RW                List::Uniq Test::Cmd::Common 
                 Modern::Perl Capture::Tiny                         Path::Tiny            Template Template::Plugin::YAML Test::Differences                                          Data::HexDump                  Regexp::Common                              Text::Table Clone local::lib 

Re: Better Linux Install Experience?

Posted: Tue Jun 27, 2023 9:22 pm
by Timmy
Just for your information, I am currently migrating my development environment to Linux, and I've managed to get z88dk running now.

It wasn't the most well know build so I had to compile it and installing stuff, but it seems to work (still without SDCC, but that's fine).

My previous computer died and I don't have much of my libraries for now. But hopefully I can get them back soon.

Re: Better Linux Install Experience?

Posted: Wed Jun 28, 2023 1:08 am
by cborn
testdisk is nice, even if someone tried to kill your pc it will find something