Re: Compiling g2clib

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 02 2013 - 12:51:48 MST

Hi Ben,
One thing I notice immediately is that I think you INC line is wrong. Assuming you are trying to include two directories, each of them must have a separate '-I'. Try;
INC=-I/usr/include -I/usr/local/lib

A further question is are there actually any include files in /usr/local/lib? This would be unusual.
What system are you trying to compile on? On a mac you may need to use -m64 instead of -q64. My suggestion would be to start with as few flags
as possible.
My own successful makefile for g2clib (on a mac) looks like this:

DEFS=-g -DUSE_JPEG2000 -DUSE_PNG -D__64BIT__

#
# Please make sure to include all idirectories where include files
# can be found (jasper/*.h and png.h pngconf.h zconf.h zlib.h)
#

INC=-I/usr/local/include

#
# This "C" source code contains many uses of the C++
# comment style "//". Please make sure you include the
# appropriate compiler flag to allow the use of "//" comment indicators.
#

CFLAGS= $(INC) $(DEFS)

CC=cc

I think 'cc' on my machine maps to 'gcc', which by default seems to have no problem with C++ style comments.
Hope this is helpful.
 -dave

On Dec 1, 2013, at 12:52 PM, Ben Jolly <ben.jolly@pg.canterbury.ac.nz> wrote:

> Hi
>
> I’m having trouble compiling g2clib as per the instructions at http://www.pyngl.ucar.edu/Download/build_pynio_from_src.shtml
>
> I have been following the guide with no problems thus far, however it’s telling me to change compiler (CC) and flag (CFLAGS) lines but not specifying what to change them to. I had a bit of a play based on hints in the makefile and ended up with:
>
> DEFS=-DUSE_JPEG2000 -DUSE_PNG -D__64BIT__
> INC=-I/usr/include /usr/local/lib
> CFLAGS=-q64 -O3 -qarch=auto -qcpluscmt $(INC) $(DEFS)
> CC=gcc –fPIC
>
> Which failed miserably because –q64 was not a valid GCC flag (yes I am building on a 64-bit system). Can anyone push me in the right direction?
>
> Thanks
> Ben
>
>
> This email may be confidential and subject to legal privilege, it may
> not reflect the views of the University of Canterbury, and it is not
> guaranteed to be virus free. If you are not an intended recipient,
> please notify the sender immediately and erase all copies of the message
> and any attachments.
>
> Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
> information.
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Mon Dec 2 12:51:57 2013

This archive was generated by hypermail 2.1.8 : Thu Dec 05 2013 - 11:51:22 MST