gjtorikian / mtex2MML

A Bison grammar to convert TeX math into MathML.
23 stars 14 forks source link

Build fails on FreeBSD 10.2 #48

Closed aslakr closed 8 years ago

aslakr commented 8 years ago

Build fails FreeBSD 10.2:

aslakr:build/ (master) $ cmake ..                                                                                             [0:49:17]
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang 3.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/local/bin/bison (found version "2.7.12-4996") 
-- Found FLEX: /usr/bin/flex (found version "2.5.37") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/aslakr/Documents/mtex2MML/mtex2MML/build

building results is:

aslakr:build/ (master) $ make                                                                                                 [0:57:15]
[  1%] [BISON][MTEX2MMLPARSER] Building parser with bison 2.7.12-4996
conflicts: 5209 shift/reduce, 412 reduce/reduce
[  3%] [FLEX][MTEX2MMLSCANNER] Building scanner with flex 2.5.37
Scanning dependencies of target libmtex2MML
[  5%] Building C object CMakeFiles/libmtex2MML.dir/src/environment.c.o
[  7%] Building C object CMakeFiles/libmtex2MML.dir/src/string_extras.c.o
[  9%] Building C object CMakeFiles/libmtex2MML.dir/src/em.c.o
[ 11%] Building C object CMakeFiles/libmtex2MML.dir/src/colors.c.o
[ 12%] Building C object CMakeFiles/libmtex2MML.dir/parser.c.o
/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:54:30: warning: unused parameter 'ret_str' [-Wunused-parameter]
 static void yyerror (char **ret_str, const char * s)
                             ^
/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:66:14: warning: unused function 'mtex2MML_default_write' [-Wunused-function]
 static void mtex2MML_default_write (const char * buffer, unsigned long length)
             ^
/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:77:14: warning: unused function 'mtex2MML_default_write_mathml'
      [-Wunused-function]
 static void mtex2MML_default_write_mathml (const char * mathml)
             ^
3 warnings generated.
[ 14%] Building C object CMakeFiles/libmtex2MML.dir/lexer.c.o
/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:18:12: error: expected identifier or '('
extern int fileno(FILE *); /* avoids gcc warning */
           ^
/usr/include/stdio.h:494:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:18:12: error: expected ')'
/usr/include/stdio.h:494:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:18:12: note: to match this '('
/usr/include/stdio.h:494:19: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                        ^
2 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
gjtorikian commented 8 years ago

Heya @aslakr, would you mind trying this branch: https://github.com/gjtorikian/mtex2MML/pull/50

gjtorikian commented 8 years ago

@aslakr Did it work for you?

aslakr commented 8 years ago

I'm sorry I didn't answer earlier.

No, it didn't work. Note that the default compiler on FreeBSD 10 is Clang, but even env CC=gcc cmake .. doesn't seem to make any difference.

> cmake ..
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang 3.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/local/bin/bison (found version "2.7.12-4996") 
-- Found FLEX: /usr/bin/flex (found version "2.5.37") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
aslakr@ans3108 ~/D/m/m/build> make
[  1%] Generating ../tests/clar.suite
Written `clar.suite` (283 tests in 11 suites)
[  3%] [BISON][MTEX2MMLPARSER] Building parser with bison 2.7.12-4996
conflicts: 5230 shift/reduce, 414 reduce/reduce
[  5%] [FLEX][MTEX2MMLSCANNER] Building scanner with flex 2.5.37
Scanning dependencies of target mtex2MML_clar
[  7%] Building C object CMakeFiles/mtex2MML_clar.dir/src/environment.c.o
[  9%] Building C object CMakeFiles/mtex2MML_clar.dir/src/string_extras.c.o
[ 10%] Building C object CMakeFiles/mtex2MML_clar.dir/src/em.c.o
[ 12%] Building C object CMakeFiles/mtex2MML_clar.dir/src/colors.c.o
[ 14%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/main.c.o
[ 16%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/clar.c.o
In file included from /usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar.c:641:
In file included from /usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar/sandbox.h:2:
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar/../deps/mkdtemp/mkdtemp.h:5:1: warning: 
      unused function 'do_mkdtemp' [-Wunused-function]
do_mkdtemp (char *path);
^
1 warning generated.
[ 18%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/array.c.o
[ 20%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/basic.c.o
[ 21%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/cornercases.c.o
[ 23%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/delimiters.c.o
[ 25%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/env.c.o
[ 27%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/functions.c.o
[ 29%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/helpers.c.o
[ 30%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/maliciousness.c.o
[ 32%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/mathjax.c.o
[ 34%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/numbered_equations.c.o
[ 36%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/performance.c.o
[ 38%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/symbols.c.o
[ 40%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/trim/trim.c.o
[ 41%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/file2str/file2str.c.o
[ 43%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/mkdtemp/mkdtemp.c.o
[ 45%] Building C object CMakeFiles/mtex2MML_clar.dir/parser.c.o
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:56:30: warning: 
      unused parameter 'ret_str' [-Wunused-parameter]
 static void yyerror (char **ret_str, const char * s)
                             ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:68:14: warning: 
      unused function 'mtex2MML_default_write' [-Wunused-function]
 static void mtex2MML_default_write (const char * buffer, unsigned long length)
             ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:79:14: warning: 
      unused function 'mtex2MML_default_write_mathml' [-Wunused-function]
 static void mtex2MML_default_write_mathml (const char * mathml)
             ^
3 warnings generated.
[ 47%] Building C object CMakeFiles/mtex2MML_clar.dir/lexer.c.o
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:19:12: error: expected
      identifier or '('
extern int fileno(FILE *); /* avoids gcc warning */
           ^
/usr/include/stdio.h:498:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:19:12: error: expected
      ')'
/usr/include/stdio.h:498:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:19:12: note: to match
      this '('
/usr/include/stdio.h:498:19: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                        ^
2 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
gjtorikian commented 8 years ago

Ah, I think I see it now. So obvious! I was missing a semicolon. Would you mind pulling and trying again?

aslakr commented 8 years ago

Hm, no.

~/D/m/m/build (do-gcc-stuff-for-gcc) $ cmake ..
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang 3.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/local/bin/bison (found version "2.7.12-4996") 
-- Found FLEX: /usr/bin/flex (found version "2.5.37") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
~/D/m/m/build (do-gcc-stuff-for-gcc) $ make
[  1%] [BISON][MTEX2MMLPARSER] Building parser with bison 2.7.12-4996
conflicts: 5230 shift/reduce, 414 reduce/reduce
[  3%] [FLEX][MTEX2MMLSCANNER] Building scanner with flex 2.5.37
Scanning dependencies of target mtex2MML_clar
[  5%] Building C object CMakeFiles/mtex2MML_clar.dir/src/environment.c.o
[  7%] Building C object CMakeFiles/mtex2MML_clar.dir/src/string_extras.c.o
[  9%] Building C object CMakeFiles/mtex2MML_clar.dir/src/em.c.o
[ 10%] Building C object CMakeFiles/mtex2MML_clar.dir/src/colors.c.o
[ 12%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/main.c.o
[ 14%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/clar.c.o
In file included from /usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar.c:641:
In file included from /usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar/sandbox.h:2:
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/tests/clar/../deps/mkdtemp/mkdtemp.h:5:1: warning: unused function 'do_mkdtemp' [-Wunused-function]
do_mkdtemp (char *path);
^
1 warning generated.
[ 16%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/array.c.o
[ 18%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/basic.c.o
[ 20%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/cornercases.c.o
[ 21%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/delimiters.c.o
[ 23%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/env.c.o
[ 25%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/functions.c.o
[ 27%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/helpers.c.o
[ 29%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/maliciousness.c.o
[ 30%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/mathjax.c.o
[ 32%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/numbered_equations.c.o
[ 34%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/performance.c.o
[ 36%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/symbols.c.o
[ 38%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/trim/trim.c.o
[ 40%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/file2str/file2str.c.o
[ 41%] Building C object CMakeFiles/mtex2MML_clar.dir/tests/deps/mkdtemp/mkdtemp.c.o
[ 43%] Building C object CMakeFiles/mtex2MML_clar.dir/parser.c.o
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:56:30: warning: unused parameter 'ret_str' [-Wunused-parameter]
 static void yyerror (char **ret_str, const char * s)
                             ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:68:14: warning: unused function 'mtex2MML_default_write' [-Wunused-function]
 static void mtex2MML_default_write (const char * buffer, unsigned long length)
             ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/parser.y:79:14: warning: unused function 'mtex2MML_default_write_mathml' [-Wunused-function]
 static void mtex2MML_default_write_mathml (const char * mathml)
             ^
3 warnings generated.
[ 45%] Building C object CMakeFiles/mtex2MML_clar.dir/lexer.c.o
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:26:12: error: expected identifier or '('
extern int fileno(FILE *); /* avoids gcc warning */
           ^
/usr/include/stdio.h:498:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:26:12: error: expected ')'
/usr/include/stdio.h:498:20: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                         ^
/usr/home/aslakr/Documents/mtex2MML/mtex2MML/src/lexer.l:26:12: note: to match this '('
/usr/include/stdio.h:498:19: note: expanded from macro 'fileno'
#define fileno(p)       (!__isthreaded ? __sfileno(p) : (fileno)(p))
                        ^
2 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
*** Error code 1

Stop.
make: stopped in /usr/home/aslakr/Documents/mtex2MML/mtex2MML/build
aslakr commented 8 years ago

It also fails on FreeBSD 9.3 which defaults to gcc

~/mtex2MML/build]$ cmake .. 
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/local/bin/bison (found version "2.7.12-4996") 
-- Found FLEX: /usr/local/bin/flex (found version "2.6.1") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/aslakr/mtex2MML/build
[aslakr@enna ~/mtex2MML/build]$ make
[  1%] [BISON][MTEX2MMLPARSER] Building parser with bison 2.7.12-4996
conflicts: 5230 shift/reduce, 414 reduce/reduce
[  3%] [FLEX][MTEX2MMLSCANNER] Building scanner with flex 2.6.1
Scanning dependencies of target mtex2MML
[  5%] Building C object CMakeFiles/mtex2MML.dir/src/colors.c.o
[  7%] Building C object CMakeFiles/mtex2MML.dir/src/em.c.o
[  9%] Building C object CMakeFiles/mtex2MML.dir/src/environment.c.o
/home/aslakr/mtex2MML/src/environment.c: In function 'mtex2MML_perform_replacement':
/home/aslakr/mtex2MML/src/environment.c:309: warning: signed and unsigned type in conditional expression
/home/aslakr/mtex2MML/src/environment.c:309: warning: signed and unsigned type in conditional expression
/home/aslakr/mtex2MML/src/environment.c:322: warning: signed and unsigned type in conditional expression
/home/aslakr/mtex2MML/src/environment.c:322: warning: signed and unsigned type in conditional expression
[ 10%] Building C object CMakeFiles/mtex2MML.dir/src/string_extras.c.o
/home/aslakr/mtex2MML/src/../deps/uthash/utstring.h:146: warning: 'utstring_printf' defined but not used
[ 12%] Building C object CMakeFiles/mtex2MML.dir/src/main.c.o
[ 14%] Building C object CMakeFiles/mtex2MML.dir/parser.c.o
/home/aslakr/mtex2MML/src/parser.y:56: warning: unused parameter 'ret_str'
/home/aslakr/mtex2MML/src/../deps/uthash/utstring.h:146: warning: 'utstring_printf' defined but not used
/home/aslakr/mtex2MML/src/parser.y:69: warning: 'mtex2MML_default_write' defined but not used
/home/aslakr/mtex2MML/src/parser.y:80: warning: 'mtex2MML_default_write_mathml' defined but not used
[ 16%] Building C object CMakeFiles/mtex2MML.dir/lexer.c.o
/home/aslakr/mtex2MML/src/lexer.l:26: error: expected identifier or '(' before '!' token
/home/aslakr/mtex2MML/build/lexer.c: In function 'yy_get_next_buffer':
/home/aslakr/mtex2MML/build/lexer.c:8009: warning: comparison between signed and unsigned
/home/aslakr/mtex2MML/build/lexer.c: In function 'mtex2MML_yy_scan_bytes':
/home/aslakr/mtex2MML/build/lexer.c:8547: warning: comparison between signed and unsigned
*** [CMakeFiles/mtex2MML.dir/lexer.c.o] Error code 1

Stop in /usr/home/aslakr/mtex2MML/build.
*** [CMakeFiles/mtex2MML.dir/all] Error code 1

Stop in /usr/home/aslakr/mtex2MML/build.
*** [all] Error code 1

Stop in /usr/home/aslakr/mtex2MML/build.
gjtorikian commented 8 years ago

Instead of guessing, I went ahead and downloaded a FreeBSD VM to test this out. The proper fix is now in master. Thanks for brining this up!

gjtorikian commented 8 years ago

Closed by https://github.com/gjtorikian/mtex2MML/pull/50