lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2009/12/5 Sam Roberts <vieuxtech@gmail.com>:
> I still can't build because of PIC problems. I think that the .so
> isn't being linked right, maybe statically linked against
> liblua?

I've removed the -fpic flags because on Windows it gives me warning
saying that it is not needed:

ifeq ($(strip $(BUILD_LUA_DLL)), yes)
#  CFLAGS += -fpic
  DEFS += -DUSE_SEPARATE_NAMESPACE
  TARGETS = $(LUA_DLL)
else

May be it should not be removed on Linux ?

Otherwise this is the final link command I get on linux (without
support for complex numbers):

gcc -shared -o .libs/libluagsl.so common.o math-types.o matrix.o
nlinfit_helper.o fdfsolver.o nlinfit.o lua-utils.o linalg.o integ.o
ode_solver.o ode.o random.o randist.o pdf.o cdf.o lua-gsl.o
lua-cplot.o  lua/src/liblua.a  agg-plot/libaggplot.a -lpthread -lagg
-lX11 -lpthread -lsupc++ -lgsl -lgslcblas -lm

and here the results of 'ldd gsl.so'

ldd gsl.so
	linux-gate.so.1 =>  (0x00fc0000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00f4c000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00825000)
	libgsl.so.0 => /usr/lib/libgsl.so.0 (0x00110000)
	libgslcblas.so.0 => /usr/lib/libgslcblas.so.0 (0x0065a000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x0032c000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x002f1000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00352000)
	/lib/ld-linux.so.2 (0x00d6c000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00496000)
	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x0030f000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00313000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00b91000)

so everything looks fine to me but I'm not a shared library guru...

Francesco