You are not logged in.

#1 2015-09-18 08:33:53

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

updating ncurses break MATLAB

I've just updated my system and now MATLAB no longer start and says:

[fabio@macbook bin]$ ./matlab
/home/fabio/Matlab/bin/glnx86/MATLAB: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

is there a way to make MATLAB use the new version of ncurses or I'm forced to downgrade that package?

Last edited by fabioamd87 (2015-09-18 09:24:24)

Offline

#2 2015-09-18 08:42:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: updating ncurses break MATLAB

Did you rebuild it against the new lib? It's your job to manage unofficial packages.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-09-18 09:13:10

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

ok I think I've made a disaster.

I've downgrade ncurses to the 5 version and now the systemd doesn't boot. even worse I can't chroot to it because sh ask for the 6 version of ncurses

Offline

#4 2015-09-18 09:22:56

Fastuous
Member
Registered: 2012-04-09
Posts: 7

Re: updating ncurses break MATLAB

You're not alone! I did the same thing. The solution in this reddit comment fixed it for me.

https://www.reddit.com/r/archlinux/comm … te/cv5f9q8

Also I re-installed Matlab (2015a and 2015b) and it still won't run with the new ncurses.

Offline

#5 2015-09-18 09:25:35

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

wow I did the same command but finding the solution in pacman manual, I feel a little proud of myself... too sad about MATLAB, I need it... sad

I have to use 32bit arch (macbook1,1) so the maximum version of matlab is the 2010b version (or something like that)

Last edited by fabioamd87 (2015-09-18 09:26:46)

Offline

#6 2015-09-18 09:54:16

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: updating ncurses break MATLAB

Is matlab distributed as a prebuild binary? If yes and if the latest matlab depends on libncurses.so.5 then the only way to solve the issue is to build and install ncurses version 5 by yourself. It should be easy to add ncurses-5 package to AUR.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#7 2015-09-18 10:01:22

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

is there a way to create a script to force MATLAB to use the ncurses library that it need from a custom directory (LD_LIBRARY_PATH)?

Last edited by fabioamd87 (2015-09-18 10:02:24)

Offline

#8 2015-09-18 10:13:07

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: updating ncurses break MATLAB

fabioamd87 wrote:

is there a way to create a script to force MATLAB to use the ncurses library that it need from a custom directory (LD_LIBRARY_PATH)?

Why do you want to do it?


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#9 2015-09-18 10:18:45

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

I don't want to touch my system but find a smart solution to make MATLAB find what it needs

Offline

#10 2015-09-18 10:28:26

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: updating ncurses break MATLAB

The solution for your problem is to create ncurses-5 package. Unfortunately I am out of my workstation right now and cannot create the AUR package. But it should be easy enough to do. Could anyone create such package please?


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#11 2015-09-18 10:38:04

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

but it this way the rest of the system will use the 5 or the 6 version? the two version will coexist?

I temporarily solved by downloading the 5 version, extracted to my home, and creating this script (in my home too):

#!/bin/bash

LD_LIBRARY_PATH=ncurses-5.9-7/usr/lib/ ./Matlab/bin/matlab

if things goes well, I no longer need MATLAB after my exam in November.

So we can say that from now MATLAB no longer works on archlinux out of the box, (2010 and 2015)

Last edited by fabioamd87 (2015-09-18 10:38:26)

Offline

#12 2015-09-18 10:47:25

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: updating ncurses break MATLAB

The rest of the system (from official repos) will be using version 6, more precisely libncurses.so.6 shared library. But Matlab you use was compiled and depends on libncurses.so.5. And because you have no sources you cannot recompile it against newer ncurses.

AUR package can install libncurses.so.5 without conflicting with ncurses from official package. It is a standard way to solve this kind of problems. For example we have 3 versions of "vte" package in official repos each provides its own versions of shared libraries.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#13 2015-09-18 11:45:05

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: updating ncurses break MATLAB

fabioamd87 wrote:

So we can say that from now MATLAB no longer works on archlinux out of the box, (2010 and 2015)

This depends on the definition of OOTB. Consider all those AUR packages depending on other AUR packages. None of them runs OOTB. If you look at the extensive PKGBUILD for Matlab on the AUR, you will not find this quite the OOTB experience either. I'd agree, if you said, that running Matlab on Archlinux now sucks even more than before.

EDIT: I dropped a link to this discussion on the matlab in the AUR.

EDIT2: Is it time to read more about readelf, ldd, objdump and binary patching?

EDIT3: glnx86 indicates a 32 bit version, if I'm not mistaken. Take that into account as well.

EDIT4: Also see https://help.ubuntu.com/community/MATLAB, there are several instances, when a library version is mentioned in a shell script and not as an elf dependency. Search all files for the old soname.

Last edited by Awebb (2015-09-18 12:00:56)

Offline

#14 2015-09-18 12:18:09

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

Awebb wrote:

This depends on the definition of OOTB. Consider all those AUR packages depending on other AUR packages. None of them runs OOTB. If you look at the extensive PKGBUILD for Matlab on the AUR, you will not find this quite the OOTB experience either.

Infact If I'm not wrong I used that package to install all the dependecies.

Awebb wrote:

I'd agree, if you said, that running Matlab on Archlinux now sucks even more than before.

I mean that.

Awebb wrote:

EDIT2: Is it time to read more about readelf, ldd, objdump and binary patching?

Right now the exam have the priority, I just need a way to make MATLAB works. Maybe after the exam, but then I will no longer need MATLAB. smile

Offline

#15 2015-09-18 12:41:59

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: updating ncurses break MATLAB

As a quick fix, try hardlinking or copying the .so.6 to .so.5 and pray, that the API hasn't changed, where Matlab needs it.

Offline

#16 2015-09-18 13:12:18

fabioamd87
Member
Registered: 2008-11-22
Posts: 128

Re: updating ncurses break MATLAB

is better than my solution?

Offline

#17 2015-09-18 13:14:17

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: updating ncurses break MATLAB

No, your solution is fine, too.

Offline

#18 2015-09-18 14:56:58

jacopo123
Member
Registered: 2015-09-18
Posts: 6

Re: updating ncurses break MATLAB

Copying the old libncurses.so.5* into /usr/lib also seems to work.

Perhaps somebody is willing to create an ncurses5 package in AUR? I don't have time to finish it now.

I almost made it by copying the relevant PKGBUILD for ncurses-5.9-7 from (git://projects.archlinux.org/svntogit/packages.git), and applying this patch (https://sources.gentoo.org/cgi-bin/view … iew=markup) to compile it. The outcome package does not install, as it tries to overwrite some ncurses 6.0-3 files.

Offline

#19 2015-09-18 15:36:56

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: updating ncurses break MATLAB

Yes, it seems that matlab is happy with just having the old libncurses.so.5 file.
I extracted the file from the old package and tested it. It seems to work fine now.


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#20 2015-09-18 16:07:39

jokeyser
Member
Registered: 2015-09-18
Posts: 1

Re: updating ncurses break MATLAB

Awebb's suggestion did the trick in my case. Even softlinking is sufficient. All that was needed was:

cd /usr/lib
ln -s libncursesw.so.6 libncurses.so

I didn't check everything, but it at least starts up normally again.

Offline

#21 2015-09-18 18:20:45

dennisog
Member
Registered: 2015-06-15
Posts: 5
Website

Re: updating ncurses break MATLAB

I made a PKGBUILD that only installs the shared library files for libncurses5. This is my first PKGBUILD, it's not very good, and I made it in a hurry because I need MATLAB (I believe ncurses6 also breaks tmux-git)

I just remove a bunch of things I don't need, I do not think that programs can link to this library using -lncurses5 or anything. But it puts libncurses.so.5 where it needs to be in order for MATLAB to run.

in order for the PGP verification to succeed, you need to import Thomas Dickey's PGP key:

gpg --keyserver pgp.mit.edu --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB 
# $Id$
# Maintainer:  Dennis Ogbe <dogbe@purdue.edu>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=libncurses5
pkgname_c=ncurses
pkgver=5.9
pkgrel=7
pkgdesc='System V Release 4.0 curses emulation library -- Shared Libraries only'
arch=('i686' 'x86_64')
url='http://invisible-island.net/ncurses/ncurses.html'
license=('MIT')
depends=('glibc' 'gcc-libs' 'sh')
provides=('libmenu.so.5' 'libpanel.so.5' 'libform.so.5' 'libncurses.so.5' 'libncurses++w.so.5'
          'libformw.so.5' 'libmenuw.so.5' 'libpanelw.so.5' 'libncursesw.so.5')
source=(ftp://invisible-island.net/ncurses/ncurses-${pkgver/_/-}.tar.gz{,.asc}
       https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-libs/ncurses/files/ncurses-5.9-gcc-5.patch)
md5sums=('8cb9c412e5f2d96bc6f459aa8c6282a1'
         'SKIP'
         '57f4cd0cc0c0a42a5ddb2167f9546d72')

validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB')  # Thomas Dickey

prepare() {
  mkdir ncurses{,w}-build
  cd "${srcdir}"/$pkgname_c-${pkgver/_/-}
  patch -Np1 -i ../ncurses-5.9-gcc-5.patch
}

build() {
  cd ncursesw-build
  ../$pkgname_c-${pkgver/_/-}/configure --prefix=/usr --mandir=/usr/share/man \
     --with-shared --with-normal --without-debug --without-ada \
     --enable-widec --enable-pc-files --with-cxx-binding --with-cxx-shared
  # add --enable-ext-colors and --enable-ext-mouse with next soname bump
  make

  # libraries for external binary support
  cd ${srcdir}/ncurses-build
  [[ $CARCH = "x86_64" ]] && CONFIGFLAG="--with-chtype=long"
  ../$pkgname_c-${pkgver/_/-}/configure --prefix=/usr \
    --with-shared --with-normal --without-debug --without-ada $CONFIGFLAG \
    --with-cxx-binding --with-cxx-shared
  make
}

package() {
  cd ncursesw-build
  make DESTDIR="$pkgdir" install

  # install shared libraries
  cd "$srcdir"/ncurses-build
  for lib in ncurses form panel menu; do
    install -Dm755 lib/lib${lib}.so.${pkgver%_*} "$pkgdir"/usr/lib/lib${lib}.so.5
    rm -rf "$pkgdir"/usr/lib/lib${lib}w.so
    rm -rf "$pkgdir"/usr/lib/lib${lib}w.a
  done

  # install license, rip it from the readme
  cd "$srcdir"/$pkgname_c-${pkgver/_/-}
  install -dm755 "$pkgdir"/usr/share/licenses/$pkgname
  grep -B 100 '$Id' README > "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

  # we only want the shared libraries, everything else can go
  for folder in emacs man tabset; do
    rm -rf "$pkgdir"/usr/share/${folder}
  done
  rm -rf "$pkgdir"/usr/bin
  rm -rf "$pkgdir"/usr/include
  rm -rf "$pkgdir"/usr/lib/pkgconfig

  # remove static library files
  for lib in ncurses{,++} form panel menu; do
    rm -rf "$pkgdir"/usr/lib/lib${lib}w.a
  done
}

I'd appreciate some feedback on how to make this a "proper" PKGBUILD. Thanks to jacopo123 for pointing me to the GCC5 patch.

Offline

#22 2015-09-18 20:42:12

Minbari
Member
From: 127.0.0.1
Registered: 2015-03-08
Posts: 30

Re: updating ncurses break MATLAB

Package build works fine but when I try to install it give the following error:

 error: failed to commit transaction (conflicting files)
libncurses5: /usr/lib/terminfo exists in filesystem
libncurses5: /usr/share/terminfo/1/1178 exists in filesystem
libncurses5: /usr/share/terminfo/1/1730-lm exists in filesystem
...........................................................................................
libncurses5: /usr/share/terminfo/z/ztx-1-a exists in filesystem
libncurses5: /usr/share/terminfo/z/ztx11 exists in filesystem
Errors occurred, no packages were upgraded.
 

UNIX is user-friendly. It's just very selective about who is friends are.

Offline

#23 2015-09-18 21:50:35

Minbari
Member
From: 127.0.0.1
Registered: 2015-03-08
Posts: 30

Re: updating ncurses break MATLAB

Solved using ncurses5-compat-libs from AUR .


UNIX is user-friendly. It's just very selective about who is friends are.

Offline

#24 2015-09-19 03:49:34

xgdgsc
Member
Registered: 2012-02-03
Posts: 125

Re: updating ncurses break MATLAB

Minbari wrote:

Solved using ncurses5-compat-libs from AUR .

I get :

error while loading shared libraries: /usr/lib/libncurses.so.5: file too short

after installing this.

changing the PKGBUILD to

# $Id: PKGBUILD 246362 2015-09-15 03:51:08Z foutrelis $
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=ncurses5-compat-libs
_pkgname=ncurses
pkgver=6.0
pkgrel=1
pkgdesc='System V Release 4.0 curses emulation library, ABI 5'
arch=('i686' 'x86_64')
url='http://invisible-island.net/ncurses/ncurses.html'
license=('MIT')
depends=('glibc' 'gcc-libs' 'sh')
source=(ftp://invisible-island.net/ncurses/ncurses-${pkgver/_/-}.tar.gz{,.asc})
md5sums=('ee13d052e1ead260d7c28071f46eefb1'
         'SKIP')
validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB')  # Thomas Dickey

build() {
  cd $_pkgname-${pkgver/_/-}

  ./configure --prefix=/usr --mandir=/usr/share/man \
     --with-shared --with-normal --without-debug --without-ada \
     --enable-widec --enable-pc-files --with-cxx-binding --with-cxx-shared \
     --with-abi-version=5
  make
}

package() {
  cd $_pkgname-${pkgver/_/-}
  make DESTDIR="$pkgdir" install.libs
  rm -rf "$pkgdir"/usr/include/ "$pkgdir"/usr/lib/pkgconfig "$pkgdir"/usr/lib/*.so

  # fool packages looking to link to non-wide-character ncurses libraries
  for lib in ncurses ncurses++ form panel menu; do
    ln -s /usr/lib/lib${lib}w.so.5 "$pkgdir"/usr/lib/lib${lib}.so.5
  done

  # install license, rip it from the readme
  install -d "$pkgdir"/usr/share/licenses/$pkgname
  grep -B 100 '$Id' README > "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

would do.

Last edited by xgdgsc (2015-09-19 04:02:51)

Offline

#25 2015-09-19 20:01:22

Minbari
Member
From: 127.0.0.1
Registered: 2015-03-08
Posts: 30

Re: updating ncurses break MATLAB

You are right @xgdgsc, not all programs are working with that PKGBUILD, some are giving that error:

 error while loading shared libraries: /usr/lib/libncurses.so.5: file too short

.

Looks like that modify You suggested did the trick. Thank You!

xgdgsc wrote:

for lib in ncurses ncurses++ form panel menu; do
ln -s /usr/lib/lib${lib}w.so.5 "$pkgdir"/usr/lib/lib${lib}.so.5
done

would be better for users that would use the lib directly instead of linking.


UNIX is user-friendly. It's just very selective about who is friends are.

Offline

Board footer

Powered by FluxBB