Brand new install of centos 9. (mostly minimal)
I did a find and there is no libl.so on my machine.
sudo yum install bison Last metadata expiration check: 1:52:29 ago on Wed 23 Feb 2022 01:25:31 PM EST. Package bison-3.7.4-5.el9.x86_64 is already installed.
sudo yum install flex Last metadata expiration check: 1:52:25 ago on Wed 23 Feb 2022 01:25:31 PM EST. Package flex-2.6.4-9.el9.x86_64 is already installed.
sudo yum install flex-devel Last metadata expiration check: 1:52:35 ago on Wed 23 Feb 2022 01:25:31 PM EST. No match for argument: flex-devel
I tried installing sudo yum groupinstall 'Development Tools'
nothing works, any ideas?
CodePudding user response:
The static libraries (libfl.a
and libl.a
), which is what were provided before in the package flex-devel
, have been moved to the package libfl-static
. I don't know if RedHat ever provided shared objects; there's a note in the libfl-static ChangeLog that seems to be saying that there is a new package called libfl2
with shared objects, but I don't see it in the package repo. Anyway, static libraries should be fine. There's hardly anything there.
If you're using libl
, that means that:
- you aren't using
%option noyywrap
, which will remove the call toyywrap
(and if you're using the version ofyywrap
inlibl
, then you don't need it to call the function, since that version unconditionally returns 1), and/or - you haven't provided your own
main
function.
I strongly recommend including the following options in all flex files, unless you have a clear need for the suppressed features:
%option noinput nounput noyywrap nodefault
The main
function in libl
is also trivial. It can be replaced with:
int main(void) {
while (yylex() != 0) { }
return 0;
}
CodePudding user response:
As you pointed out in the question - flex-devel
is not found.
It's in the PowerTools
repo.
The 'official' way to enable the repo is to use the yum config-manager command line:
yum config-manager --set-enabled powertools
This may give an error about being missing the config-manager
command:
No such command: config-manager
If this happens, then you can install the dnf-plugins-core package:
yum install -y dnf-plugins-core
and then enable the powertools repo, and then you should be able to yum install flex-devel
, which provides:
$ rpmquery --list flex-devel
/usr/lib64/libfl.a
/usr/lib64/libfl_pic.a
/usr/lib64/libl.a
/usr/share/doc/flex
/usr/share/licenses/flex-devel
/usr/share/licenses/flex-devel/COPYING