mhulden / foma

Automatically exported from code.google.com/p/foma
117 stars 90 forks source link

error in the compilation #146

Closed arademaker closed 1 year ago

arademaker commented 1 year ago

The Makefile is missing. The foma/README mentioned a generic Makefile but what would be that?

arademaker commented 1 year ago

I just submitted a PR adding the Makefile I got from the tar.gz file mentioned here.

arademaker commented 1 year ago

I closed the PR given that the missing Makefile is justified. The projected moved to cmake. I didn't find the instructions to use cmake . I tried

% cmake .
-- Checking for one of the modules 'readline'
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/ar/Temp/foma/x/foma-ar/foma

ar@tenis foma % make
[  1%] [BISON][Bregex] Building parser with bison 2.3
/Users/ar/Temp/foma/x/foma-ar/foma/regex.y:204.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [regex.c] Error 1
make[1]: *** [CMakeFiles/foma-static.dir/all] Error 2
make: *** [all] Error 2

and I got and error in the regex.c. I am trying to compile in

Darwin tenis.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 x86_64

MacOS 13.2.1 (22D68)

arademaker commented 1 year ago

I have updated the title of the issue to reflect the actual problem.

arademaker commented 1 year ago

Following the instructions from https://github.com/mhulden/foma/blob/fe40aceea1797642dd1cf0fa61fd024c7a7f7095/.github/workflows/build.yml#L21. I tried to pass the -j parameter to make:

%  cmake . && make -j
-- Checking for one of the modules 'readline'
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/ar/Temp/foma/x/foma-ar/foma
[  1%] [BISON][Bregex] Building parser with bison 2.3
[  2%] [FLEX][Fcmatrix] Building scanner with flex 2.6.4
[  4%] [FLEX][Flexc] Building scanner with flex 2.6.4
[  5%] [FLEX][Flexc] Building scanner with flex 2.6.4
[  6%] [BISON][Bregex] Building parser with bison 2.3
[  8%] [FLEX][Fregex] Building scanner with flex 2.6.4
[  9%] [FLEX][Fcmatrix] Building scanner with flex 2.6.4
[ 11%] [FLEX][Fregex] Building scanner with flex 2.6.4
/Users/ar/Temp/foma/x/foma-ar/foma/regex.y:204.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [regex.c] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/ar/Temp/foma/x/foma-ar/foma/regex.y:204.9-16: syntax error, unexpected identifier, expecting string
make[2]: *** [regex.c] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/foma-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/foma-shared.dir/all] Error 2
make: *** [all] Error 2
arademaker commented 1 year ago

OK, I solved the problem. The bison tool distributed with MacOS is too old.

% /usr/bin/bison --version
bison (GNU Bison) 2.3

I installed the bison from Homebrew

% which bison
/usr/local/opt/bison/bin/bison

% bison --version
bison (GNU Bison) 3.8.2

and the make -j finished. So we can close this issue. I am sorry for the noise here. Can I suggest some comments in the README?