Page 1 of 1

Cannot find -lgd

Posted: Fri Nov 29, 2019 6:58 am
by ngeorge3
After installing LibGD and leaving "LDFLAGS += -lgd" ON in the Makefile, I'm getting the following error while compiling serpent:

header.h:22:16: fatal error: gd.h: No such file or directory

As I'm working out of my own private directory (since I'm not the cluster administrator), I was able to fix this error by replacing #include in the SERPENT src files: header.h, meshplotter.c, and geometryplotter.c:

#include <gd.h> --> #include </home/mydirectory/include/gd.h>

Afterwards, the plotting src files are able to locate gd.h; however, I'm now getting the following error at the end of the compilation:

/usr/bin/ld: cannot find -lgd
collect2: error: ld returned 1 exit status
make: *** [sss2] Error 1

Has anyone encountered this problem as well?

To note, I'm able to successfully compile serpent when commenting out LDFLAGS (without the graphics library).

Re: Cannot find -lgd

Posted: Fri Nov 29, 2019 10:31 am
by Riku Tuominen
Have a look at this link.

Re: Cannot find -lgd

Posted: Fri Nov 29, 2019 7:57 pm
by nmg5041
After following the suggested fixes 1-3 from that link, I changed the paths below:

export CPATH=".../include"
export LIBRARY_PATH=".../lib"
export LD_LIBRARY_PATH=".../lib"

And the code was able to compile! I successfully ran an input and have pretty plots now!

Thank you!!!

Re: Cannot find -lgd

Posted: Tue Aug 11, 2020 6:36 pm
by froberto
I am working on Ubuntu 20.04 and installing libgd worked for me:
sudo apt-get install libgd-dev