Error: Recompile with -fPIC when trying to ./configure && make package nap <p>I am trying to configure and make install package nap6.4 for tcl, but it fails in during "make" with the following error: </p> <pre><code>cc -shared -o libnap6.4.so cart_proj.o eval_tree.o function.o geometry.o land_flag.o land_flag_i.o linsys.o nap.o napChoice.o napDyad.o napDyadLib.o napImgNAO.o napInit.o napLib.o napMonad.o napParse.tab.o napParseLib.o napPolygon.o napSpatial.o nap_get.o nap_hdf.o nap_netcdf.o nap_ooc.o triangulate.o -L/usr/local/lib -lnetcdf -L/usr/local/lib -lmfhdf -ldf -ljpeg -lz -L/usr/local/lib -lproj -L. -ltclstub8.4 -ltkstub8.4 -lieee -lm -lX11 /usr/bin/ld: /usr/local/lib/libmfhdf.a(mfsd.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with - fPIC /usr/local/lib/libmfhdf.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status make: *** [libnap6.4.so] Error 1 </code></pre> <p>So I was told to recompile with -fPIC, which I did in the following way from the terminal:</p> <pre><code>export CFLAGS=-fPIC ./configure --prefix/lib/ActiveTcl --enable-shared make </code></pre> <p>but this does not work. I have also tried with --disable-shared, make clean, and</p> <pre><code>export CFLAGS="-fPIC -DHAVE_NETCDF"/ export CFLAGS="-fPIC" etc.. </code></pre> <p>along with other not-working versions of CFLAGS.</p> <p>So I am wondering how do I recompile with -fPIC? Is there some special syntax that I'm missing here?</p>