Page 1 of 1

Compiling from Source in Fedora 5

Posted: Thu Oct 26, 2006 4:39 am
by James
Hi,

I'm trying to get ContextFree on my Fedora 5 installation. I've downloaded the source code, uncompressed it and then run $ make, but I keep getting errors.

Having spoken to a non-newbie friend they said to make sure I have gcc, and I've also got the others mentioned in the readme file (bison, flex, libpng) however I don't understand what is not working. Below is what I get when I run $ make - can anyone help?

Code: Select all

$ make
Makefile:44: objs/cfdg.d: No such file or directory
Makefile:44: objs/cfdgimpl.d: No such file or directory
Makefile:44: objs/renderimpl.d: No such file or directory
Makefile:44: objs/builder.d: No such file or directory
Makefile:44: objs/shape.d: No such file or directory
Makefile:44: objs/yglue.d: No such file or directory
Makefile:44: objs/variation.d: No such file or directory
Makefile:44: objs/countable.d: No such file or directory
Makefile:44: objs/tempfile.d: No such file or directory
Makefile:44: objs/aggCanvas.d: No such file or directory
Makefile:44: objs/HSBColor.d: No such file or directory
Makefile:44: objs/SVGCanvas.d: No such file or directory
Makefile:44: objs/primShape.d: No such file or directory
Makefile:44: objs/bounds.d: No such file or directory
Makefile:44: objs/shape.d: No such file or directory
Makefile:44: objs/shapeSTL.d: No such file or directory
Makefile:44: objs/pngCanvas.d: No such file or directory
Makefile:44: objs/posixSystem.d: No such file or directory
Makefile:44: objs/main.d: No such file or directory
Makefile:44: objs/lex.yy.d: No such file or directory
Makefile:44: objs/y.tab.d: No such file or directory
Makefile:44: objs/agg_rasterizer_scanline_aa.d: No such file or directory
Makefile:44: objs/agg_trans_affine.d: No such file or directory
mkdir -p objs 2> /dev/null || true
set -e; g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM src-agg/src/agg_trans_affine.cpp \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/agg_trans_affine.d\2,g' > objs/agg_trans_affine.d; \
[ -s objs/agg_trans_affine.d ] || rm -f objs/agg_trans_affine.d
mkdir -p objs 2> /dev/null || true
set -e; g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM src-agg/src/agg_rasterizer_scanline_aa.cpp \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/agg_rasterizer_scanline_aa.d\2,g' > objs/agg_rasterizer_scanline_aa.d; \
[ -s objs/agg_rasterizer_scanline_aa.d ] || rm -f objs/agg_rasterizer_scanline_aa.d
make: *** No rule to make target `objs/y.tab.d'.  Stop.
Thanks in advance for your help,

James

Posted: Thu Oct 26, 2006 5:51 am
by MLDaeni
Try 'make clean' and then 'make'. If it stops with an error try again 'make'. It works in my case.
You can edit the Makefile and add your own gcc optimizing flags.
Example:

Code: Select all

CPPFLAGS += -O3 -msse2 -march=pentium4
Good luck!

MLDaeni

Posted: Fri Oct 27, 2006 3:06 pm
by MtnViewJohn
That's odd. Make on my Macbook Pro has no problem making obj/y.tab.d. I will try it on my FC3 system.

Attempts so far

Posted: Sat Oct 28, 2006 5:54 pm
by James
Hi,

Thanks for the reply. I tried make clean, then make and make again both as root and normal user - this is what I got (after the same messages about "No such file or directory") after having run make once and then run it again:

Code: Select all

cd objs; yacc -d ../src-common/cfdg.y
/bin/sh: yacc: command not found
make: *** [objs/y.tab.c] Error 127
Each time, using just make or make clean, as both users, the second attempt seems to be failing on yacc. I've double checked and I have bison installed (along with the others).

So I edited the Makefile and replaced yacc with bison after reading that bison = yacc for Fedora. This seemed to get me further but still failed with the following output:

Code: Select all

cd objs; bison -d ../src-common/cfdg.y
mkdir -p objs 2> /dev/null || true
set -e; cc  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM objs/y.tab.c \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/y.tab.d\2,g' > objs/y.tab.d; \
[ -s objs/y.tab.d ] || rm -f objs/y.tab.d
cc: objs/y.tab.c: No such file or directory
cc: no input files
mkdir -p objs 2> /dev/null || true
set -e; cc  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM objs/lex.yy.c \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/lex.yy.d\2,g' > objs/lex.yy.d; \
[ -s objs/lex.yy.d ] || rm -f objs/lex.yy.d
src-common/cfdg.l:3:23: error: y.tab.h: No such file or directory
mkdir -p objs 2> /dev/null || true
set -e; g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM src-unix/pngCanvas.cpp \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/pngCanvas.d\2,g' > objs/pngCanvas.d; \
[ -s objs/pngCanvas.d ] || rm -f objs/pngCanvas.d
src-unix/pngCanvas.cpp:2:17: error: png.h: No such file or directory
g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -o objs/cfdg.o src-common/cfdg.cpp
src-common/shape.h:99: error: extra qualification ‘Replacement::’ on member ‘Replacement’
make: *** [objs/cfdg.o] Error 1
This appeared after the usual No such file or directory messages.

Maybe the bison idea was just wrong, or maybe the above makes sense to someone who isn't me.

Either way thanks for any help.

James

Posted: Sun Oct 29, 2006 1:57 am
by MLDaeni

Code: Select all

src-unix/pngCanvas.cpp:2:17: error: png.h: No such file or directory 
Make sure you installed libpng, CFDG needs it.

Code: Select all

src-common/shape.h:99: error: extra qualification ‘Replacement::’ on member ‘Replacement’
As far as I know, this is a compatibility issue for gcc version 4.1. Edit src-common/shape.h, go to line number 99 and replace "Replacement::Replacement" by "Replacement".

PS: MtnViewJohn, maybe you should make this small modification on the official cfdg source tree, to stay compatible with the last version of gcc (4.1.1). I have the same compiler, and so far it seems to be the only compatibility issue. Pretty remarkable!

Cheers, MLDaeni

Posted: Sun Oct 29, 2006 10:20 am
by MtnViewJohn
OK, I'll fix shape.h and roll that out when we figure out what the fix is for the Mac OS X display bug.

My Cygwin system has a shell script for /usr/bin/yacc:

Code: Select all

#! /bin/sh
exec /usr/bin/bison -y "$@"
Mac OS X seems to have yacc and bison. You should put that script at /usr/bin/yacc.

Getting further

Posted: Sun Oct 29, 2006 2:24 pm
by James
Thanks again for your help.

I've got further with the Shape.h fix, but I'm still getting errors :(

I've triple checked that I have libpng and the latest version - here's a printout of one check:

Code: Select all

rpm -qa|grep libpng
libpng-1.2.8-2.2.1
libpng10-1.0.18-3.2.1
I added libpng10 since it said it was for older systems, but this didn't make any difference.

I've added the script at /usr/bin/yacc (and chmod'd it to be able to run - which I was proud I managed to work out!) but it's still not complete.

My error now reads:

Code: Select all

# make
Makefile:44: objs/pngCanvas.d: No such file or directory
mkdir -p objs 2> /dev/null || true
set -e; g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -MM src-unix/pngCanvas.cpp \
| sed 's,\(.*\.o\)\( *:\),objs/\1 objs/pngCanvas.d\2,g' > objs/pngCanvas.d; \
[ -s objs/pngCanvas.d ] || rm -f objs/pngCanvas.d
src-unix/pngCanvas.cpp:2:17: error: png.h: No such file or directory
g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3  -c -o objs/pngCanvas.o src-unix/pngCanvas.cpp
src-unix/pngCanvas.cpp:2:17: error: png.h: No such file or directory
src-unix/pngCanvas.cpp:63: error: variable or field ‘pngWriteError’ declared void
src-unix/pngCanvas.cpp:63: error: ‘png_structp’ was not declared in this scope
src-unix/pngCanvas.cpp:63: error: ‘png_const_charp’ was not declared in this scope
src-unix/pngCanvas.cpp:63: error: initializer expression list treated as compound expression
src-unix/pngCanvas.cpp:64: error: expected ‘,’ or ‘;’ before ‘{’ token
src-unix/pngCanvas.cpp:70: error: variable or field ‘pngWriteWarning’ declared void
src-unix/pngCanvas.cpp:70: error: ‘png_structp’ was not declared in this scope
src-unix/pngCanvas.cpp:70: error: ‘png_const_charp’ was not declared in this scope
src-unix/pngCanvas.cpp:70: error: initializer expression list treated as compound expression
src-unix/pngCanvas.cpp:71: error: expected ‘,’ or ‘;’ before ‘{’ token
src-unix/pngCanvas.cpp: In member function ‘void pngCanvas::output(const char*, int)’:
src-unix/pngCanvas.cpp:85: error: ‘png_structp’ was not declared in this scope
src-unix/pngCanvas.cpp:85: error: expected `;' before ‘png_ptr’
src-unix/pngCanvas.cpp:86: error: ‘png_infop’ was not declared in this scope
src-unix/pngCanvas.cpp:86: error: expected `;' before ‘info_ptr’
src-unix/pngCanvas.cpp:89: error: ‘png_ptr’ was not declared in this scope
src-unix/pngCanvas.cpp:90: error: ‘PNG_LIBPNG_VER_STRING’ was not declared in this scope
src-unix/pngCanvas.cpp:91: error: ‘png_create_write_struct’ was not declared in this scope
src-unix/pngCanvas.cpp:94: error: expected `;' before ‘info_ptr’
src-unix/pngCanvas.cpp:95: error: ‘info_ptr’ was not declared in this scope
src-unix/pngCanvas.cpp:103: error: ‘png_init_io’ was not declared in this scope
src-unix/pngCanvas.cpp:105: error: ‘info_ptr’ was not declared in this scope
src-unix/pngCanvas.cpp:107: error: ‘PNG_COLOR_TYPE_RGB_ALPHA’ was not declared in this scope
src-unix/pngCanvas.cpp:107: error: ‘PNG_COLOR_TYPE_GRAY’ was not declared in this scope
src-unix/pngCanvas.cpp:108: error: ‘PNG_INTERLACE_NONE’ was not declared in this scope
src-unix/pngCanvas.cpp:108: error: ‘PNG_COMPRESSION_TYPE_DEFAULT’ was not declared in this scope
src-unix/pngCanvas.cpp:109: error: ‘PNG_FILTER_TYPE_DEFAULT’ was not declared in this scope
src-unix/pngCanvas.cpp:109: error: ‘png_set_IHDR’ was not declared in this scope
src-unix/pngCanvas.cpp:111: error: ‘png_text’ was not declared in this scope
src-unix/pngCanvas.cpp:111: error: expected `;' before ‘comments’
src-unix/pngCanvas.cpp:112: error: ‘comments’ was not declared in this scope
src-unix/pngCanvas.cpp:113: error: ‘PNG_TEXT_COMPRESSION_NONE’ was not declared in this scope
src-unix/pngCanvas.cpp:118: error: ‘png_set_text’ was not declared in this scope
src-unix/pngCanvas.cpp:120: error: ‘png_write_info’ was not declared in this scope
src-unix/pngCanvas.cpp:122: error: ‘png_bytep’ was not declared in this scope
src-unix/pngCanvas.cpp:122: error: expected `;' before ‘rowPtr’
src-unix/pngCanvas.cpp:124: error: ‘rowPtr’ was not declared in this scope
src-unix/pngCanvas.cpp:124: error: ‘png_write_row’ was not declared in this scope
src-unix/pngCanvas.cpp:128: error: ‘png_write_end’ was not declared in this scope
src-unix/pngCanvas.cpp:139: error: ‘png_ptr’ was not declared in this scope
src-unix/pngCanvas.cpp:139: error: ‘info_ptr’ was not declared in this scope
src-unix/pngCanvas.cpp:139: error: ‘png_destroy_write_struct’ was not declared in this scope
make: *** [objs/pngCanvas.o] Error 1
Thanks again for any help.

James

Posted: Sun Oct 29, 2006 3:23 pm
by MtnViewJohn
It sounds like libpng is not installed. Look if png.h is in the directory /usr/local/include and if libpng.a is in /usr/local/lib

Re: Compiling from Source in Fedora 5

Posted: Mon Sep 08, 2008 2:44 pm
by bugmenot
James wrote: g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3 -c -o objs/pngCanvas.o src-unix/pngCanvas.cpp src-unix/pngCanvas.cpp:2:17: error: png.h: No such file or directory
Just in case anyone else reads this thread: I had the same problem and found a solution.

I thought I'd installed libpng (which I had) but you need to install libpng-dev