Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build progress and unresolved Build error: "/usr/bin/ld: cannot find -lregex" #14

Open
Nathan-L-Cook opened this issue Mar 1, 2022 · 14 comments

Comments

@Nathan-L-Cook
Copy link

Nathan-L-Cook commented Mar 1, 2022

Using Ubuntu-focal. Following these general build instructions: #1 (comment)

Firstly, what I have working. I ran into some issues that I was able to solve. I'll post them up here incase it's useful for anyone.:

Resolved Build Error 1) "gfortran error: unrecognized command line option '-fallow-argument-mismatch'; did you mean '-wno-argument-mismatch'?"
This one was related to needing a newer version of gFortran.
sudo apt-get install gfortran-10
Koko/Src/Makefile:

CC = gcc-10 # for now, only support GCC
FC = gfortran-10

Resolved Build Error 2) "gcc-10: fatal error: cannot execute 'cc1plus': execvp: no such file or directory"
Fixed from here: https://ahelpme.com/linux/ubuntu/install-and-make-gnu-gcc-10-default-in-ubuntu-20-04-focal/

sudo apt upgrade -y
sudo apt install -y build-essential
sudo apt install -y cmake
sudo apt install -y gcc-10 g++-10 cpp-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10

Now what's not working:
Unresolved Build Error 3) "/usr/bin/ld: cannot find -lregex"
From the Koko/Src/Makefile:
LIBS = -static -Wl,--start-group $(addprefix -l,$(SUBDIRS)) -llinenoise -lkmod -Wl,--end-group -lm -lstdc++ -lregex
Not sure how to fix this one. Any ideas? I got the source to build by removing that "-lregex" argument in the Makefile, but I'm pretty sure it's causing some character funny business on the command line.

@dinosauria123
Copy link
Owner

Did you installed regex library ?

I think it is libboost-regex-dev packages.

@Nathan-L-Cook
Copy link
Author

Cool. I'll give that a shot.

@Nathan-L-Cook
Copy link
Author

I installed libboost-regex-dev (and all the other dependencies that apt decided to get) but I'm getting the same build error.
"/usr/bin/ld: cannot find -lregex"

@dinosauria123
Copy link
Owner

Please check regcomp, regexec, regerror, regfree are installed in your system.

@dinosauria123
Copy link
Owner

@Nathan-L-Cook
Copy link
Author

That's already installed.

sudo apt-get install libstdc++-10-dev
   libstdc++-10-dev is already the newest version (10.3.0-1ubuntu1~20.04).
sudo apt-get install libboost-regex-dev
   libboost-regex-dev is already the newest version (1.71.0.0ubuntu2).

Same Build error.

gfortran-10 -o koko-cli koko.o cmder.o names.o libload.o saverest.o  -L./lib -static -Wl,--start-group -lkmath -lldm -lconfig -lhardware -lmacro -loptimize -lparaxial -lpickup -lraytrace -lspecsurf -lnonseq -lutility -lwavespot -lglass -lplotcad -llinenoise -lkmod -Wl,--end-group -lm -lstdc++ -lregex
   /usr/bin/ld: cannot find -lregex

@dinosauria123
Copy link
Owner

Sorry for inconvenience.

Try to install libnfsidmap-regex,
This will make /usr/lib/x86_64-linux-gnu/regex.so

@Nathan-L-Cook
Copy link
Author

Installed libnfsidmap-regex.
Same build error. Still can't find regex.
(thank you for the help. I really appreciate it. Since I started with a fresh Ubuntu-focal I think this process will be helpful for anyone setting up a build environment of Koko once we sort this out and it's working.)

@Nathan-L-Cook
Copy link
Author

Since I started with a fresh Ubuntu-Focal install and followed Jonas231 build/install instructions above, I'm not sure what the deal is except for maybe something with Ubuntu-Focal.

If I was going to try this again with a different linux distro, what should I use? Straight Debian-Testing maybe? Mint?

@Nathan-L-Cook
Copy link
Author

Nathan-L-Cook commented Mar 7, 2022

Just tried with Debian 11.2.0. (debian-11.2.0-amd64-netinst.iso)
Tried all the above regex stuff. Same deal. Still can't find -lregex
(but it also still apparently builds successfully if you just comment out that "#-lregex" at the end of that line of the makefile)

@dinosauria123
Copy link
Owner

dinosauria123 commented Mar 7, 2022

Thank you for your info. I also found comment out "#-lregex" works fine on Ubuntu 21.10.
Original Jim Klien source does not need libregex.
We have added it for linenoise library, to make possible command completion for command inputs on koko-cli.

@Nathan-L-Cook
Copy link
Author

One more update. So far, the easiest install has been using Ubuntu 21.10. Confirmed build there with "#-lregex" commented out. I'm going to try to build it on windows next.

@dinosauria123
Copy link
Owner

Thank you for your trials.
Windows binary build by me is here.

https://github.com/dinosauria123/Koko/releases/tag/20220129-win32-test

@Nathan-L-Cook
Copy link
Author

Cool. My goal is to try to contribute, so I'm working on setting up a full development environment. I'll start a new issues for the problems with the windows build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants