I searched many times but didn't get the problem solved. I called an external R script from matlab using system()/unix() and find the shared library is mis-loaded. I know the environment is wrong in matlab. I also tried wrapped the command in xterm or gnome-terminal but didn't make it. How can I load the correct env variables? Is there a way to reset back to the OS's env variables before the call?
>> !export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
% also tried - !export LD_LIBRARY_PATH=/usr/lib64;
>> unix('Rscript /home/gary/testRF1.R')
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3gf)
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3gf)
Error: package or namespace load failed for ‘R.matlab’
Execution halted
ans =
1
Distribution: Ubuntu 12.04.3
R info:
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 0.2
year 2013
month 09
day 25
svn rev 63987
language R
version.string R version 3.0.2 (2013-09-25)
nickname Frisbee Sailing
many thanks,
Gary
One solution is to change the libgfortran that you want to use.
Open a terminal and cd to "local_MATLAB"/sys/os/"your_os"/
Check that libgfortran.so.3 is a symbolic link pointing to ligfortran.so.3.0.0 and remove it
otherwise copy libgfortran.so.3 for backup in case anything goes wrong
locate your own libgfortran and make the symbolic link point to it
On my system this would look like :
cd /usr/local/MATLAB/R2012a/sys/os/glnxa64/
rm libgfortran.so.3
ln -s -T /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 libgfortran.so.3
If you're on UNIX, libgfortran should already be installed, you can find it with:
locate libgfortran
Remember to restart MATLAB so the changes apply
I assume that you can run Rscript from your terminal successfully. If that is the case, then
the solution your problem is that you want to use setenv inside matlab instead of !export. You probably want to look at this question: Start application from Matlab
Related
I use CentOS 7 and would like to use some Anaconda python package that requires GLIBC_2.18 while the host OS only provides 2.17. I tried compiling a newer version of glibc myself following these instructions. When I try to run any executable with this newer glibc I am getting an error:
$ ./testrun.sh ls
ls: error while loading shared libraries: ls: cannot open shared object file: No such file or director
Is there a workaround for this issue?
Update 1:
As per suggestion in this answer I needed to specify the full path to the executable, which now gives a different error message:
$ cd glibc-2.20/build # build directory
$ ./testrun.sh /bin/ls
/bin/ls: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
Update 2:
Adding paths to the system libraries in testrun.sh solved the problem. I can not only run ls but also the aforementioned python package. Thank you!
Try ./testrun.sh /bin/ls.
That said, you will really be better off building the Python package for your system, instead of trying to make non-system GLIBC, as Danila Vershinin suggested.
Update:
libselinux.so.1: ...: No such file or directory
The testrun.sh for the new GLIBC does not look in system directories (e.g. /usr/lib64). You need to append system directories to the --library-path it uses. E.g. change
--library-path "${builddir}":"${builddir}"/math:"${builddir}"/elf:"${builddir}"/dlfcn:"${builddir}"/nss:"${builddir}"/nis:"${builddir}"/rt:"${builddir}"/resolv:"${builddir}"/mathvec:"${builddir}"/support:"${builddir}"/crypt:"${builddir}"/nptl
to:
--library-path "${builddir}":"${builddir}"/math:"${builddir}"/elf:"${builddir}"/dlfcn:"${builddir}"/nss:"${builddir}"/nis:"${builddir}"/rt:"${builddir}"/resolv:"${builddir}"/mathvec:"${builddir}"/support:"${builddir}"/crypt:"${builddir}"/nptl:/usr/lib64:/lib64
(or something like that).
I have been trying to cross-compile using toolchain from yocto-jethro BSP with the following error:
x86_64-poky-linux-gcc: error trying to exec 'cc1': execvp: No such file or directory
I can see that the search directories have been truncated.
x86_64-poky-linux-gcc --print-search-dirs returns:
# /mnt/data/Projects/tmr2-sdk/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc --print-search-dirs
install: oots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/5.2.0/
programs: =oots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/:oots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/bin/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/bin/
libraries: =oots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib/../lib/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib/x86_64-poky-linux/5.2.0/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib/../lib/:/not/exist/lib/../lib/x86_64-poky-linux/5.2.0/:/not/exist/lib/x86_64-poky-linux/5.2.0/:/not/exist/lib/../lib/:/not/exist/usr/lib/../lib/x86_64-poky-linux/5.2.0/:/not/exist/usr/lib/x86_64-poky-linux/5.2.0/:/not/exist/usr/lib/../lib/:oots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib/:/not/exist/lib/:/not/exist/usr/lib/
Directories should start with:
/mnt/data/Projects/tmr2-sdk/sdk/sysroots/
instead they start with:
oots
I get the same result when I source the environment-setup-target from yocto BSP or execute compiler directly.
Cross-compilation was working on ubuntu 18. Similar BSP created in yocto-sumo works on ubuntu 20.04
When I add --sysroots to GCC it effects only the libraries search dirs.
Does anyone have a clue on how can I resolve the issue or where to look to find the problem?
Where does the gcc take the search-dirs? I can see that sourcing environment-setup-target does not effect the compiler search-dirs.
Thanks for any hints
Fixed in later issues by commit:
https://git.yoctoproject.org/cgit.cgi/poky/commit/scripts/relocate_sdk.py?id=c3c793b4286367b7050c8ec92fb90a1a9f85a89a
Running gcc with -Wl,--verbose prints things like
attempt to open /foo/gcc-6.3.0/lib64/../lib64/libm.so failed
attempt to open /foo/gcc-6.3.0/lib64/../lib64/libm.a failed
attempt to open /foo/gcc-6.3.0/lib/x86_64-redhat-linux/6.3.0/libm.so failed
attempt to open /foo/gcc-6.3.0/lib/x86_64-redhat-linux/6.3.0/libm.a failed
attempt to open /foo/gcc-6.3.0/lib/../lib64/libm.so failed
attempt to open /foo/gcc-6.3.0/lib/../lib64/libm.a failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/libm.so failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/libm.a failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/../../../x86_64-redhat-linux/6.3.0/libm.so failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/../../../x86_64-redhat-linux/6.3.0/libm.a failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../lib64/libm.so failed
attempt to open /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../lib64/libm.a failed
attempt to open /lib/../lib64/libm.so failed
attempt to open /lib/../lib64/libm.a failed
attempt to open /usr/lib/../lib64/libm.so succeeded
Is there a reason why these paths need to have a bunch of ../ in them? For example, why is /foo/gcc-6.3.0/lib64/../lib64/libm.so not simply /foo/gcc-6.3.0/lib64/libm.so? Also, some of the longer paths expand to the same thing, e.g. /foo/gcc-6.3.0/lib/gcc/x86_64-redhat-linux/6.3.0/../../../../lib64/libm.so and /foo/gcc-6.3.0/lib/../lib64/libm.so.
Also, there's a marked lack of /foo/gcc-6.3.0/lib, while most libraries are installed in lib rather than lib64.
I found two similar questions asked here:
Why does g++ look in LIBRARY_PATH/../lib64 and where is this documented?
g++ searches /lib/../lib/, then /lib/
The comment here sheds light on what determines how these paths are formed.
These, however, don't answer why so many of these paths are used, even though they resolve to the same directory.
The libraries in the /foo/gcc-* is provided by gcc-* packages which is a symlink to the actual libraries provided in /lib64/ or /lib.
These symlinks provides targeted support for gcc.
The actual libraries contain the shared libraries.
Take gcc-objc as an example and the library libobjc that it points to.
$ rpm -ql gcc-objc
<snip>
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/objc/thr.h
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/objc/typedstream.h
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libobjc.a
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libobjc.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.7
<snip>
$ ls -l /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libobjc.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libobjc.so -> ../../../../lib64/libobjc.so.2
$ rpm -ql libobjc
/usr/lib64/libobjc.so.2
/usr/lib64/libobjc.so.2.0.0
Now let's look at the description of these packages.
$ rpm -qi gcc-objc
gcc-objc provides Objective-C support for the GCC.
Mainly used on systems running NeXTSTEP, Objective-C is an
object-oriented derivative of the C language.
$ rpm -qi libobjc
This package contains Objective-C shared library which is needed to run
Objective-C dynamically linked programs.
I had the inspiration to start messing around with Erlang and I am having problems installing it... I am using Linux Mint 16 (petra). I installed the dependencies, and then downloaded otp_src_17.1.tar.gz and ran 'tar -zxf otp_src_17.1.tar.gz' I then ran ./configure which gave me some errors that made it impossible to run make.
These are the errors I'm getting (actually what I did was I did ./configure > configure.txt to get all the lines it prints as it configures, and it conveniently still printed to the console everything that has errors - neat)
configure: WARNING: No odbc library found skipping odbc
configure: WARNING: "ODBC library - header check failed"
configure: WARNING: "ODBC library - link check failed"
rm: remove write-protected regular file './CONF_INFO'?
configure: WARNING: No GLU headers found, wx will NOT be usable
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5195: wx-config: command not found
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5893: ./CONF_INFO: Permission denied
configure: WARNING:
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is 2.8.4 or above.
rm: remove write-protected regular file 'doc/CONF_INFO'?
/home/core/Desktop/otp_src_17.1/erts/configure: line 6466: doc/CONF_INFO: Permission denied
configure: WARNING: No 'xsltproc' command found: the documentation cannot be built
/home/core/Desktop/otp_src_17.1/erts/configure: line 6513: doc/CONF_INFO: Permission denied
configure: WARNING: No 'fop' command found: going to generate placeholder PDF files
configure: error: No curses library functions found
configure: error: /bin/bash '/home/core/Desktop/otp_src_17.1/erts/configure' failed for erts
The thing is - I know that I have the ncurses library, as evidenced by the fact that when I do "sudo apt-get install ncurses-base ncurses-bin" it says:
Reading package lists... Done
Building dependency tree
Reading state information... Done
ncurses-base is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
When I run "locate ncurses" it gives me the following:
/lib/i386-linux-gnu/libncurses.so.5
/lib/i386-linux-gnu/libncurses.so.5.9
/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
/usr/bin/ncurses5-config
/usr/bin/ncursesw5-config
/usr/lib/vlc/plugins/gui/libncurses_plugin.so
/usr/share/doc/libncurses5
/usr/share/doc/libncursesw5
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses-bin
/usr/share/doc/ncurses-base/changelog.Debian.gz
/usr/share/doc/ncurses-base/copyright
/usr/share/doc/ncurses-bin/FAQ
/usr/share/doc/ncurses-bin/changelog.Debian.gz
/usr/share/doc/ncurses-bin/copyright
/usr/share/lintian/overrides/ncurses-base
/usr/share/man/man1/ncurses5-config.1.gz
/usr/share/man/man1/ncursesw5-config.1.gz
/var/cache/apt/archives/libncurses5_5.9+20130608-1ubuntu1_i386.deb
/var/lib/dpkg/info/libncurses5:amd64.list
/var/lib/dpkg/info/libncurses5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:amd64.postinst
/var/lib/dpkg/info/libncurses5:amd64.postrm
/var/lib/dpkg/info/libncurses5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:amd64.symbols
/var/lib/dpkg/info/libncurses5:i386.list
/var/lib/dpkg/info/libncurses5:i386.md5sums
/var/lib/dpkg/info/libncurses5:i386.postinst
/var/lib/dpkg/info/libncurses5:i386.postrm
/var/lib/dpkg/info/libncurses5:i386.shlibs
/var/lib/dpkg/info/libncurses5:i386.symbols
/var/lib/dpkg/info/libncursesw5:amd64.list
/var/lib/dpkg/info/libncursesw5:amd64.md5sums
/var/lib/dpkg/info/libncursesw5:amd64.postinst
/var/lib/dpkg/info/libncursesw5:amd64.postrm
/var/lib/dpkg/info/libncursesw5:amd64.shlibs
/var/lib/dpkg/info/libncursesw5:amd64.symbols
/var/lib/dpkg/info/ncurses-base.conffiles
/var/lib/dpkg/info/ncurses-base.list
/var/lib/dpkg/info/ncurses-base.md5sums
/var/lib/dpkg/info/ncurses-bin.list
/var/lib/dpkg/info/ncurses-bin.md5sums
I am at a loss as to where to proceed. Thanks for any help
I believe you need to install ncurses-dev
'sudo yum install ncurses-devel.x86_64' prior to running ./configure worked just fine for me. Fedora 21 x64, btw.
After I extracted the tar, the documentation was in '/opt_src_{version}/HOWTO/INSTALL.md. The contents of which states:
Required Utilities
These are the tools you need in order to unpack and build Erlang/OTP.
WARNING: Please have a look at the [Known platform issues][] chapter
before you start.
Unpacking
GNU unzip, or a modern uncompress.
A TAR program that understands the GNU TAR format for long filenames.
Building
GNU make
Compiler -- GNU C Compiler, gcc or the C compiler frontend for LLVM, clang.
Perl 5
GNU m4 -- If HiPE (native code) support is enabled. HiPE can be
disabled using --disable-hipe
ncurses, termcap, or termlib -- The development headers and
libraries are needed, often known as ncurses-devel. Use
--without-termcap to build without any of these libraries. Note that
in this case only the old shell (without any line editing) can be used.
sed -- Stream Editor for basic text transformation.
ncurses just happened to be the only required package I didn't have installed on this development VM. So your mileage may vary.
This was the output of 'locate ncurses' after I installed the ncurses lib:
/usr/lib64/libncurses++.so.5
/usr/lib64/libncurses++.so.5.9
/usr/lib64/libncurses++w.so.5
/usr/lib64/libncurses++w.so.5.9
/usr/lib64/libncurses.so.5
/usr/lib64/libncurses.so.5.9
/usr/lib64/libncursesw.so.5
/usr/lib64/libncursesw.so.5.9
/usr/share/doc/ncurses
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses/ANNOUNCE
/usr/share/doc/ncurses/AUTHORS
/usr/share/doc/ncurses/NEWS.bz2
/usr/share/doc/ncurses/README
/usr/share/doc/ncurses/TO-DO
/usr/share/doc/ncurses-base/README
/usr/share/licenses/ncurses-base
/usr/share/licenses/ncurses-base/COPYING
So I'd say the OP had a corrupt / bad ncurses install. I'm just posting this here because this was the #1 Google result I got when I was too lazy to RTFD.
One alternative is using the option "--without-termcap"
otp_src_18.0/configure file says:
--without-termcap do not use any termcap libraries
(ncurses,curses,termcap,termlib)
./configure --prefix=/home/username/erlang/18.0 --without-termcap
Set your PATH variable as shown below.
export PATH=$PATH=/home/username/erlang/18.0/bin
Not sure about implications though. :)
Hope this helps someone.
I am trying to cross-compile climm-0.6.4 to windows under Ubuntu with the following command:
./configure --host=i686-pc-mingw32 --enable-ssl=gnutls
and I get this error message:
**checking for libgnutls-config... no
checking for libgnutls - version >= 0.8.8... no
*** The libgnutls-config script installed by LIBGNUTLS could not be found
*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the LIBGNUTLS_CONFIG environment variable to the
*** full path to libgnutls-config.**
After some research on the Internet I found a hint here:
The package's ./configure script is trying to invoke libgnutls-config
and/or libgnutls-extra-config to search for the gnutls library. Newer
versions of gnutls do not ship these scripts anymore.
and I am using gnutls-2.12.5
Does anybody have a patch or a kludge trick so that I am able to cross-compile climm-0.6.4 with gnutls-2.12.5?
Thank you in advance!
cheers
Daniel
Try the --with-libgnutls-prefix=PFX option to the configure script telling where the library is.
Other option in to set the environment variable LIBGNUTLS_CONFIG to a program that outputs just the parameters you need to compile/link the library.
Update:
Try the following script, name it mygnutls_config:
#!/bin/bash
if [ "$1" == "--version" ]
then
shift
EXTRA="--modversion"
else
EXTRA=""
fi
pkg-config gnutls $EXTRA "$#"
And then
$ chmod a+x mygnutls_config
$ LIBGNUTLS_CONFIG=`pwd`'/mignutls_config' ./configure --enable-ssl=gnutls
note that for this to work you need pkg-config to detect the crosscompilation configuration, not the native one. So you may need the PKG_CONFIG_LIBDIR environment variable to point to the directory where the appropriate gnutls.pc file is.