fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

Building on Mac results in problems #89

Closed milkypostman closed 13 years ago

milkypostman commented 13 years ago

Sorry if this is a duplicate that I couldn't find, but having this problem when installing on Mac:

dcurtis@hendrix:~/Downloads/fletcher-peg-multimarkdown-7aacba2 > make
CC=gcc make -C peg-0.1.4
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_output.o markdown_output.c
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_lib.o markdown_lib.c
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o GLibFacade.o GLibFacade.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o peg.o peg.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o tree.o tree.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o compile.o compile.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o leg.o leg.c
In file included from peg.c:48:
peg.peg-c: In function ‘yy_Sequence’:
peg.peg-c:666: warning: label ‘l77’ defined but not used
peg.c: At top level:
peg.peg-c:64: warning: ‘yytextmax’ defined but not used
gcc -g -Wall -O3 -DNDEBUG  -o peg-new peg.o tree.o compile.o
mv peg-new peg
gcc -g -Wall -O3 -DNDEBUG  -o leg-new leg.o tree.o compile.o
mv leg-new leg
peg-0.1.4/leg -o markdown_parser.c markdown_parser.leg
rule 'DocForOPML' defined but not used
rule 'AutoLabels' defined but not used
rule 'Notes' defined but not used
rule 'InlineNote' defined but not used
rule 'NonAlphanumeric' defined but not used
rule 'References' defined but not used
rule 'MetaDataOnly' defined but not used
rule 'DocWithMetaData' defined but not used
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_parser.o markdown_parser.c
/usr/bin/llvm-gcc -O3 -march=core2 -w -pipe -o multimarkdown markdown_parser.o markdown_output.o markdown_lib.o GLibFacade.o markdown.c
In file included from markdown.c:27:
markdown_peg.h:16: error: ‘link’ redeclared as different kind of symbol
/usr/include/unistd.h:503: error: previous declaration of ‘link’ was here
make: *** [multimarkdown] Error 1
milkypostman commented 13 years ago

whoops, dupe.

fletcher commented 13 years ago

It looks like you are using an old version.

F

Sent from my iPhone

On Oct 5, 2011, at 3:51 PM, Donald Ephraim Curtis reply@reply.github.com wrote:

Sorry if this is a duplicate that I couldn't find, but having this problem when installing on Mac:

dcurtis@hendrix:~/Downloads/fletcher-peg-multimarkdown-7aacba2 > make
CC=gcc make -C peg-0.1.4
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_output.o markdown_output.c
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_lib.o markdown_lib.c
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o GLibFacade.o GLibFacade.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o peg.o peg.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o tree.o tree.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o compile.o compile.c
gcc -g -Wall -O3 -DNDEBUG  -I/usr/local/Cellar/libiconv/1.14/include -I/usr/local/Cellar/gettext/0.18.1.1/include  -c -o leg.o leg.c
In file included from peg.c:48:
peg.peg-c: In function ‘yy_Sequence’:
peg.peg-c:666: warning: label ‘l77’ defined but not used
peg.c: At top level:
peg.peg-c:64: warning: ‘yytextmax’ defined but not used
gcc -g -Wall -O3 -DNDEBUG  -o peg-new peg.o tree.o compile.o
mv peg-new peg
gcc -g -Wall -O3 -DNDEBUG  -o leg-new leg.o tree.o compile.o
mv leg-new leg
peg-0.1.4/leg -o markdown_parser.c markdown_parser.leg
rule 'DocForOPML' defined but not used
rule 'AutoLabels' defined but not used
rule 'Notes' defined but not used
rule 'InlineNote' defined but not used
rule 'NonAlphanumeric' defined but not used
rule 'References' defined but not used
rule 'MetaDataOnly' defined but not used
rule 'DocWithMetaData' defined but not used
/usr/bin/llvm-gcc -c -O3 -march=core2 -w -pipe -o markdown_parser.o markdown_parser.c
/usr/bin/llvm-gcc -O3 -march=core2 -w -pipe -o multimarkdown markdown_parser.o markdown_output.o markdown_lib.o GLibFacade.o markdown.c
In file included from markdown.c:27:
markdown_peg.h:16: error: ‘link’ redeclared as different kind of symbol
/usr/include/unistd.h:503: error: previous declaration of ‘link’ was here
make: *** [multimarkdown] Error 1

Reply to this email directly or view it on GitHub: https://github.com/fletcher/peg-multimarkdown/issues/89

milkypostman commented 13 years ago

There has to be something wrong with github's servers. I have downloaded it from the Downloads page a number of times. Both the tar.gz and the zip, and half the time the extracted software builds...

milkypostman commented 13 years ago

This is weird:


fletcher-peg-multimarkdown-3-1.2-0-gfbe2152.zip  fletcher-peg-multimarkdown-3.2-0-gfbe2152.tar.gz
fletcher-peg-multimarkdown-3-2.2-0-gfbe2152.zip  fletcher-peg-multimarkdown-3.2-0-gfbe2152.zip
fletcher-peg-multimarkdown-3-3.2-0-gfbe2152.zip  fletcher-peg-multimarkdown-7aacba2
fletcher-peg-multimarkdown-3-4.2-0-gfbe2152.zip

Look at the tag on the zip files, gfbe2152 and then look at the directory 7aacba2 which seems weird to me too.

milkypostman commented 13 years ago

this may not be a markdown issue, but I am reopening and going to send support an issue

iandol commented 13 years ago

I had the same problem today as I wanted to update homebrew's formula and got this, 3.1b1 worked, but 3.2 failed:

https://gist.github.com/1265304

fletcher commented 13 years ago

Not sure what to tell you - it works fine for me and others.

As for homebrew - I don't know what they do for their build environment and why it would compile differently for brew. But that's a homebrew problem.

If you find a fix, and there is something I can do to help make MMD compile easier, I'm happy to do it. But I can't troubleshoot every different way of compiling the software, when it already works.

One suggestion would be to see if the original peg-markdown works via brew. That would help in narrowing down the issue.

milkypostman commented 13 years ago

Well, somehow it's working now. At least there is evidence that I'm not crazy:

http://vimeo.com/30101519

BUT, now it is compiling. I wonder if it wasn't a bug in Github putting the wrong version and having a cached version.

milkypostman commented 13 years ago

FOUND IT!

Line 22 of the Makefile:

CFLAGS ?= -Wall -O3 -ansi -include GLibFacade.h -I ./ -D MD_USE_GET_OPT=1

wasn't getting set properly on some of my systems, maybe because it was set in the shell. Isn't there a better way to do this? I realize that it's not your problem because just typing make will work, but if a user has setup CFLAGS in their own environment, I don't think your Makefile will work properly.

fletcher commented 13 years ago

If there's a fix I'm happy to consider implementing it. But I can't be responsible for compensating for every customization people make to their own system.

I saw your post on the homebrew page, so they were able to fix on their end.

If you have another suggesting for making unistd.h work, I could also look at that.

milkypostman commented 13 years ago

well, the main issue is that you use the type link and it's already defined by unistd.h. Not sure why adding that GLibFacade.h file helps.

fletcher commented 13 years ago

My understanding is that it looks like it prevents unistd.h from defining link by predefining it? I didn't write that part.

milkypostman commented 13 years ago

Thanks for working on this fletcher. Works great now. Glad we figured it out.

I apologize if I came off crass in the dialog.

fletcher commented 13 years ago

No worries - glad it's working. But it does emphasize the potential complications of customizing your build environment so that it doesn't work the same way as everyone else's. I try not to do anything nonstandard with my machine in that regard, but sometimes it can be tough to avoid.

Though I don't use it often, I am a fan of homebrew and glad that MMD 3.2 (and beyond!) are working.

iandol commented 13 years ago

Works great here too, thanks to all!

@fletcher: homebrew is a great way to install mmd3, so I'm happy you did what you could for those of us who use it for our CLI package management! I imagine having an option to install the support files for scrivener automagically would be even easier, but make files are pure voodoo to me...

:beer:

fletcher commented 13 years ago

The support files for scrivener need to be in user's Library. There's already an installer for those for Mac OS X, so not sure why it would be worth going through homebrew for that. There's nothing to build/compile for the Support files.

I'm not particularly interested in figuring out how to get homebrew to ensure the proper location for those files, but there's no reason someone else can't. But to me, a double click installer is even easier than homebrew for 99% of people out there.