Bay 12 Games Forum

Dwarf Fortress => DF Gameplay Questions => Topic started by: sladc on April 12, 2019, 06:40:07 am

Title: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 06:40:07 am
Hi guys, I've been having some trouble trying to run the Masterwork mod on Linux and was wondering if you could help. Whenever I try and run ./start-df, it says :

./libs/Dwarf_Fortress: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory

I've tried installing ncurses, but it still says this.

Thanks for the help and sorry for bad English.

Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 10:03:12 am
Which linux? 32 bit or 64 bit?

On my Kubuntu (64bit), this is a copy/paste from my terminal where I ran the ldd command to find which curses files were being used, so you can compare:
df_linux/libs$ ldd Dwarf_Fortress  | grep curses
        libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5

I am not an expert....
Title: Re: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 10:37:40 am
Thanks for response, my computer is 64bit and when I typed what you did it says:

./Dwarf_Fortress: error while loading shared libraries: /usr/lib/libncurses.so.6: file too short
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 11:13:41 am
"File too short" indicates the libncurses.so.6 file has a different "interface" than the DwarfFortress code expects (or that the file is corrupt, but that is less likely). Is there any chance you downloaded the 32 bit curses? I am guessing...
Title: Re: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 12:23:35 pm
I think I installed both 32 and 64 when trying to get it to work.
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 12:57:34 pm
Try "whereis libncursesw.so.6" to see the locations the file is stored at (it will help you can see if there is multiple versions).
example:
/df_linux/libs$ whereis libncursesw.so.6
libncursesw.so: /lib/x86_64-linux-gnu/libncursesw.so.6 /lib/x86_64-linux-gnu/libncursesw.so.5
I do not recall needing to install curses and believe I do not have a 32 bit version installed.
Title: Re: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 04:29:57 pm
I typed whereis libncursesw.so.6 and it came out with:

libncursesw.so:

Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 04:55:51 pm
What version of linux?

What do you get when you run  apt list --installed  | grep libncurses ? That should show all of the installed curses packages...
Title: Re: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 05:49:28 pm
I'm running Ubuntu, and when I type that in it comes out with:

libncurses5/xenial,now 6.0+20160213-1ubuntu1 amd64 [installed]
libncurses5-dev/xenial,now 6.0+20160213-1ubuntu1 amd64 [installed]
libncursesw5/xenial,now 6.0+20160213-1ubuntu1 amd64 [installed]
libncursesw5-dev/xenial,now 6.0+20160213-1ubuntu1 amd64 [installed]
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 07:29:52 pm
The four packages you have installed should work, if you have 64 bit DF.

Did you know if the DF version you have is the 32 bit version? It is attempting to find curses in /usr/lib/ which is where older Ubuntu versions kept their 32 bit libraries. It should not be looking there unless DF is 32 bit or your Ubuntu is 5+ years old.

Can you copy and run these commands, then paste the results? One of them if for older Ubuntu versions and one for newer versions, so one of them will fail to find the directory.
ls /lib/x86_64-linux-gnu/*curse*
ls /usr/lib64/*curse*
Title: Re: Help with Masterwork Linux
Post by: sladc on April 12, 2019, 08:57:22 pm
For ls /lib/x86_64-linux-gnu/*curse* it says:

/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.5
/lib/x86_64-linux-gnu/libncursesw.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.6

and for ls /usr/lib64/*curse* it says:

ls: cannot access '/usr/lib64/*curse*': No such file or directory
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 12, 2019, 10:15:35 pm
okay, time to try one thing that will not break your system (but may not work)

Step 1)
To tell DF where the files are, you will create a set of symbolic links. This is something that will not break your OS if it doesn't work. Copy and run these commands in the ./df_linux/libs/ folder:
ln -s /lib/x86_64-linux-gnu/libncurses.so.5 ./libncurses.so.5
ln -s /lib/x86_64-linux-gnu/libncurses.so.5.9 ./libncurses.so.5.9
ln -s /lib/x86_64-linux-gnu/libncursesw.so.5 ./libncursesw.so.5
ln -s /lib/x86_64-linux-gnu/libncursesw.so.5.9 ./libncursesw.so.5.9
ln -s /lib/x86_64-linux-gnu/libncursesw.so.6 ./libncursesw.so.6


For each of the files you found, you should see a new item in the ./df_linux/libs/ folder. DF will probably only use one link, but having all will not hurt. If this doesn't work, you can delete them.

Try to start DF.

Step 2) If DF didn't start copy and run this command, then paste the results.
ls -lotr /lib/x86_64-linux-gnu/*curse*

That will show useful file detail. You have the four libraries that should be in the four packages but there is an extra library or an extra link. My DF is using an older curses library without a problem but I do not know if the Masterwork mod needs the newer one.
Title: Re: Help with Masterwork Linux
Post by: sladc on April 13, 2019, 08:47:47 am
I created the symbolic links but upon trying to run dwarf fortress it said:

./libs/Dwarf_Fortress: error while loading shared libraries: /usr/lib/libncurses.so.6: file too short

I entered ls -lotr /lib/x86_64-linux-gnu/*curse* and it came out with this:

-rw-r--r-- 1 root 138112 Feb 19  2016 /lib/x86_64-linux-gnu/libncurses.so.5.9
-rw-r--r-- 1 root 191464 Feb 19  2016 /lib/x86_64-linux-gnu/libncursesw.so.5.9
lrwxrwxrwx 1 root     17 Oct 19  2016 /lib/x86_64-linux-gnu/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx 1 root     18 Oct 19  2016 /lib/x86_64-linux-gnu/libncursesw.so.5 -> libncursesw.so.5.9
lrwxrwxrwx 1 root     16 Apr 10 00:03 /lib/x86_64-linux-gnu/libncursesw.so.6 -> libncursesw.so.5
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 13, 2019, 10:46:32 am
-rw-r--r-- 1 root 138112 Feb 19  2016 /lib/x86_64-linux-gnu/libncurses.so.5.9
-rw-r--r-- 1 root 191464 Feb 19  2016 /lib/x86_64-linux-gnu/libncursesw.so.5.9
lrwxrwxrwx 1 root     17 Oct 19  2016 /lib/x86_64-linux-gnu/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx 1 root     18 Oct 19  2016 /lib/x86_64-linux-gnu/libncursesw.so.5 -> libncursesw.so.5.9
lrwxrwxrwx 1 root     16 Apr 10 00:03 /lib/x86_64-linux-gnu/libncursesw.so.6 -> libncursesw.so.5
Of those listed, the first two are libraries and the last three are symbolic links. The last link is causing the "file too short" message (Masterwork DF wants the version 6 ncurses library and you only have the version 5 library. Your last link redirects version 6 requests to version 5, but that fails). I am fairly sure that you need a version 6 ncurses library that has been pre-compiled for Ubuntu Xenial (it is the Masterwork mod-pack that needs ncurses6, not DF).

I am looking if the pre-compiled version is available. I am also posting on the Masterwork Linux thread in the modding section.
Title: Re: Help with Masterwork Linux
Post by: sladc on April 13, 2019, 11:06:14 am
Great, thanks for all the help.
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 13, 2019, 02:15:08 pm
Delete out the 5 symbolic links in the ./df_linux/libs/ folder.

Try running these commands:
sudo apt-get update
apt-cache madison libncurses6


If it shows a libncurses6 package, that should be what you need, and you should be able to run this command to get it:
sudo apt-get install libncurses6

If there is no package to get, I believe the options are
- download and compile the ncurses6 code from gnu.org
- upgrade Ubuntu
- Play a different DF mod
Title: Re: Help with Masterwork Linux
Post by: sladc on April 13, 2019, 06:40:08 pm
After removing all of the symbolic links and reinstalling libncurses6 through the ubuntu software centre it finally worked. Thanks for all your help  :)
Title: Re: Help with Masterwork Linux
Post by: urmane on April 14, 2019, 09:23:24 am
I package the current Masterwork Linux dist (it's the only current one, AFAIK, so it appears you're using my package).

I'm running a Gentoo system (yes, still rockin' the Gentoo), and I recompile the video drivers to use current library versions - my system doesn't have the old ones included in vanila DF.

My system has this setup:
Code: [Select]
/bin/ls -ld /usr/lib*
lrwxrwxrwx   1 root root      5 Mar 16  2016 /usr/lib -> lib64
drwxr-xr-x  63 root root  86016 Mar 20 21:56 /usr/lib32
drwxr-xr-x 182 root root 176128 Mar 20 21:59 /usr/lib64
drwxr-xr-x  24 root root   4096 Mar 20 21:59 /usr/libexec

(which is why the paths all say "/usr/lib/...")

I'm not doing anything wacky with libraries, just using the distro defaults.  Here's my ncurses:
Code: [Select]
$ /bin/ls -l /usr/lib/libncurs*
-rwxr-xr-x 1 root root    530 May 30  2018 /usr/lib/libncurses.so
lrwxrwxrwx 1 root root     17 May 30  2018 /usr/lib/libncurses++.so -> libncurses++.so.6
-rwxr-xr-x 1 root root 296056 Jan 16  2018 /usr/lib/libncurses.so.5
lrwxrwxrwx 1 root root     19 May 30  2018 /usr/lib/libncurses++.so.6 -> libncurses++.so.6.1
-rwxr-xr-x 1 root root  77152 May 30  2018 /usr/lib/libncurses++.so.6.1
lrwxrwxrwx 1 root root     18 May 30  2018 /usr/lib/libncurses++w.so -> libncurses++w.so.6
-rwxr-xr-x 1 root root    531 May 30  2018 /usr/lib/libncursesw.so
-rwxr-xr-x 1 root root 349688 Jan 16  2018 /usr/lib/libncursesw.so.5
lrwxrwxrwx 1 root root     20 May 30  2018 /usr/lib/libncurses++w.so.6 -> libncurses++w.so.6.1
-rwxr-xr-x 1 root root  77152 May 30  2018 /usr/lib/libncurses++w.so.6.1

My ncurses6 looks to be almost a year old - is Ubuntu still maining 5?
Title: Re: Help with Masterwork Linux
Post by: anewaname on April 14, 2019, 12:13:50 pm
The ncurses5 package is still available, it was part of the core package with the ubuntu 16.04 release in 2016.

I knew nothing about ncurses two days ago and couldn't find internet chatter about problems with it, so I was being cautious about suggesting changes. I expect other DF players may have run into the same issue with Masterwork but knew how to handle the problem due to their experience with linux.