15 January 2013

319. Collection of errors when compiling kernel 3.7.x on AMD FX 8150

Update 20th Feb 2013:  Kernel 3.8 compiles fine on AMD FX 8150. Just ignore kernel 3.7.

Original post:

This is a collection of errors
(although you can obviously compile the kernel this way -- just not on AMD FX 8150...)

It does not hold any solutions

See here for how to compile kernel 3.7.0 to 3.7.1:
http://verahill.blogspot.com.au/2012/12/compiling-kernel-37-on-debian.html
and here for how to patch 3.7.1
http://verahill.blogspot.com.au/2012/12/patching-kernel-371-to-fix.html

See here for how to compile 3.7.2 and 3.7.3:
http://verahill.blogspot.com.au/2013/01/321-compiling-kernel-372-on-debian.html

Post continues:
Normally this wouldn't merit its own post, but because I've been annoyed over the inability to compile
kernels on my AMD FX 8150 I decided to collect as much data on the errors as possible.

Basically, kernel 3.7.x fails to build on AMD FX 8150, while kernels 3.6.3 and 3.5 build just fine.
Here's the lspci -n hardware profile for my system, although I'm fairly certain it's due to AMD FX 8150:
00:00.0 0600: 1002:5a14 (rev 02) 00:04.0 0604: 1002:5a18 00:09.0 0604: 1002:5a1c 00:11.0 0106: 1002:4390 (rev 40) 00:12.0 0c03: 1002:4397 00:12.2 0c03: 1002:4396 00:13.0 0c03: 1002:4397 00:13.2 0c03: 1002:4396 00:14.0 0c05: 1002:4385 (rev 42) 00:14.1 0101: 1002:439c (rev 40) 00:14.2 0403: 1002:4383 (rev 40) 00:14.3 0601: 1002:439d (rev 40) 00:14.4 0604: 1002:4384 (rev 40) 00:14.5 0c03: 1002:4399 00:15.0 0604: 1002:43a0 00:15.1 0604: 1002:43a1 00:15.2 0604: 1002:43a2 00:15.3 0604: 1002:43a3 00:16.0 0c03: 1002:4397 00:16.2 0c03: 1002:4396 00:18.0 0600: 1022:1600 00:18.1 0600: 1022:1601 00:18.2 0600: 1022:1602 00:18.3 0600: 1022:1603 00:18.4 0600: 1022:1604 00:18.5 0600: 1022:1605 01:00.0 0300: 10de:0a65 (rev a2) 01:00.1 0403: 10de:0be3 (rev a1) 02:00.0 0c03: 1b6f:7023 (rev 01) 03:06.0 0200: 10ec:8169 (rev 10) 04:00.0 0200: 10ec:8168 (rev 06)

The lower number of errors for kernel 3.7 below is because I did -j1 (so fewer threads to finish), not because it's any better.

Compilation (-O1 example)
mkdir ~/tmp
cd ~/tmp
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.2.tar.bz2
tar xvf linux-3.7.2.tar.bz2
cd linux-3.7.2/
cat /boot/config-`uname -r`>.config
make oldconfig
make-kpkg clean
find -name Makefile|xargs -I {} sed -i 's/\-O2/\-O1/g' {}
time fakeroot make-kpkg -j9 --initrd kernel_image kernel_headers

Errors:

-O2 on kernel 3.7.2 with AMD FX 8150:
net/mac80211/mesh_hwmp.c:1224:1: internal compiler error: in dwarf2out_finish, at dwarf2out.c:22603 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[3]: *** [net/mac80211/mesh_hwmp.o] Error 1 make[2]: *** [net/mac80211] Error 2 make[2]: *** Waiting for unfinished jobs.... net/netfilter/xt_esp.c:94:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[3]: *** [net/netfilter/xt_esp.o] Error 1 make[2]: *** [net/netfilter] Error 2 make[1]: *** [net] Error 2 make[1]: *** Waiting for unfinished jobs.... /home/me/tmp/linux-3.7.2/arch/x86/include/asm/msr-index.h:1:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[6]: *** [drivers/net/wireless/ath/ath9k/ar5008_phy.o] Error 1 make[6]: *** Waiting for unfinished jobs.... make[5]: *** [drivers/net/wireless/ath/ath9k] Error 2 make[4]: *** [drivers/net/wireless/ath] Error 2 make[3]: *** [drivers/net/wireless] Error 2 make[3]: *** Waiting for unfinished jobs.... /home/me/tmp/linux-3.7.2/arch/x86/include/asm/elf.h:78:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[4]: *** [drivers/tty/ipwireless/main.o] Error 1 make[3]: *** [drivers/tty/ipwireless] Error 2 make[3]: *** Waiting for unfinished jobs.... drivers/tty/serial/jsm/jsm_neo.c: In function 'neo_intr': drivers/tty/serial/jsm/jsm_neo.c:1244:1: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[5]: *** [drivers/tty/serial/jsm/jsm_neo.o] Error 1 make[4]: *** [drivers/tty/serial/jsm] Error 2 make[3]: *** [drivers/tty/serial] Error 2 make[2]: *** [drivers/tty] Error 2 make[2]: *** Waiting for unfinished jobs.... drivers/staging/silicom/bp_proc.c:74:31: warning: 'bp_procfs_dir' defined but not used [-Wunused-variable] drivers/staging/silicom/bp_proc.c:76:31: warning: 'proc_getdir' defined but not used [-Wunused-function] {standard input}: Assembler messages: {standard input}:37643: Error: can't resolve `.LVL231' {*UND* section} - `.Ltext0' {.text section} {standard input}:37739: Error: can't resolve `.LVL231' {*UND* section} - `.Ltext0' {.text section} {standard input}:37743: Error: can't resolve `.LVL231' {*UND* section} - `.Ltext0' {.text section} {standard input}:37783: Error: can't resolve `.LVL231' {*UND* section} - `.Ltext0' {.text section} make[4]: *** [drivers/staging/speakup/kobjects.o] Error 1 make[3]: *** [drivers/staging/speakup] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [drivers/staging] Error 2 make[2]: *** [drivers/net] Error 2 In file included from include/linux/genhd.h:65:0, from include/linux/blkdev.h:9, from include/scsi/scsi_cmnd.h:5, from drivers/scsi/sym53c8xx_2/sym_glue.h:58, from drivers/scsi/sym53c8xx_2/sym_hipd.c:44: include/linux/fs.h:1550:49: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[4]: *** [drivers/scsi/sym53c8xx_2/sym_hipd.o] Error 1 make[3]: *** [drivers/scsi/sym53c8xx_2] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [drivers/scsi] Error 2 make[1]: *** [drivers] Error 2 make: *** [debian/stamp/build/kernel] Error 2

and finally
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x2b377411eead] /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1[0x4d2f51] ======= Memory map: ======== 00400000-00fd3000 r-xp 00000000 08:01 1312897 /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 011d2000-011dd000 rw-p 00bd2000 08:01 1312897 /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 011dd000-0133c000 rw-p 00000000 00:00 0 01df7000-020b7000 rw-p 00000000 00:00 0 [heap] 2b3772f20000-2b3772f40000 r-xp 00000000 08:01 11800025 /lib/x86_64-linux-gnu/ld-2.13.so 2b3772f40000-2b3772f42000 rw-p 00000000 00:00 0 2b377313f000-2b3773140000 r--p 0001f000 08:01 11800025 /lib/x86_64-linux-gnu/ld-2.13.so 2b3773140000-2b3773141000 rw-p 00020000 08:01 11800025 /lib/x86_64-linux-gnu/ld-2.13.so 2b3773141000-2b3773142000 rw-p 00000000 00:00 0 2b3773148000-2b3773151000 r-xp 00000000 08:01 2233201 /usr/lib/x86_64-linux-gnu/libfakeroot/libfakeroot-sysv.so 2b3773151000-2b3773351000 ---p 00009000 08:01 2233201 /usr/lib/x86_64-linux-gnu/libfakeroot/libfakeroot-sysv.so 2b3773351000-2b3773352000 rw-p 00009000 08:01 2233201 /usr/lib/x86_64-linux-gnu/libfakeroot/libfakeroot-sysv.so 2b377336b000-2b377336c000 rw-p 00000000 00:00 0 2b3773370000-2b3773384000 r-xp 00000000 08:01 1321607 /usr/lib/x86_64-linux-gnu/libmpc.so.2.0.0 2b3773384000-2b3773584000 ---p 00014000 08:01 1321607 /usr/lib/x86_64-linux-gnu/libmpc.so.2.0.0 2b3773584000-2b3773585000 rw-p 00014000 08:01 1321607 /usr/lib/x86_64-linux-gnu/libmpc.so.2.0.0 2b3773588000-2b37735e3000 r-xp 00000000 08:01 1321605 /usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.0 2b37735e3000-2b37737e3000 ---p 0005b000 08:01 1321605 /usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.0 2b37737e3000-2b37737e5000 rw-p 0005b000 08:01 1321605 /usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.0 2b37737e8000-2b377384f000 r-xp 00000000 08:01 1321603 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5 2b377384f000-2b3773a4f000 ---p 00067000 08:01 1321603 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5 2b3773a4f000-2b3773a57000 rw-p 00067000 08:01 1321603 /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5 2b3773a57000-2b3773a58000 rw-p 00000000 00:00 0 2b3773a58000-2b3773a5a000 r-xp 00000000 08:01 11800014 /lib/x86_64-linux-gnu/libdl-2.13.so 2b3773a5a000-2b3773c5a000 ---p 00002000 08:01 11800014 /lib/x86_64-linux-gnu/libdl-2.13.so 2b3773c5a000-2b3773c5b000 r--p 00002000 08:01 11800014 /lib/x86_64-linux-gnu/libdl-2.13.so 2b3773c5b000-2b3773c5c000 rw-p 00003000 08:01 11800014 /lib/x86_64-linux-gnu/libdl-2.13.so 2b3773c60000-2b3773c76000 r-xp 00000000 08:01 11796562 /lib/x86_64-linux-gnu/libz.so.1.2.7 2b3773c76000-2b3773e75000 ---p 00016000 08:01 11796562 /lib/x86_64-linux-gnu/libz.so.1.2.7 2b3773e75000-2b3773e76000 r--p 00015000 08:01 11796562 /lib/x86_64-linux-gnu/libz.so.1.2.7 2b3773e76000-2b3773e77000 rw-p 00016000 08:01 11796562 /lib/x86_64-linux-gnu/libz.so.1.2.7 2b3773e78000-2b3773ef9000 r-xp 00000000 08:01 11800003 /lib/x86_64-linux-gnu/libm-2.13.so 2b3773ef9000-2b37740f8000 ---p 00081000 08:01 11800003 /lib/x86_64-linux-gnu/libm-2.13.so 2b37740f8000-2b37740f9000 r--p 00080000 08:01 11800003 /lib/x86_64-linux-gnu/libm-2.13.so 2b37740f9000-2b37740fa000 rw-p 00081000 08:01 11800003 /lib/x86_64-linux-gnu/libm-2.13.so 2b37740fa000-2b37740fb000 rw-p 00000000 00:00 0 2b3774100000-2b3774280000 r-xp 00000000 08:01 11796538 /lib/x86_64-linux-gnu/libc-2.13.so 2b3774280000-2b3774480000 ---p 00180000 08:01 11796538 /lib/x86_64-linux-gnu/libc-2.13.so 2b3774480000-2b3774484000 r--p 00180000 08:01 11796538 /lib/x86_64-linux-gnu/libc-2.13.so 2b3774484000-2b3774485000 rw-p 00184000 08:01 11796538 /lib/x86_64-linux-gnu/libc-2.13.so 2b3774485000-2b377448d000 rw-p 00000000 00:00 0 2b3774490000-2b3774681000 r--p 00000000 08:01 1310939 /usr/lib/locale/locale-archive 2b3774681000-2b377469e000 rw-p 00000000 00:00 0 2b37746a3000-2b37750d8000 rw-p 00000000 00:00 0 2b3775119000-2b3776444000 rw-p 00000000 00:00 0 2b3776460000-2b3776475000 r-xp 00000000 08:01 11796737 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b3776475000-2b3776675000 ---p 00015000 08:01 11796737 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b3776675000-2b3776676000 rw-p 00015000 08:01 11796737 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b3778000000-2b3778021000 rw-p 00000000 00:00 0 2b3778021000-2b377c000000 ---p 00000000 00:00 0 7ffffd08f000-7ffffd0b2000 rw-p 00000000 00:00 0 [stack] 7ffffd200000-7ffffd201000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]


-O1; kernel 3.7.2; AMD FX 8150
fs/ecryptfs/keystore.c:1168:28: warning: 'payload_len' may be used uninitialized in this function [-Wmaybe-uninitialized] sound/pci/hda/patch_cmedia.c:777:1: internal compiler error: in size_of_die, at dwarf2out.c:7795 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[4]: *** [sound/pci/hda/patch_cmedia.o] Error 1 make[3]: *** [sound/pci/hda] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [sound/pci] Error 2 make[1]: *** [sound] Error 2 make[1]: *** Waiting for unfinished jobs.... In file included from drivers/mtd/chips/cfi_cmdset_0001.c:35:0: drivers/mtd/chips/cfi_cmdset_0001.c: In function 'cfi_intelext_write_words': include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/media/usb/gspca/topro.c:4968:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[5]: *** [drivers/media/usb/gspca/topro.o] Error 1 make[4]: *** [drivers/media/usb/gspca] Error 2 make[3]: *** [drivers/media/usb] Error 2 make[3]: *** Waiting for unfinished jobs.... drivers/net/ethernet/amd/nmclan_cs.c: In function 'nmclan_config': drivers/net/ethernet/amd/nmclan_cs.c:625:3: warning: 'pcmcia_request_exclusive_irq' is deprecated (declared at include/pcmcia/ds.h:201) [-Wdeprecated-declarations] make[2]: *** [drivers/media] Error 2 make[2]: *** Waiting for unfinished jobs.... drivers/net/ethernet/intel/ixgb/ixgb_ee.c:604:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[6]: *** [drivers/net/ethernet/intel/ixgb/ixgb_ee.o] Error 1 make[6]: *** Waiting for unfinished jobs.... make[5]: *** [drivers/net/ethernet/intel/ixgb] Error 2 make[4]: *** [drivers/net/ethernet/intel] Error 2 make[3]: *** [drivers/net/ethernet] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [drivers/net] Error 2 make[1]: *** [drivers] Error 2 make: *** [debian/stamp/build/kernel] Error 2

-O0, kernel 3.7.2, AMD FX 8150
exec make kpkg_version=12.036+nmu3 -f /usr/share/kernel-package/ruleset/minimal.mk debian INITRD=YES exec debian/rules INITRD=YES kernel_image kernel_headers Setup is 16988 bytes (padded to 17408 bytes). System is 2884 kB CRC f8376713 drivers/isdn/hardware/eicon/divasi.c:577:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[5]: *** [drivers/isdn/hardware/eicon/divasi.o] Error 1 make[4]: *** [drivers/isdn/hardware/eicon] Error 2 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [drivers/isdn/hardware] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [drivers/isdn] Error 2 make[2]: *** Waiting for unfinished jobs.... fs/reiserfs/bitmap.c: In function 'scan_bitmap_block.constprop.9': fs/reiserfs/bitmap.c:236:9: warning: 'next' may be used uninitialized in this function [-Wmaybe-uninitialized] make[1]: *** [drivers] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [debian/stamp/build/kernel] Error 2

Error messages when compiling kernel 3.7 on AMD FX 8150 with -O2 or -O1

exec make kpkg_version=12.036+nmu3 -f /usr/share/kernel-package/ruleset/minimal.mk debian INITRD=YES exec debian/rules INITRD=YES kernel_image kernel_headers net/xfrm/xfrm_sysctl.c:75:1: internal compiler error: in pop_scope, at c-decl.c:1244 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[3]: *** [net/xfrm/xfrm_sysctl.o] Error 1 make[2]: *** [net/xfrm] Error 2 make[1]: *** [net] Error 2 make: *** [debian/stamp/build/kernel] Error 2


Kernel 3.7 with -O0 on AMD FX 8150
exec make kpkg_version=12.036+nmu3 -f /usr/share/kernel-package/ruleset/minimal.mk debian INITRD=YES exec debian/rules INITRD=YES kernel_image kernel_headers In file included from include/acpi/platform/aclinux.h:59:0, from include/acpi/platform/acenv.h:141, from include/acpi/acpi.h:56, from drivers/acpi/acpica/exmisc.c:45: include/linux/sched.h:1352:9: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[4]: *** [drivers/acpi/acpica/exmisc.o] Error 1 make[3]: *** [drivers/acpi/acpica] Error 2 make[2]: *** [drivers/acpi] Error 2 make[1]: *** [drivers] Error 2 make: *** [debian/stamp/build/kernel] Error 2

13 January 2013

318. qmol 0.3.2: A molecular weight calculator for Linux

Over a year ago I complained about the lack of a decent molecular weight calculator in linux in general, and in Debian Testing in particular.  I eventually managed to hack together a molecular weight calculator in Python as part of an isotopic pattern calculator in Python.

However, interpreted languages like python tend to be a bit slower than compiled languages (generally not critical for a molecular weight calculator, but could be for an isotopic pattern calculator), and, perhaps more importantly, my scripts don't feature a GUI.

I vaguely remember trying to compile Kmol by Tomislav Gountchev over a year ago, and as far as I can recall it wasn't working out since it depended on packages (kde-3) that were too old.

But things are changing.

Thomas Mitterfellner has revived Kmol in the form of qmol. Since it's very recent (version 0.1 was created in November 2012, and we're now at version 0.3.2) it's not found in the Debian repos, and maybe won't for some time given that Debian Testing/Wheezy is frozen.

There are, however, a pre-built .deb file for debian squeeze/stable (and Suse, Ubuntu, Fedora etc.) -- so if you're on stable you do not have to compile. Instead go here: http://download.opensuse.org/repositories/home:/lineinthesand/

qmol is a fairly complete solution, and importantly is highly configurable while at the same time being straightforward to use. In particular I like the ability to define your own chemical groups AND the ability to run it from the command line. It's basically what I've been waiting for with the exception of the lack of an isotopic pattern calculator -- but that may come by version 1.0.

Also, the documentation -- or qmol handbook -- is quite extensive and is available under help.


Enough talking -- time for compiling.

sudo apt-get install bzip2 build-essential cmake libqtcore4 libqtgui4 qt4-qmake libqt4-dev
mkdir ~/tmp 
cd ~/tmp
wget http://downloads.sourceforge.net/project/qmol/qmol-0.3.2/qmol-0.3.2.tar.bz2
tar xvf qmol-0.3.2.tar.bz2
mkdir buildqmol
cd buildqmol/
cmake ../qmol-0.3.2
make
sudo make install

Don't worry if you get
-- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found. -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found. -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found.

during the cmake stage.

Usage: Either run qmol from the command line:
qmol 'N(CH3)4'
N(CH3)4 = C4H12N: 74.146 g/mol C 64.80 H 16.31 N 18.89
The output format can be configured when qmol is in gui mode (Edit/Options).

or launch it by typing
qmol
A virgin window

Previous formulae aggregate at the bottom of the  window

It doesn't handle 0, but then neither does my calculator (yet)

It's very easy to define your own group -- but  only the first letter can be  upper case

Options menu -- you can format the command line output here

It works!
There are only two small things to watch out for: the inability to handle 0 (but you get an error message -- my calculator just give you an erroneous result which is arguably worse...) and the requirement that only the first letter in an abbreviation can be upper case (for reasons of ambiguity -- c.f. e.g. CHO vs C, H, O)

12 January 2013

317. Compiling samba 4.0.0 on Debian Testing/Wheezy

Not much to say about this one -- samba/SMB is only one among several linux solutions for sharing files, and probably the easiest one for sharing directories with windows computers. Samba has also been around for about as long as linux, so it has a long and interesting history.

New major versions are always exciting though. Information about Samba 4 can be found here: http://wiki.samba.org/index.php/Samba4

I won't cover configuration here -- partly because I don't know much about it -- so see the link above. To get started you might want to look at this post though: http://verahill.blogspot.com.au/2012/12/300-briefly-sharing-folder-using-samba.html

I also wrote this a long time ago, but haven't checked it for accuracy:
http://verahill.blogspot.com.au/2012/03/building-and-installing-samba-from.html

These instructions will build Samba 4.0.0 with LDAP and Cluster support.
Compilation:
sudo apt-get install build-essential libacl1-dev libattr1-dev libaio-dev libpam0g-dev kfreebsd-headers-9.0-2 libtalloc-dev python-talloc-dev libtevent-dev valgrind libsasl2-dev python2.7-dev libgnutls-dev xsltproc libctdb-dev libldap2-dev libcups2-dev python-ldb-dev ldb-tools libldb-dev checkinstall
mkdir ~/tmp 
cd ~/tmp
wget http://www.samba.org/samba/ftp/stable/samba-4.0.0.tar.gz
tar xvf samba-4.0.0.tar.gz
cd samba-4.0.0/
./configure --prefix=$HOME/.smb4
time make
sudo checkinstall
dpkg -i samba_4.0.0-1_amd64.deb

And you're done. 

Takes about 14 minutes to compile. When you run checkinstall and you're asked
Some of the files created by the installation are inside the home directory: /home You probably don't want them to be included in the package. Do you want me to list them? [n]: n Should I exclude them from the package? (Saying yes is a good idea) [n]: n

Answer no, you DO want to include them. You're getting this warning because we set a --prefix and the files aren't going to the / structure like normal programs.

The samba daemon, smbd, is in ~/.smb4/sbin/ and the configuration files are in /etc/samba/.


Here's the structure of ~/.smb4:
~/.smb4/
|-- bin
|   |-- cifsdd
|   |-- dbwrap_tool
|   |-- eventlogadm
|   |-- gentest
|   |-- ldbadd
|   |-- ldbdel
|   |-- ldbedit
|   |-- ldbmodify
|   |-- ldbrename
|   |-- ldbsearch
|   |-- locktest
|   |-- masktest
|   |-- ndrdump
|   |-- net
|   |-- nmblookup
|   |-- nmblookup4
|   |-- ntlm_auth
|   |-- oLschema2ldif
|   |-- pdbedit
|   |-- pidl
|   |-- profiles
|   |-- regdiff
|   |-- regpatch
|   |-- regshell
|   |-- regtree
|   |-- rpcclient
|   |-- samba-tool
|   |-- sharesec
|   |-- smbcacls
|   |-- smbclient
|   |-- smbclient4
|   |-- smbcontrol
|   |-- smbcquotas
|   |-- smbget
|   |-- smbpasswd
|   |-- smbspool
|   |-- smbstatus
|   |-- smbta-util
|   |-- smbtorture
|   |-- smbtree
|   |-- testparm
|   `-- wbinfo
|-- etc
|-- include
|   |-- charset.h
|   |-- core
|   |-- credentials.h
|   |-- dcerpc.h
|   |-- dcerpc_server.h
|   |-- dlinklist.h
|   |-- domain_credentials.h
|   |-- gen_ndr
|   |-- gensec.h
|   |-- ldap-util.h
|   |-- ldap_errors.h
|   |-- ldap_message.h
|   |-- ldap_ndr.h
|   |-- ldb_wrap.h
|   |-- libsmbclient.h
|   |-- lookup_sid.h
|   |-- machine_sid.h
|   |-- ndr
|   |-- ndr.h
|   |-- netapi.h
|   |-- param.h
|   |-- passdb.h
|   |-- policy.h
|   |-- read_smb.h
|   |-- registry.h
|   |-- roles.h
|   |-- rpc_common.h
|   |-- samba
|   |-- samba_util.h
|   |-- share.h
|   |-- smb2.h
|   |-- smb2_constants.h
|   |-- smb2_create_blob.h
|   |-- smb2_signing.h
|   |-- smb_cli.h
|   |-- smb_cliraw.h
|   |-- smb_common.h
|   |-- smb_composite.h
|   |-- smb_constants.h
|   |-- smb_ldap.h
|   |-- smb_raw.h
|   |-- smb_raw_interfaces.h
|   |-- smb_raw_signing.h
|   |-- smb_raw_trans2.h
|   |-- smb_request.h
|   |-- smb_seal.h
|   |-- smb_share_modes.h
|   |-- smb_signing.h
|   |-- smb_unix_ext.h
|   |-- smb_util.h
|   |-- smbconf.h
|   |-- smbldap.h
|   |-- tdr.h
|   |-- torture.h
|   |-- tsocket.h
|   |-- tsocket_internal.h
|   |-- util
|   |-- util_ldb.h
|   `-- wbclient.h
|-- lib
|   |-- auth
|   |-- bind9
|   |-- gensec
|   |-- idmap
|   |-- ldb
|   |-- libdcerpc-atsvc.so -> libdcerpc-atsvc.so.0.0.1
|   |-- libdcerpc-atsvc.so.0 -> libdcerpc-atsvc.so.0.0.1
|   |-- libdcerpc-atsvc.so.0.0.1
|   |-- libdcerpc-binding.so -> libdcerpc-binding.so.0.0.1
|   |-- libdcerpc-binding.so.0 -> libdcerpc-binding.so.0.0.1
|   |-- libdcerpc-binding.so.0.0.1
|   |-- libdcerpc-samr.so -> libdcerpc-samr.so.0.0.1
|   |-- libdcerpc-samr.so.0 -> libdcerpc-samr.so.0.0.1
|   |-- libdcerpc-samr.so.0.0.1
|   |-- libdcerpc-server.so -> libdcerpc-server.so.0.0.1
|   |-- libdcerpc-server.so.0 -> libdcerpc-server.so.0.0.1
|   |-- libdcerpc-server.so.0.0.1
|   |-- libdcerpc.so -> libdcerpc.so.0.0.1
|   |-- libdcerpc.so.0 -> libdcerpc.so.0.0.1
|   |-- libdcerpc.so.0.0.1
|   |-- libgensec.so -> libgensec.so.0.0.1
|   |-- libgensec.so.0 -> libgensec.so.0.0.1
|   |-- libgensec.so.0.0.1
|   |-- libndr-krb5pac.so -> libndr-krb5pac.so.0.0.1
|   |-- libndr-krb5pac.so.0 -> libndr-krb5pac.so.0.0.1
|   |-- libndr-krb5pac.so.0.0.1
|   |-- libndr-nbt.so -> libndr-nbt.so.0.0.1
|   |-- libndr-nbt.so.0 -> libndr-nbt.so.0.0.1
|   |-- libndr-nbt.so.0.0.1
|   |-- libndr-standard.so -> libndr-standard.so.0.0.1
|   |-- libndr-standard.so.0 -> libndr-standard.so.0.0.1
|   |-- libndr-standard.so.0.0.1
|   |-- libndr.so -> libndr.so.0.0.1
|   |-- libndr.so.0 -> libndr.so.0.0.1
|   |-- libndr.so.0.0.1
|   |-- libnetapi.so -> libnetapi.so.0
|   |-- libnetapi.so.0
|   |-- libnss_winbind.so -> libnss_winbind.so.2
|   |-- libnss_winbind.so.2
|   |-- libnss_wins.so -> libnss_wins.so.2
|   |-- libnss_wins.so.2
|   |-- libpdb.so -> libpdb.so.0
|   |-- libpdb.so.0
|   |-- libregistry.so -> libregistry.so.0.0.1
|   |-- libregistry.so.0 -> libregistry.so.0.0.1
|   |-- libregistry.so.0.0.1
|   |-- libsamba-credentials.so -> libsamba-credentials.so.0.0.1
|   |-- libsamba-credentials.so.0 -> libsamba-credentials.so.0.0.1
|   |-- libsamba-credentials.so.0.0.1
|   |-- libsamba-hostconfig.so -> libsamba-hostconfig.so.0.0.1
|   |-- libsamba-hostconfig.so.0 -> libsamba-hostconfig.so.0.0.1
|   |-- libsamba-hostconfig.so.0.0.1
|   |-- libsamba-policy.so -> libsamba-policy.so.0.0.1
|   |-- libsamba-policy.so.0 -> libsamba-policy.so.0.0.1
|   |-- libsamba-policy.so.0.0.1
|   |-- libsamba-util.so -> libsamba-util.so.0.0.1
|   |-- libsamba-util.so.0 -> libsamba-util.so.0.0.1
|   |-- libsamba-util.so.0.0.1
|   |-- libsamdb.so -> libsamdb.so.0.0.1
|   |-- libsamdb.so.0 -> libsamdb.so.0.0.1
|   |-- libsamdb.so.0.0.1
|   |-- libsmbclient-raw.so -> libsmbclient-raw.so.0.0.1
|   |-- libsmbclient-raw.so.0 -> libsmbclient-raw.so.0.0.1
|   |-- libsmbclient-raw.so.0.0.1
|   |-- libsmbclient.so -> libsmbclient.so.0.2.0
|   |-- libsmbclient.so.0 -> libsmbclient.so.0.2.0
|   |-- libsmbclient.so.0.2.0
|   |-- libsmbconf.so -> libsmbconf.so.0
|   |-- libsmbconf.so.0
|   |-- libsmbldap.so -> libsmbldap.so.0
|   |-- libsmbldap.so.0
|   |-- libsmbsharemodes.so -> libsmbsharemodes.so.0
|   |-- libsmbsharemodes.so.0
|   |-- libtevent-util.so -> libtevent-util.so.0.0.1
|   |-- libtevent-util.so.0 -> libtevent-util.so.0.0.1
|   |-- libtevent-util.so.0.0.1
|   |-- libtorture.so -> libtorture.so.0.0.1
|   |-- libtorture.so.0 -> libtorture.so.0.0.1
|   |-- libtorture.so.0.0.1
|   |-- libwbclient.so -> libwbclient.so.0.11
|   |-- libwbclient.so.0 -> libwbclient.so.0.11
|   |-- libwbclient.so.0.11
|   |-- mit_samba.so
|   |-- nss_info
|   |-- pkgconfig
|   |-- private
|   |-- process_model
|   |-- python2.7
|   |-- security
|   |-- service
|   |-- vfs
|   `-- winbind_krb5_locator.so
|-- private
|-- sbin
|   |-- nmbd
|   |-- samba
|   |-- samba_dnsupdate
|   |-- samba_kcc
|   |-- samba_spnupdate
|   |-- samba_upgradedns
|   |-- samba_upgradeprovision
|   |-- smbd
|   |-- swat
|   `-- winbindd
|-- share
|   |-- codepages
|   |-- man
|   |-- perl5
|   |-- setup
|   `-- swat
`-- var
    |-- cache
    |-- lib
    |-- lock
    |-- locks
    `-- run