You are not logged in.

#1 2014-04-23 19:01:32

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Trouble installing Scala

Hello

I'm having trouble installing Scala, a freeware musical software whose project site is here.

In short, as I attempt to execute the scala executable inside the program directory, I get the error message:

./scala: error while loading shared libraries: libgtkada.so.2.24.1: cannot open shared object file: No such file or directory

I followed the instructions in the INSTALL file which says to copy the libgtkada-2.24.so.2 file inside the program directory into /usr/local/lib, and to set the environment variable LD_LIBRARY_PATH=.:/usr/local/lib (by the way, notice the strange difference between the filename of the library in the error message, and that one inside the directory). Moreover, I installed gcc-ada and gtkada from Arch core repo and AUR, but it doesn't work either.

Anyone could help me unveiling all those Ada secrets? tongue

Offline

#2 2014-04-24 16:44:44

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

You're free to use non-free software, but if you do so then maintain at least minimum precautions. Installing a pre-compiled binary into a system-wide location is equal to giving access to any account to the author of the binary. Not a wise decision from security point of view.

Also never set, except maybe for tests in a single shell session, LD_LIBRARY_PATH or PATH to dot ("."). Keep paths there absolute.

With closed source software you'll run into problems on Linux. And I don't say it because I don't like it. The reasons are purely technical. Authors of software distributed as binaries can only compile it for a particular configuration. This means that the software expects everything to be configured exactly as it was during compilation. If it's not then expect lots of fun. The fun begins with invalid libraries locations or invalid versions of them, which is what you're encountering.

First of all, check what exactly you're missing with ldd. Assuming that you're in the directory where scala binary is located:

ldd scala

The above command should give you a list of libraries the binary depends on. What interests you are entries that are missing files. In english locale they're marked with "not found":

ldd scale | fgrep 'not found'

If the name doesn't match, you can just rename the file (or even better - link it) in the scala directory and set LD_LIBRARY_PATH to that directory. This should satisfy ld. You can also do the same for any other version of "libgtkada.so" - just make a link with required name. Be warned however that this hack is actually presenting different, probably binary incompatible version of library to the application. With minor version differences this may work for a while, but if you're going to link 3.x library to 2.x-based application you'll probably encounter crash or worse.

Last edited by mpan (2014-04-24 16:45:27)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2014-04-24 17:45:34

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Thank you mpan, but I still have the same issue.

What I did so far:

$ ldd scala | grep "not found"
   libgtkada.so.2.24.1 => not found
   libgnarl-4.6.so.1 => not found
   libgnat-4.6.so.1 => not found

$ echo $LD_LIBRARY_PATH
   /usr/lib:/home/riccardo/scala

Then I created some symbolic links in the scala directory this way:

$ ls -l lib*
   lrwxrwxrwx 1 riccardo users      24 Apr 24 19:20 libgnarl-4.6.so.1 -> /usr/lib/libgnarl-4.8.so
   lrwxrwxrwx 1 riccardo users      23 Apr 24 19:20 libgnat-4.6.so.1 -> /usr/lib/libgnat-4.8.so
   -rwxr-xr-x 1 riccardo users 4621060 Aug 22  2012 libgtkada-2.24.so.2
   lrwxrwxrwx 1 riccardo users      27 Apr 24 19:24 libgtkada.so.2.24.1 -> /usr/lib/libgtkada-3.4.so.2

Notice the different versions of the libraries that I got from the packets gcc-ada and gtkada from the ones that scala needs: is that ok, or do I need something else to let the program work?

Last edited by rdm (2014-04-24 17:47:23)

Offline

#4 2014-04-24 19:05:45

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

I've just tested it and after adding symbolic links to the scala directory and pointing LD_LIBRARY_PATH to it, libraries are found without problems. However this doesn't fix much as the next problem arises: one of the libraries is missing required symbols (probably because of being a different version). This means that even if you succeed in the step with libraries, the next one will fail.

Maybe just ask the author to recompile the binary for the current Arch release?


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#5 2014-04-24 20:00:00

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Maybe just ask the author to recompile the binary for the current Arch release?

I don't know; perhaps that would be a good idea, but anyway it would take a considerable amount of time for getting some results... hmm

And if I were to try the Windows executable in Wine, what do you think? Perhaps give me some hints so that I don't spend another whole day cursing at non-free software big_smile

Offline

#6 2014-04-24 21:14:53

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

I installed the Windows version in Wine, and it works, but there are two main problems: I can't write commands that start with @ since Alt Gr doesn't work; and, most importantly, there's no sound. I have Timidity installed that normally works, but the Scala Setup made me install a program called MegaMID, a MIDI Windows player: in Scala I hear no sound, and neither when I give MegaMID itself a MIDI file there's no sound (even if I can see that the file is being played)... And now? sad

Last edited by rdm (2014-04-24 21:15:28)

Offline

#7 2014-04-25 22:47:12

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

I don't think getting results from the author, who possess the sources, is the longer way than trying to fix compiled binary. After all they can just rebuild it with the current ArchLinux or at least some other distribution (but with the current library versions).

Since Wine still has no 64bit version, I can't help you with it sad. I think you have to wait for someone with experience in that matter.

But why would "@" require AltGr? It's Shift+2 (/me looks at his keyboard to confirm).

Last edited by mpan (2014-04-25 22:48:07)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#8 2014-04-26 09:22:02

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Yes, you're right, I'll contact the author to face these issues... Even if the project looks like a little bit old

But why would "@" require AltGr? It's Shift+2 (/me looks at his keyboard to confirm).

I have the Italian keyboard layout (I live in Italy tongue) so, as for my keyboard, AltGr + ò yields @, while Shift + 2 just gives me "

Last edited by rdm (2014-04-26 09:25:23)

Offline

#9 2014-04-26 16:50:38

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

I sent my email to the author in the name of the whole Arch community smile Let's hope good big_smile

Offline

#10 2014-04-27 19:53:52

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Yeah! He answered! big_smile
As far as I've been able to understand he answered that Scala is freeware, but not closed-source, as he kindly linked me the location to the source code. yikes Doesn't that sound ... weird?! hmm

But anyway, I downloaded the source zip file, and attempted to compile the program, and unfortunately there are one problem and one doubt:

The problem is that it doesn't compile since:

$ ./comp2

splitting midi_io_oss_.adaa into:
   midi_io.ads
splitting midi_io_oss.adaa into:
   midi_io.adb
splitting os_command_ugnat.adaa into:
   os_command.adb
splitting midi_file_play_dummy.adaa into:
   midi_file_play.adb
gcc -c -O2 -gnato -gnatn -gnat05 -gnatwu -gnatwF -I/usr/include/gtkada scala.adb
scala.adb:7:06: file "gtk-combo_box_entry.ads" not found
scala.adb:7:06: "Scala (body)" depends on "Main_Window_Pkg (spec)"
scala.adb:7:06: "Main_Window_Pkg (spec)" depends on "Gtk.Combo_Box_Entry (spec)"
scala.adb:9:06: file "gtk-tooltips.ads" not found
scala.adb:9:06: "Scala (body)" depends on "Scala_Tooltips (spec)"
scala.adb:9:06: "Scala_Tooltips (spec)" depends on "Gtk.Tooltips (spec)"
gnatmake: "scala.adb" compilation error

In other words, although I have the gtk-ada packet installed from AUR, still some files (namely gtk-combo_box_entry.ads and gtk-tooltips.ads) are missing from /usr/include/gtkada... where do I have to take them from?

Now instead the doubt is: since there are two almost identical "comp" files in the source dir (comp2 and comp3), which is to choose, giving that Manuel (the Scala author) told me to "just type ./comp"? hmm In fact these scripts differ only on an option that I don't understand of the program gnatmake:

$ diff comp2 comp3

5c5
< gnatmake -m -O2 -gnato -gnatn -gnat05 -gnatwu -gnatwF scala `gtkada-config`
\ No newline at end of file
---
> gnatmake -m -O3 -gnato -gnatn -gnat05 -gnatwu -gnatwF scala `gtkada-config`
\ No newline at end of file

Hence, we are at a better point than before, nevertheless always stuck sad

Last edited by rdm (2014-04-28 08:50:35)

Offline

#11 2014-04-28 04:14:01

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

So it seems contacting author is indeed the longer way big_smile. And it seems indeed that Wine is the simplest option if only someone can help you with keyboard layout issue.

Starting from the end: the -O option changes optimization level, nothing more. So it seems comp2 and comp3 differ only by enabling different optimizations.

The "gtk-combo_box_entry.ads" error arises from the fact that the source uses non-existent file. That statement sounds obvious, but the true meaning is that Scala needs to be fixed upstream by the author. GtkAda developers have removed that module 9 months ago¹. Optionally the author should contact GtkAda devs and report a bug, if the ommision of the fille is one.

From my perspective you can do one of the two things:

  • Wait for the author or GtkAda devs to fix the issue.

  • Build older version of GtkAda directly from SVN sources of revision 212770, assuming it's still possible, and use them with Scala. Note however that in general rolling library versions back just to let old software work is a bad habit and will cause problems if you use other Ada software. If it's possible, try to avoid making this library global and possibly keep everything in a separate hierarchy just for Scala. This will require some work hmm

__
¹ rev. 212770rev. 212773. The reason of the removal is unknown, as commits miss descriptions; the area around rev. 272770 is strange, as they have dropped whole `GtkAda` directory for few 3 revisions and then re-placed it, but with a bit different content.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#12 2014-04-28 16:46:21

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Manuel says that Scala uses Gtk2, and probably will never migrate to Gtk3. Therefore he gave me the link to the gtkada-2.24 tarball that I downloaded, tried to compile and...guess what? It doesn't work! big_smile If you want to know why, just look at the last lines of the output for "make"

/usr/bin/ld: /home/riccardo/Downloads/gtkada-2.24.2-src/testgtk//lw.o: undefined reference to symbol 'sqrt@@GLIBC_2.0'
/usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc
gnatmake: *** link failed.
Makefile:38: recipe for target 'testgtk' failed
make[1]: *** [testgtk] Error 4
make[1]: Leaving directory '/home/riccardo/Downloads/gtkada-2.24.2-src/testgtk'
Makefile:21: recipe for target 'tests' failed
make: *** [tests] Error 2

Why shouldn't make find something like "sqrt" in libm.so? Is there any sort of linkage error? I tried to do:

$ LIBS=-lm make --prefix=/usr

but that doesn't solve the problem. Otherwise, how can I link libm.so to the program like I would just put -lm at the end of a gcc command? hmm

Last edited by rdm (2014-04-28 16:50:47)

Offline

#13 2014-04-29 06:27:16

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

Add --with-GL=no to configure options and don't run make in parallel. Worked well with rev212770.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#14 2014-04-29 12:49:54

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Thank you, mpan, it worked! Even if I don't know what OpenGL has to do with libm...

But another problem arised, this time in the process of compilation of Scala, and more precisely on file scale_callbacks.adb:

cannot generate code for file scale_callbacks.adb (missing subunits)
scale_callbacks.adb:4391:04: warning: subunit "Scale_Callbacks.Do_Unique_Mapping" in file "scale_callbacks-do_unique_mapping.adb" not found
gnatmake: "scale_callbacks.adb" compilation error

Since I don't know Ada, the only thing I could try to fix this issue was to put the "-x" flag,  in the gnatmake command inside the comp3 script, whose content follows:

gnatprep -cu relay_dialog_pkg-callbacks.adp relay_dialog_pkg-callbacks.adb
gnatchop -w midi_io_oss*.adaa
gnatchop -w os_command_ugnat.adaa
gnatchop -w midi_file_play_dummy.adaa
gnatmake -m -O3 -x -gnato -gnatn -gnat05 -gnatwu -gnatwF scala `gtkada-config`

But still the file doesn't compile. Should have I put the "-x" in a different order, or is there another more efficient solution to work this out?

Offline

#15 2014-04-30 13:20:03

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Trouble installing Scala

OpenGL itself has not much to do with it. The problem was caused by a linking stage in a related to OpenGL piece of the test application. Disabling OpenGL in GtkAda or removing whole test target circumevents the issue.

As for scale_callbacks.adb problem: unfortunely I'm not Ada coder too, so the error looks completly unfamiliar to me. Since I don't even see the source files, I can't help much hmm. But it seems that the problem is in the Scala source code itself, considering its name (it doesn't match anything in GtkAda, and Google can't find information about it).


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#16 2014-04-30 14:53:41

rdm
Member
From: Italy
Registered: 2012-05-31
Posts: 48

Re: Trouble installing Scala

Yes, in fact I discovered that the procedure Do_Unique_Mapping declared in scale_callbaks.adb is missing its definition in another source file; I tried in lots of ways to solve the problem, but at this point I wonder: is it possible that the author forgive to implement this subunit? yikes Hence the only think I could do was to contact him again

Last edited by rdm (2014-04-30 14:56:12)

Offline

#17 2014-07-31 14:42:06

apicici
Member
Registered: 2013-09-17
Posts: 4

Re: Trouble installing Scala

If you're still interested I found a way to make scala work without the need to compile it.
The libgtkada library is included with scala, you just have to rename it from

libgtkada-2.24.so.2

to

libgtkada.so.2.24.1

you can find the right versions of libgnat and libgnarl in this package from ubuntu.

Just put the required libraries in a folder and add it to LD_LIBRARY_PATH before running scala and everything should be fine.

EDIT: you also need to install lib32-gtk2 from multilib, if you are on 64bit.

Last edited by apicici (2014-07-31 14:46:30)

Offline

Board footer

Powered by FluxBB