[Samba] Problem compiling Samba4, Python installed in nonstandard location

Andrew Bartlett abartlet at samba.org
Fri Dec 21 15:11:52 MST 2012


On Fri, 2012-12-21 at 15:55 -0600, Flint Million wrote:
> Hi,I am working with a custom built (LFS-based) Linux distro and am attempting to compile Samba4.
> Samba3 has always compiled without issue.
> The system has its Python installed in /opt/python2. There are symlinks to put "python" in /usr/local/bin and the "python2.7" lib folder in /usr/include.
> The configure command used was simply ./configure --enable-fhs --with-quotas 
> The compile runs fine until it gets to steps involving Python. I'm guessing this has to do with Python headers not being properly included, but I can't figure out what approach to take to make it work right:
> [3286/3752] Linking default/lib/talloc/libpytalloc-util.so/opt/python2/lib/libpython2.7.a(longobject.o): In function `PyLong_FromString':/usr/src/Python-2.7.3/Objects/longobject.c:1851: undefined reference to `log'/opt/python2/lib/libpython2.7.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':/usr/src/Python-2.7.3/Python/dynload_shlib.c:94: undefined reference to `dlsym'/usr/src/Python-2.7.3/Python/dynload_shlib.c:130: undefined reference to `dlopen'/usr/src/Python-2.7.3/Python/dynload_shlib.c:141: undefined reference to `dlsym'/usr/src/Python-2.7.3/Python/dynload_shlib.c:133: undefined reference to `dlerror'/opt/python2/lib/libpython2.7.a(signalmodule.o): In function `timeval_from_double':/usr/src/Python-2.7.3/./Modules/signalmodule.c:112: undefined reference to `floor'/usr/src/Python-2.7.3/./Modules/signalmodule.c:112: undefined reference to `floor'/usr/src/Python-2.7.3/./Modules/signalmodule.c:113: undefined reference to `fmod'/usr/src/Python-2.7.3/./Modules/signalmodule.c:113: undefined reference to `fmod'/opt/python2/lib/libpython2.7.a(posixmodule.o): In function `posix_openpty':/usr/src/Python-2.7.3/./Modules/posixmodule.c:3756: undefined reference to `openpty'/opt/python2/lib/libpython2.7.a(posixmodule.o): In function `posix_forkpty':/usr/src/Python-2.7.3/./Modules/posixmodule.c:3816: undefined reference to `forkpty'/opt/python2/lib/libpython2.7.a(complexobject.o): In function `_Py_c_pow':/usr/src/Python-2.7.3/Objects/complexobject.c:139: undefined reference to `hypot'/usr/src/Python-2.7.3/Objects/complexobject.c:140: undefined reference to `pow'/usr/src/Python-2.7.3/Objects/complexobject.c:141: undefined reference to `atan2'/usr/src/Python-2.7.3/Objects/complexobject.c:143: undefined reference to `sincos'/usr/src/Python-2.7.3/Objects/complexobject.c:144: undefined reference to `exp'/usr/src/Python-2.7.3/Objects/complexobject.c:145: undefined reference to `log'/opt/python2/lib/libpython2.7.a(complexobject.o): In function `_Py_c_abs':/usr/src/Python-2.7.3/Objects/complexobject.c:210: undefined ref
> erence to `hypot'/opt/python2/lib/libpython2.7.a(floatobject.o): In function `float_divmod':/usr/src/Python-2.7.3/Objects/floatobject.c:750: undefined reference to `fmod'/opt/python2/lib/libpython2.7.a(floatobject.o): In function `float_rem':/usr/src/Python-2.7.3/Objects/floatobject.c:718: undefined reference to `fmod'/opt/python2/lib/libpython2.7.a(floatobject.o): In function `float_pow':/usr/src/Python-2.7.3/Objects/floatobject.c:912: undefined reference to `pow'/usr/src/Python-2.7.3/Objects/floatobject.c:888: undefined reference to `fmod'/usr/src/Python-2.7.3/Objects/floatobject.c:863: undefined reference to `fmod'/usr/src/Python-2.7.3/Objects/floatobject.c:853: undefined reference to `fmod'/opt/python2/lib/libpython2.7.a(floatobject.o): In function `_Py_double_round':/usr/src/Python-2.7.3/Objects/floatobject.c:1137: undefined reference to `fmod'collect2: error: ld returned 1 exit statusWaf: Leaving directory `/home/src/samba-4.0.0/bin'Build failed:  -> task failed (err #1):         {task: cc_link pytalloc_util_5.o -> libpytalloc-util.so}make: *** [all] Error 1
> I'm not at all familiar with the "waf" build system, so I'm not sure how I can do things like apply additional LD or C flags (was thinking of forcing it to use /opt/python2/include as an include dir) or if this is something completely unrelated. I do know there's something that's always happened with this system where the LDFLAGS doesn't include "-ldl" so those "dl" errors might be related to that, but executing "LDFLAGS=-ldl make" didn't change the behavior at all.
> Any advice? 
> F

These errors seem to indicate the python isn't sufficiently linked on
your platform.  Do other things compile correctly against python?  Is
your /etc/ld.so.conf correct?

On the broader question, you can pass additional LDFLAGS to Samba's
build process like so:

LDFLAGS=-lm ./configure

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba mailing list