Re: [AMBER] Problems using NAB and GCC

From: David A Case <case.biomaps.rutgers.edu>
Date: Thu, 10 Jan 2013 14:22:06 -0500

On Thu, Jan 10, 2013, Roberto Vera wrote:
>
> I am using NAB to create a model server but I am facing some compilation
> problems. I would like to understand the NAB compilation process.
>
> I have my .nab code and a C code with the main.
>
> If I compile like this:
>
> nab -o a.out main.c nabcode.nab
>
> the program runs very well.

The "-v" option is your friend. Add this flag to the line above, and nab will
print exactly what it is doing, and you can see how that differs from what you
are doing. The nab load procedure links in a bunch of libraries (e.g.
libsff.a) that you don't seem to be referencing.

>
> However, if I compile the program using the gcc with the C or the object
> generated by NAB like this:
>
> nab -c nabcode.nab
> gcc -c main.c
> gcc -o a.out main.o nabcode.c -L/usr/local/nab/lib/Linux -lnab -lm
>
> the program compiles well but it gives a nice Segmentation fault during the
> execution.

gdb (or other debuggers) are your friend when you get segfaults.

....hope this helps....dac


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Jan 10 2013 - 11:30:02 PST
Custom Search