How to fix: gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory - gnu-make

I was running make and encountered the following error:
gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory
config.status: error: could not create mjson.pc
Reaping losing child 0x564b30cbed70 PID 48255
make[1]: *** [Makefile:44: libmjson] Error 1
Removing child 0x564b30cbed70 PID 48255 from chain.
make[1]: Leaving directory '/home/minipc/econet/apps/public/libjson-1.5'
The libreadline.so.4 is too old to install in my current Linux machine (Ubuntu 20.04). So instead I installed libreadline.so.8, and created a symbolic link to libreadline.so.4. And I checked, it works:
lrwxrwxrwx 1 root root 25 Aug 12 21:17 /lib32/libreadline.so.4 -> /lib32/libreadline.so.8.0
lrwxrwxrwx 1 root root 18 Feb 25 2020 /lib32/libreadline.so.8 -> libreadline.so.8.0
-rw-r--r-- 1 root root 311884 Feb 25 2020 /lib32/libreadline.so.8.0
And the relevant part in Makefile is the following:
./configure --prefix=/home/minipc/econet/apps/public/libjson-1.5 --libdir=/lib32 --includedir=/lib32 --disable-static --enable-shared \
And I checked it in the console output when running the make.
So why it still can't find libreadline.so.4? Is it because libreadline.so.8.0 too new to be linked by libreadline.so.4 so the program doesn't recognize it?
Also, when I run
$ ldconfig -p|grep libreadline
libreadline.so.8 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.8
libreadline.so.8 (libc6) => /lib32/libreadline.so.8
libreadline.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.5
Only libreadline.so.5 and libreadline.so.4 appears. So the softlink would not be recognized by the system?

The libreadline.so.8 maybe too new to be used as the source of symbolic link of libreadline.so.4. Or it may need to be in another directory such as /lib to be linked by gawk.
I try $gawk return command not found . Then I run $sudo apt install gawk and check the gawk is of version GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0). I run $make again and found the same error.
Then I try $export $AWKPATH and find out that there is another path to store the gawk bin. Then I enter the directory and run $gawk, the same error pop out. I copy the /usr/bin/gawk ( the newly installed gawk) to update the gawk in the directory, and then run $gawk, it is the newest one.
Then I run $make again and the issue got solved.

Related

Installing from Archive of Formal Proofs

I'm trying to install Grothendieck_Schemes from
https://www.isa-afp.org/entries/Grothendieck_Schemes.html#
I downloaded the tar and uncompressed it. The contents are
$ ls -l
Comm_Ring.thy
Group_Extras.thy
ROOT
Scheme.thy
Set_Extras.thy
Topological_Space.thy
document/
root.bib
root.tex
Then I run
$ isabelle components -u ./Downloads/Grothendieck_Schemes/
Added component "/home/username/Downloads/Grothendieck_Schemes"
but when I start Isabelle I get error
C:\Users\Aleksander\.isabelle\Isabelle2022\jedit\jars\isabelle_jedit_main.jar:
Cannot start:
*** Bad imports session "Jacobson_Basic_Algebra" for "Grothendieck_Schemes" (line 3 of "/home/username/Downloads/Grothendieck_Schemes/ROOT")
So I suppose I should install the dependency "Jacobson_Basic_Algebra"? But there is no such package on AFP. I'm thinking that maybe I should have removed the ROOT file. It's contents are
chapter AFP
session "Grothendieck_Schemes" (AFP) = HOL +
options [timeout = 600]
sessions
"Jacobson_Basic_Algebra"
theories
Scheme
document_files
"root.tex"
"root.bib"
I tried running this instead but it fails
$ isabelle components -u ./Downloads/Grothendieck_Schemes/*.thy
*** Bad component directory: "/home/username/Downloads/Grothendieck_Schemes/Comm_Ring.thy"
How do I install these packages properly?

Compiling meshlab on Centos EL7

I'm have trouble compiling meshlab-2016.12 on Centos.EL7.
I got some of the way.
Updated QT to Qt-5.9.1 as latest on Centos is Qt version 5.6.1 - which I had previously installed
sudo yum install qt5-qtbase
sudo yum install qt5-qtx11extras
sudo yum install qt5-qtbase-devel
However at least Qt5.7 is needed for meshlab
Then set these env. variables
setenv QTDIR /usr/local/Qt-5.9.1
setenv QTINC /usr/local/Qt-5.9.1/include
setenv QTLIB /usr/local/Qt-5.9.1/lib
setenv PATH /usr/local/Qt-5.9.1/bin:$PATH
setenv PATH /usr/local/bin:/usr/local/Qt-5.9.1/bin:$PATH
Then followed instructions on a test machine, installing into /opt/TESTING
Installed vcglib into /opt/TESTING
downloaded meshlab-2016.12 into /opt/TESTING and unpacked it there
Ran the following
qmake -project
(This picks up the correct version of QT)
qmake src/external/external.pro
(To make the external libraries - including jhead-2.95
gmake
gmake install
(To make the external libraries - including jhead-2.95 )
qmake src/meshlab_mini.pro
(To build meshlab with a minimal set of plugins )
This is where it fails, as below;
../../vcglib/vcg/complex/algorithms/clean.h:1789:0:
warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
pragma omp parallel for schedule(dynamic, 10)
g++ -Wl,-O1 -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../distrib -Wl,-rpath,
/usr/local/Qt-5.9.1/lib -o ../distrib/meshlab main.o mainwindow_Init.o
mainwindow_RunTime.o glarea.o multiViewer_Container.o plugindialog.o
customDialog.o filterScriptDialog.o saveSnapshotDialog.o layerDialog.o
savemaskexporter.o changetexturename.o stdpardialog.o ml_std_par_dialog.o
xmlstdpardialog.o additionalgui.o xmlgeneratorgui.o ml_render_gui.o
ml_rendering_actions.o ml_default_decorators.o ml_selection_buffers.o
trackball.o trackmode.o coordinateframe.o glarea_setting.o filterthread.o
qrc_meshlab.o moc_interfaces.o moc_mainwindow.o moc_glarea.o
moc_multiViewer_Container.o moc_plugindialog.o moc_customDialog.o
moc_filterScriptDialog.o moc_saveSnapshotDialog.o moc_savemaskexporter.o
moc_changetexturename.o moc_layerDialog.o moc_stdpardialog.o
moc_ml_std_par_dialog.o moc_xmlstdpardialog.o moc_additionalgui.o
moc_xmlgeneratorgui.o moc_ml_render_gui.o moc_ml_rendering_actions.o
moc_filterthread.o -L../external/lib/linux-g++ -ljhead -L../distrib
-lcommon -lGLU -L/usr/local/Qt-5.9.1/lib -lQt5OpenGL -lQt5Widgets -lQt5Gui
-lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Script -lQt5Core -lGL -lpthread
/bin/ld: cannot find -ljhead
collect2: error: ld returned 1 exit status
gmake[1]: *** [../distrib/meshlab] Error 1
gmake[1]: Leaving directory `/opt/TESTING/meshlab-2016.12/meshlab'
gmake: *** [sub-meshlab-make_first-ordered] Error 2
So it's saying ld can't find ljhead. Other parts of the compile do seem to be finding it though eg
-I../src/external/glew-1.7.0/include -I../src/external/jhead-2.95
Looking at ld
/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
and
/
usr/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
Any advice would be useful at this point. Hopefully I've just missed something out
Updated:
Tried workaround from William Brown below, which gave some progress. Failed at later point
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_layer'
cd meshlabplugins/filter_measure/ && ( test -e Makefile || /opt/bin/Qt5.7.1/5.7/gcc_64/bin/qmake
/opt/src/meshlab/src/meshlabplugins/filter_measure/filter_measure.pro -o Makefile ) && gmake -f Makefile
gmake[1]: Entering directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake[1]: *** No rule to make target `filter_measure.xml', needed by `../../distrib/plugins/libfilter_measure.so'. Stop.
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake: *** [sub-meshlabplugins-filter_measure-make_first-ordered] Error 2
I have managed to get past that problem on Centos 7 (7.3.1611).
There seem to be 2 issues, and I don't claim that this is the right fix, just a work-around.
After unpacking the tar file I cd to the top level (I have unpacked to /local/meshlab). I then create a link:
# ln -s ./src/external eternal
The reason being that the -L in the statement that fails seems to be pointed to an external folder at that top level, not in ./src.
Having done that I can build external.pro without any problem, and the output .a files all go into /local/meshlab/lib/linux-g++. Without the link they were deep down in a temporary build folder.
However the -L doesn't look there, it looks in /local/meshlab/src/external/lib/linux-g++/, where there are some pre-shipped .a files already. So I copy the .a files to there:
# cp /local/meshlab/lib/linux-g++/*.a /local/meshlab/src/external/lib/linux-g++/
Now when I use:
# qmake src/meshlab_mini.pro
# gmake
It works and builds a runnable meshlab binary in /local/meshlab/distrib.

Driver and kernel module install for FPGS fails

I am trying to install OpenCL on a machine with the following specs:
CentOS 6.8
Kernel version 2.6.32-642.el6.x86_64
4G of RAM
FPGA board "Nallatech 395 – with Stratix V D8"
aocl version
aocl 16.0.0.211 (Altera SDK for OpenCL, Version 16.0.0 Build 211, Copyright (C) 2016 Altera Corporation)
However, I receive error [Q 2-3] described in the following page:
http://www.alteraforum.com/forum/showthread.php?t=46355
/#aocl install aocl install: Running install from
/root/altera/16.0/hld/board/nalla_pcie/linux64/libexec Using kernel
source files from /usr/src/kernels/2.6.32-642.el6.x86_64 make: ***
/usr/src/kernels/2.6.32-642.el6.x86_64: No such file or directory.
Stop. cp: cannot stat `./aclpci_drv.ko': No such file or directory
FATAL: Module aclpci_drv not found.
The page above suggests to execute the following command:
yum install kernel-devel
However I still receive the same error.
Please advise!
I found a thread with a similar error, the following solution could work for you. However, this solution is based on version 14.
First navigate to the linux/driver of the BSP folder which for you should be located at root/altera/16.0/hld/board/nalla_pcie/linux64/driver
Find and edit the file aclpci.c: At the top of the file add the following lines:
#define __devinit
#define __devexit
Secondly edit aclpci_cmd.c: On line 83 remove the assignment
Change:
result = pci_restore_state(aclpci->pci_dev);
to:
pci_restore_state(aclpci->pci_dev);
On lines 438-440 comment out the following statements:
if (dev->aer_firmware_first) {
return -EIO;
}
You should now be able to run "aocl install" successfully.

arcanist error with RocksDB on fresh install (Mac OS X)

I have installed a fresh copy of arcanist on to Mac OS X El Capitan (10.11.4) into /usr/local/phabricator/arcanist.
If I first cd into /usr/local/phabricator/arcanist and run either bin/arc or just arc (as I added /usr/local/phabricator/arcanist/bin to my PATH) then all is fine. However if I try and run arc lint from my rocksdb directory on my system then I always get a fatal error, the output looks like this:
$ arc lint --trace
ARGV '/usr/local/phabricator/arcanist/bin/../scripts/arcanist.php' 'lint' '--trace'
LOAD Loaded "phutil" from "/usr/local/phabricator/libphutil/src".
LOAD Loaded "arcanist" from "/usr/local/phabricator/arcanist/src".
Config: Did not find user configuration at "/Users/aretter/.arcrc".
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/aretter/code/rocksdb/.arcconfig".
Working Copy: Path "/Users/aretter/code/rocksdb" is part of `git` working copy "/Users/aretter/code/rocksdb".
Working Copy: Project root is at "/Users/aretter/code/rocksdb".
Config: Did not find local configuration at "/Users/aretter/code/rocksdb/.git/arc/config".
Loading phutil library from '/Users/aretter/code/rocksdb/arcanist_util'...
[2016-06-14 09:31:17] EXCEPTION: (PhutilMissingSymbolException) Failed to load class or interface 'ArcanistBaseWorkflow': the class or interface 'ArcanistBaseWorkflow' is not defined in the library map for any loaded phutil library.
If you are not a developer, this almost always means that a library is out of date. For example, you may have upgraded `phabricator` without upgrading `libphutil`, or vice versa. It might also mean that you need to restart Apache or PHP-FPM. Make sure all libraries are up to date and all services have been restarted.
If you are a developer and this symbol was recently added or moved, your library map may need to be rebuilt. You can rebuild the map by running 'arc liberate'. For more information, see:
https://secure.phabricator.com/book/phabcontrib/article/adding_new_classes/ at [<phutil>/src/__phutil_library_init__.php:25]
arcanist(head=master, ref.master=c13e5a629535), arcanist_util(head=java-wb-save-restore-points, ref.master=fda098461b3f, ref.java-wb-save-restore-points=dd6d2e75d836), phutil(head=master, ref.master=fb1e159d3640)
#0 __phutil_autoload(string)
#1 spl_autoload_call(string) called at [<arcanist_util>/config/FacebookArcanistConfiguration.php:7]
#2 include_once(string) called at [<phutil>/src/moduleutils/PhutilBootloader.php:226]
#3 PhutilBootloader::executeInclude(string) called at [<phutil>/src/moduleutils/PhutilBootloader.php:216]
#4 PhutilBootloader::loadLibrarySource(string, string) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:381]
#5 PhutilSymbolLoader::loadSymbol(array) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:256]
#6 PhutilSymbolLoader::selectAndLoadSymbols() called at [<phutil>/src/__phutil_library_init__.php:22]
#7 __phutil_autoload(string)
#8 spl_autoload_call(string) called at [<arcanist>/scripts/arcanist.php:186]
Please note that I have tried reinstalling it and also running arc liberate, but neither has fixed the issue.
Can someone tell me what is wrong on my system?
I have also checked with Git that my arcanist is indeed correct and up-to-date:
$ cd /usr/local/phabricator/arcanist
$ git remote -v
origin github.com/phacility/arcanist.git (fetch)
origin github.com/phacility/arcanist.git (push)
$ git status
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
$ git pull
Already up-to-date.
I also tried reinstalling via this mechanism:
$ cd /usr/local/phabricator
$ rm -rf arcanist libphutil
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
arcanist_util(head=java-wb-save-restore-points, ref.master=fda098461b3f, ref.java-wb-save-restore-points=dd6d2e75d836)
This doesn't look like a fresh copy of arcanist to me from source, at least the upstream isn't responsible for "arcanist_util". Where did you get it from? I would delete it, and pull directly from GitHub. http://github.com/phacility/arcanist

Why is dh_usrlocal throwing a build error?

I am trying to compile a deb package for my server. When I go to build, everything looks good until it gets to dh_usrlocal The build stops and make returns an error. The problem is I am trying this for the first time and I really don't know where to look for the problem.
This is the output from my terminal, I also included the command I ran at the bottom of the output.
make[2]: Leaving directory `/home/ian/Desktop/scst-2.1.0/src'
make[1]: Leaving directory `/home/ian/Desktop/scst-2.1.0'
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installwm
dh_installxfonts
dh_bugfiles
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_usrlocal: debian/scst/usr/local/include/scst/scst.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_user.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/Module.symvers is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_debug.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_const.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_sgv.h is not a directory
rmdir: failed to remove `debian/scst/usr/local/include/scst': Directory not empty
dh_usrlocal: rmdir debian/scst/usr/local/include/scst returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
ian#vm01:~/Desktop/scst-2.1.0$ sudo dpkg-buildpackage -rfakeroot
Any help would be appreciated.
you should skip running dh_usrlocal. to do it you just add this to debian/rules file: override_dh_usrlocal:
In general manner if you have a problem with a specific target, you just override it by adding override_{target} in your debian/rules file.
example, you have a problem with dh_icons. you just add this in your debian/rules file.
override_dh_icons:
{insert your processing commands or do nothing to skip it when building package}
A proper Debian package is not allowed to generate stuff there but empty directories.That is why it is complaining that it can not delete the directory. It doesnt expect files to be there.the only thing you can have is a directory in /usr/local and that's what dh_usrlocal tries to handle
but you shouldn't have files
Users only put files in /usr/local/.
Also i think if you have usr/local name in your directory path it will cause the error also like even though it is not the correct usr/local. An example of what could cause the problem also. I think the regex in build software looks for usr/local.
/var/tmp/usr/local/
I know this is an old post but it is ranked #1 on google so needs a good answer so people solve this problem quickly.
IMPORTANT: This error ONLY occurs when you try to install to /usr/local/
I moved my package to install from /usr/local/lib/python3/dist-packages/ to /usr/lib/python3/dist-packages and the error disappeared. dh_usrlocal seems to be broken or my package is not abiding by rules it expects.
I started getting the error after adding a package.install file to my debian package so it would copy the package contents to the filesystem. (I was installing to /usr/local/ at the time)
Contents of my install file when it failed:
usr/* usr/
Contents when it works correctly:
usr/ usr/
File structure of debian package:
packagename-0.1/
debian/
usr/
local/
lib/
python3/
packagename/
Edit:
This seems only to work when copying root directories. Once I try to specify copying past usr/, it breaks with the same error. See top of answer to find my solution.

Resources