Perf on MIPS debug kernel, unable to enable frame_pointer - linux-kernel

I am trying to use perf tool for MIPS & facing some trouble in getting back-stacks.
How can I enable FRAME_POINTER for mips ? I have DEBUG_KERNEL enabled, but it looks like -fno-omit-frame-pointer is not applicable for MIPS arch in kernel.
Does it mean frame pointer based stack unwinding with perf can't be achieved for MIPS ?
I don't see mips toolchain complaining about -fno-omit-frame-pointer flag
EDIT1
I am able to record perf events. Sample output for perf report
Report wouldn't help much without the stack unwinding.
# ./perf --version
perf version 5.6.rc2.gd04712cd3bd7
# uname -a
Linux localhost 3.14.28-1.19 #1 SMP Mon Feb 17 16:48:44 IST 2020 mips GNU/Linux
EDIT2
Perf features detected
Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ on ]
... libbfd: [ OFF ]
... libcap: [ OFF ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ OFF ]
... bpf: [ OFF ]
... libaio: [ on ]
... libzstd: [ OFF ]
... disassembler-four-args: [ OFF ]
EDIT3
I see feature test for libunwind had failed
cat linux-5.6-rc2/tools/build/feature/test-libunwind.make.output
/tmp/ccQnV5jZ.o: In function `main':
test-libunwind.c:(.text+0x1c): undefined reference to `_Umips_create_addr_space'
test-libunwind.c:(.text+0x4c): undefined reference to `_Umips_init_remote'
test-libunwind.c:(.text+0x70): undefined reference to `_Umips_dwarf_search_unwind_table'
collect2: error: ld returned 1 exit status
If I see the makefile for feature tests libunwind linking is not done for MIPS.
EDIT4
Usual workflow
perf record -F 99 -ag -e cycles:u -- sleep 5
perf report
Attempt to use dwarf
# perf record -F 99 -ag --call-graph=dwarf -- sleep 10
Error:
The sys_perf_event_open() syscall returned with 89 (Function not implemented) for event (cycles).
/bin/dmesg | grep -i perf may provide additional information.
dmesg is empty

Related

Linux RTC PCF85063A issue after suspend/resume

I am trying to use the PCF85063A RTC device on a Toradex Colibry i.MX7D processor.
Used Setup:
Colibri iMX7D 1 GB V1.1A
Kernel 5.4.161-5.6.0-devel+git.0f0011824921
For this, I created an own DTS file. Here’s the relevant DTS change:
&i2c4 {
status = "okay";
/* PCF85063A real time clock on carrier board */
pcf_rtc: pcf85063a#51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
interrupt-parent = <&gpio1>;
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};
};
I enabled the driver in the kernel configuration, recompiled the kernel and modules and deployed them.
CONFIG_RTC_DRV_PCF85063=y
The output of dmesg after booting the system is as follows, which looks good to me at first glance:
~$ dmesg | grep rtc
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.293186] rtc rtc0: failed to enable irq wake
[ 1.303787] rtc-pcf85063 3-0051: registered as rtc0
[ 1.309405] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[ 1.757462] rtc-pcf85063 3-0051: setting system clock to 2022-11-28T15:33:09 UTC (1669649589)
But one block within dmesg output makes me think that something is wrong initialized:
[ 1.056406] ------------[ cut here ]------------
[ 1.061047] WARNING: CPU: 0 PID: 1 at drivers/base/power/wakeirq.c:30 dev_pm_attach_wake_irq.constprop.0+0xd0/0xd4
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.077140] Modules linked in:
[ 1.080203] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.161-5.6.0-devel+git.0f0011824921 #1
[ 1.088726] Hardware name: Freescale i.MX7 Dual (Device Tree)
[ 1.094495] [<8010eaf8>] (unwind_backtrace) from [<8010bb1c>] (show_stack+0x10/0x14)
[ 1.102248] [<8010bb1c>] (show_stack) from [<80914d84>] (dump_stack+0x90/0xa4)
[ 1.109480] [<80914d84>] (dump_stack) from [<8090c38c>] (__warn+0xbc/0xd8)
[ 1.116363] [<8090c38c>] (__warn) from [<8090c42c>] (warn_slowpath_fmt+0x84/0x98)
[ 1.123856] [<8090c42c>] (warn_slowpath_fmt) from [<8058b538>] (dev_pm_attach_wake_irq.constprop.0+0xd0/0xd4)
[ 1.133780] [<8058b538>] (dev_pm_attach_wake_irq.constprop.0) from [<8058b688>] (dev_pm_set_wake_irq+0x40/0x70)
[ 1.143879] [<8058b688>] (dev_pm_set_wake_irq) from [<8065d670>] (pcf85063_probe+0x204/0x2f4)
[ 1.152414] [<8065d670>] (pcf85063_probe) from [<8065ed90>] (i2c_device_probe+0xac/0x2c4)
[ 1.160601] [<8065ed90>] (i2c_device_probe) from [<8057e950>] (really_probe+0x24c/0x488)
[ 1.168701] [<8057e950>] (really_probe) from [<8057ed54>] (driver_probe_device+0x78/0x1c4)
[ 1.176974] [<8057ed54>] (driver_probe_device) from [<8057f100>] (device_driver_attach+0x58/0x60)
[ 1.185854] [<8057f100>] (device_driver_attach) from [<8057f1bc>] (__driver_attach+0xb4/0x154)
[ 1.194473] [<8057f1bc>] (__driver_attach) from [<8057cad8>] (bus_for_each_dev+0x64/0x90)
[ 1.202659] [<8057cad8>] (bus_for_each_dev) from [<8057db18>] (bus_add_driver+0x16c/0x208)
[ 1.210931] [<8057db18>] (bus_add_driver) from [<8057fa34>] (driver_register+0x74/0x108)
[ 1.219029] [<8057fa34>] (driver_register) from [<8065f68c>] (i2c_register_driver+0x3c/0xac)
[ 1.227474] [<8065f68c>] (i2c_register_driver) from [<80102670>] (do_one_initcall+0x44/0x194)
[ 1.236009] [<80102670>] (do_one_initcall) from [<80e00e64>] (kernel_init_freeable+0x148/0x1e4)
[ 1.244716] [<80e00e64>] (kernel_init_freeable) from [<80914f2c>] (kernel_init+0x8/0x110)
[ 1.252900] [<80914f2c>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[ 1.260469] Exception stack(0xb0093fb0 to 0xb0093ff8)
[ 1.265525] 3fa0: 00000000 00000000 00000000 00000000
[ 1.273707] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1.281888] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 1.288511] ---[ end trace 2ff9b5ad99dcb9b6 ]---
[ 1.293186] rtc rtc0: failed to enable irq wake
[ 1.303787] rtc-pcf85063 3-0051: registered as rtc0
[ 1.309405] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[ 1.315738] i2c /dev entries driver
Then, when using the RTC device several times, everything looks good.
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
I can see, that changes to the alarm are reflected in the corresponding registers (it works as expected).
~$ i2cdump -f -y -r 0x0-0xf 3 0x51 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 00 40 36 15 28 01 11 22 40 36 15 28 80 ....#6?(??"#6?(?
I can repeat this commands as much as I like… …but when I enter the suspend mode, the behavior changes!
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
~$ systemctl suspend
After the 10s, the system resumes. But now, I am no more able to activate a new alarm:
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
-sh: echo: write error: Permission denied
And dumping i2c device looks very strange…
~$ i2cdump -f -y -r 0x0-0xf 3 0x51 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
…and the output of dmesg is as follows (there seems to be an exception with the RTC driver):
--- snip ---
[ 287.991068] OOM killer enabled.
[ 287.994212] Restarting tasks ...
[ 288.018896] usbmisc_imx 30b10200.usbmisc: vbus is error [ 288.027546] usbmisc_imx 30b10200.usbmisc: Error occurs during detection: -22 [ 288.040850] done.
[ 288.045136] PM: suspend exit
[ 288.188113] irq 66: nobody cared (try booting with the "irqpoll" option)
[ 288.194832] CPU: 0 PID: 1 Comm: systemd Tainted: G W O 5.4.161-5.6.0-devel+git.0f0011824921 #1
[ 288.204571] Hardware name: Freescale i.MX7 Dual (Device Tree) [ 288.210341] [<8010eaf8>] (unwind_backtrace) from [<8010bb1c>] (show_stack+0x10/0x14) [ 288.218092] [<8010bb1c>] (show_stack) from [<80914d84>] (dump_stack+0x90/0xa4) [ 288.225320] [<80914d84>] (dump_stack) from [<8090ca54>] (__report_bad_irq+0x3c/0xc0) [ 288.233071] [<8090ca54>] (__report_bad_irq) from [<8016ea20>] (note_interrupt+0x264/0x2b0) [ 288.241341] [<8016ea20>] (note_interrupt) from [<8016b728>] (handle_irq_event_percpu+0x58/0x64)
[ 288.250045] [<8016b728>] (handle_irq_event_percpu) from [<8016b778>] (handle_irq_event+0x44/0x68) [ 288.258921] [<8016b778>] (handle_irq_event) from [<8016f468>] (handle_level_irq+0xb4/0x140) [ 288.267278] [<8016f468>] (handle_level_irq) from [<8016a868>] (generic_handle_irq+0x24/0x34) [ 288.275723] [<8016a868>] (generic_handle_irq) from [<80518614>] (mxc_gpio_irq_handler+0x48/0x164) [ 288.284603] [<80518614>] (mxc_gpio_irq_handler) from [<80519214>] (mx3_gpio_irq_handler+0x60/0xac) [ 288.293567] [<80519214>] (mx3_gpio_irq_handler) from [<8016a868>] (generic_handle_irq+0x24/0x34) [ 288.302355] [<8016a868>] (generic_handle_irq) from [<8016ae6c>] (__handle_domain_irq+0x5c/0xb0) [ 288.311058] [<8016ae6c>] (__handle_domain_irq) from [<80506fbc>] (gic_handle_irq+0x4c/0x90) [ 288.319413] [<80506fbc>] (gic_handle_irq) from [<80101e10>] (__irq_usr+0x50/0x80) [ 288.326895] Exception stack(0xb0093fb0 to 0xb0093ff8)
[ 288.331950] 3fa0: 00832870 76f699cc 0000006f 0000006f
[ 288.340131] 3fc0: 00832848 008191c8 80000000 fffffffa 007ff6d8 007ff6d8 7ed5aa4c 76f699cc [ 288.348310] 3fe0: 76fb6d6c 7ed5a9f0 76f1b4ad 76ce70a0 600f0030 ffffffff [ 288.354922] handlers:
[ 288.357200] [<e0ffacc5>] irq_default_primary_handler threaded [<c40163d5>] pcf85063_rtc_handle_irq [ 288.366168] Disabling IRQ #66 [ 288.434623] systemd-journald[171]: Successfully sent stream file descriptor to service manager.
--- snip ---
Can anyone help me to get the external RTC running also after a suspend/resume change? Any help would be greatly appreciated.
Cheers
Update:
I am aware that both the internal (snvs_rtc) and external (PCF85063) RTCs are used. It would be enough to use only the external RTC, but I have not managed to disable it. When it is disabled, the system no longer boots and this last dmesg message appears:
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ 6.396724] systemd-journald[173]: Successfully sent stream file descriptor to service manager.
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started Load/Save Random Seed.
I have disabled it with following code in the DTS:
&snvs_rtc {
status = "disabled";
};
This part from dmesg you claim is good is actually not:
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.293186] rtc rtc0: failed to enable irq wake
Which is the warning splat you get in the full dmesg.
Are you sure about the RTC interrupt being connected on gpio1 1? It seems this GPIO is already used as a wakeup interrupt by another driver.
Note that the wakeup-source; property is not needed when you have an interrupt defined.

kernel not able to run /init in initramfs in linux android 10 kernel version 4.9

I have created a custom initramfs using the below command in my custom initramfs directory:
find . | cpio --quiet -H newc -o | gzip -9 -n > ../diaginitrd.img
Then I built a custom bootimage with the above cpio using the command
mkbootimg --kernel --ramdisk
Defconfig variables are as below:
CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_LZMA=y
CONFIG_RD_BZIP2=y
I have not provided CONFIG_INITRAMFS_SOURCE variable in defconfig.
Kernel command line given is as:
Kernel command line: console=ttyMSM0,115200n8 androidboot.console=ttyMSM0 androidboot.configfs=true loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 root=/dev/dm-0 rdinit=/init user_debug=31
On build when i unpack my bootimage i can see my initramfs .
On unpacking the initramfs i can see the content of my initamfs.
When i boot the my device with this bootimage i get below logs:
[ 17.850396] sde: sde1 sde2 sde3 sde4 sde5 sde6 sde7 sde8 sde9 sde10 sde11 sde12 sde13 sde14 sde15 sde16 sde17 sde18 sde19 sde20 sde21 sde22 sde23 sde24 sde25 sde26 sde27 sde28 sde29 sde30 sde31 sde32 sde33 sde34 sde35 sde36 sde37 sde38 sde39 sde40 sde41 sde42 sde43 sde44 sde45 sde46 sde47 sde48 sde49 sde50 sde51 sde52 sde53 sde54 sde55 sde56
[ 17.853364] sd 0:0:0:7: [sdh] Write Protect is off
[ 17.854114] sdf: sdf1 sdf2 sdf3 sdf4 sdf5
[ 17.854573] sd 0:0:0:7: [sdh] Optimal transfer size 8192 bytes
[ 17.861410] sdg: sdg1 sdg2 sdg3 sdg4 sdg5 sdg6 sdg7 sdg8
[ 17.870417] sdh: sdh1 sdh2 sdh3 sdh4 sdh5 sdh6 sdh7 sdh8 sdh9 sdh10 sdh11 sdh12 sdh13 sdh14 sdh15 sdh16 sdh17 sdh18 sdh19 sdh20
[ 17.967128] sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7 sda8 sda9 sda10
[ 17.995848] Freeing unused kernel memory: 7616K
[ 18.002632] Initramfs ---> Failed to execute /init (error -2)
[ 18.009114] Kernel panic - not syncing: Requested init /init failed (error -2).
[ 18.016482] CPU: 6 PID: 1 Comm: swapper/0 Not tainted 4.9.206+ #10
[ 18.022707] Hardware name: Qualcomm Technologies, Inc. sda845 v2.1 MTP (DT)
[ 18.029718] Call trace:
[ 18.032195] [<0000000011338cd0>] dump_backtrace+0x0/0x260
[ 18.037635] [<0000000085c2bec8>] show_stack+0x20/0x28
[ 18.042724] [<00000000d2899c10>] dump_stack+0xbc/0xf8
[ 18.047815] [<00000000bd9287e7>] panic+0x204/0x3f8
[ 18.052652] [<00000000b85fea6d>] kernel_init+0xa4/0x10c
I am not sure why kernel is not able to read my /init file
Note: my /init is a shell script of type
init: POSIX shell script, ASCII text executable.
All the binaries in initramfs are statically linked.
I found the answer:
It was issue of sh and all other binaries.
They were not cross compiled for my system architecture.
Now after cross-compiling the script can work.
Thanks "Ian Abbot" for pointing out the issue

tegrahost_v2: Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed

I've built an image for Jetson TX2 module using yocto. Everything when fine for few days but now I get this error when I try to flash the device.
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0008 ] tegrasign_v2 --key None --getmode mode.txt
[ 0.0016 ] Assuming zero filled SBK key
[ 0.0016 ]
[ 0.0016 ] Generating RCM messages
[ 0.0023 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 --download rcm mb1_recovery_prod.bin 0 0
[ 0.0030 ] RCM 0 is saved as rcm_0.rcm
[ 0.0033 ] RCM 1 is saved as rcm_1.rcm
[ 0.0033 ] List of rcm files are saved in rcm_list.xml
[ 0.0033 ]
[ 0.0033 ] Signing RCM messages
[ 0.0040 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[ 0.0046 ] Assuming zero filled SBK key
[ 0.0076 ]
[ 0.0076 ] Copying signature to RCM mesages
[ 0.0083 ] tegrarcm_v2 --chip 0x18 --updatesig rcm_list_signed.xml
[ 0.0093 ]
[ 0.0093 ] Parsing partition layout
[ 0.0100 ] tegraparser_v2 --pt flash.xml.tmp
[ 0.0109 ]
[ 0.0109 ] Creating list of images to be signed
[ 0.0116 ] tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
[ 0.0161 ]
Error: Return value 4
Command tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
Does this error ring a bell to anyone?
I am able to flash the board with JetPack.
Thanks,
-Damien
Just in case you never figured this out, it looks like
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
is the real error. Fix that and you should be good.

parsing command line output on Windows command line batch file

I have this command that scan a file and returns a summary.
For example on running this command
omsCmdLineUtil.exe process C:\test.exe Default
the result output is:
Ticket:[ 2214271306 ]
Process Details
---------------
File: [ C:\test.exe ]
MD5: [ D41D8CD98F00B204E9800998ECF8427E ]
SHA1: [ DA39A3EE5E6B4B0D3255BFEF95601890AFD80709 ]
SHA256: [ E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 ]
File Size: [ 0 bytes ]
File Type Category: [ O ]
File Type: [ - ]
File Type Description: [ empty ]
[ Clean ] Ahnlab scan engine [ 1 ms ]
[ Clean ] ClamAV scan engine [ 1 ms ]
[ Clean ] BitDefender scan engine [ 1 ms ]
[ Clean ] Avira scan engine [ 1 ms ]
[ Clean ] Quick Heal scan engine [ 1 ms ]
[ Clean ] ThreatTrack scan engine [ 1 ms ]
[ Clean ] ESET scan engine [ 1 ms ]
[ Clean ] Total Defense scan engine [ 1 ms ]
Scan Completion
---------------
[ Clean ]
Ticket: [ 2214271306 ]
File path: C:\test.exe
Scan time: 1 ms [12/20/2015 13:00:06:791]
Process Completion
------------------
Ticket: [ 2214271306 ]
User agent: Default
Profile: Default
Result: [ Allowed ]
File processed: C:\test.exe
I want to create a batch file that parses this result by searching for the output line Result:, check if it's [ Allowed ] or [ Blocked ] and return 0 for allowed and 1 for blocked.
I tried something like this, but its not really working:
omsCmdLineUtil.exe process C:\test.exe Default | set ts = findstr /C:"Result: [ Allowed ]"
if %ts% == "Result: [ Allowed ]" return 0
else return 1
Which modification on code is necessary to get the expected result?
there is no return in Batch. I think, you want exit /b <errorlevel>
omsCmdLineUtil.exe process C:\test.exe Default | find "Result: [ Allowed ]" >nul && Exit /b 0 || Exit /b 1
Instead of Exit 0 you can of Course also use set ts=0 and use that. Or use echo instead.
Some explanations:
>nul redirects the output to nirvana, keeping your screen clean.
&& acts as "If previous command was successfull, then..." (string was found)
|| acts as "if previous command was not successfull, then...` (string was not found)
I prefer using find when possible because of it's simpler syntax, but of course findstr /C:"Result: [ Allowed ]"will also work

cmake can't find boost thread

I'm trying to compile some project to js using emscripten. The project uses cmake as a build tool.
This is how I'm calling cmake:
cmake -DEMSCRIPTEN=1
-DCMAKE_TOOLCHAIN_FILE=~/Documents/emscripten/cmake/Platform/Emscripten_unix.cmake
-DCMAKE_MODULE_PATH=~/Documents/emscripten/cmake
-DCMAKE_BUILD_TYPE=Release
-G "Unix Makefiles"
-DRDK_BUILD_PYTHON_WRAPPERS=
-DBOOST_INCLUDEDIR=~/Documents/boost_1_53_0/boost
-DBOOST_LIBRARYDIR=~/Documents/boost_1_53_0/stage/lib
-DBoost_REGEX_LIBRARY=~/Documents/boost_1_53_0/stage/lib/libboost_regex.a
-DBOOST_ROOT=~/Documents/boost_1_53_0
-DBoost_NO_SYSTEM_PATHS=TRUE
-DBoost_USE_MULTITHREADED=FALSE
-DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_ADDITIONAL_VERSIONS="1.53.0"
-DBoost_DETAILED_FAILURE_MSG=TRUE
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_DEBUG=TRUE
..
This is what I have in /home/mnowotka/Documents/boost_1_53_0/stage/lib directory:
ls -lh ~/Documents/boost_1_53_0/stage/lib
total 4.4M
-rw-rw-r-- 1 mnowotka mnowotka 2.6M Apr 11 10:49 libboost_regex.a
lrwxrwxrwx 1 mnowotka mnowotka 24 Apr 11 10:10 libboost_regex.so -> libboost_regex.so.1.53.0
-rw-rw-r-- 1 mnowotka mnowotka 1.9M Apr 11 10:10 libboost_regex.so.1.53.0
And this is what I'm getting from cmake:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:667 ] Include debugging info:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:669 ] _boost_INCLUDE_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/boost;/home/mnowotka/Documents/boost_1_53_0/include;/home/mnowotka/Documents/boost_1_53_0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:671 ] _boost_PATH_SUFFIXES = boost-1_53_0;boost_1_53_0;boost-1_48_0;boost_1_48_0;boost-1_48;boost_1_48;boost-1_47_0;boost_1_47_0;boost-1_47;boost_1_47;boost-1_46_1;boost_1_46_1;boost-1_46_0;boost_1_46_0;boost-1_46;boost_1_46;boost-1_45_0;boost_1_45_0;boost-1_45;boost_1_45;boost-1_44_0;boost_1_44_0;boost-1_44;boost_1_44;boost-1_43_0;boost_1_43_0;boost-1_43;boost_1_43;boost-1_42_0;boost_1_42_0;boost-1_42;boost_1_42;boost-1_41_0;boost_1_41_0;boost-1_41;boost_1_41;boost-1_40_0;boost_1_40_0;boost-1_40;boost_1_40;boost-1_39_0;boost_1_39_0;boost-1_39;boost_1_39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:696 ] location of version.hpp: /home/mnowotka/Documents/boost_1_53_0/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:715 ] version.hpp reveals boost 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] guessed _boost_COMPILER =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:818 ] _boost_MULTITHREADED =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:861 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:863 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:906 ] _boost_LIBRARY_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/../lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1119 ] Boost_FOUND = TRUE
-- Boost version: 1.53.0
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found BISON: /usr/bin/bison
-- Found FLEX: /usr/bin/flex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:525 ] Boost not in cache
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:528 ] _boost_TEST_VERSIONS = 1.53.0;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:530 ] Boost_USE_MULTITHREADED = FALSE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:532 ] Boost_USE_STATIC_LIBS = OFF
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:534 ] Boost_USE_STATIC_RUNTIME = OFF
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:536 ] Boost_ADDITIONAL_VERSIONS = 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Boost_NO_SYSTEM_PATHS = TRUE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:606 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:608 ] BOOST_ROOT = /home/mnowotka/Documents/boost_1_53_0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:610 ] BOOST_INCLUDEDIR = /home/mnowotka/Documents/boost_1_53_0/boost
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:612 ] BOOST_LIBRARYDIR = /home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:614 ] _boost_TEST_VERSIONS = 1.53.0;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:696 ] location of version.hpp: /home/mnowotka/Documents/boost_1_53_0/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:715 ] version.hpp reveals boost 1.53.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] guessed _boost_COMPILER =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:818 ] _boost_MULTITHREADED =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:861 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:863 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:906 ] _boost_LIBRARY_SEARCH_DIRS = /home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib;/home/mnowotka/Documents/boost_1_53_0/lib;/home/mnowotka/Documents/boost_1_53_0/../lib;/home/mnowotka/Documents/boost_1_53_0/stage/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:977 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-1_53;boost_regex;boost_regex-1_53;boost_regex;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1009 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-d-1_53;boost_regex-d;boost_regex-d-1_53;boost_regex-d;boost_regex;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1119 ] Boost_FOUND = FALSE
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1202 (message):
Unable to find the requested Boost libraries.
Boost version: 1.53.0
Boost include path: /home/mnowotka/Documents/boost_1_53_0
The following Boost libraries could not be found:
boost_regex
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
Code/GraphMol/SLNParse/CMakeLists.txt:4 (find_package)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_REGEX_LIBRARY (ADVANCED)
linked by target "testSLNParse" in directory /home/mnowotka/Documents/rdkit-code/Code/GraphMol/SLNParse
-- Configuring incomplete, errors occurred!
I have only one question: why?
What I'm doing wrong? This drives me crazy....
(BTW: it doesn't matter if I set Boost_USE_STATIC_LIBS and Boost_USE_STATIC_RUNTIME ON or OFF - it doesn't work either...)
You are aware, that Emscripten can currently only use modules (e.g. Boost, Boost-Regex) which source code it compiles? In other words, Emscripten can not use dynamic libraries or precompiled static ones!
So you have to add the sourcecode for Boost-Regex to your cmake file and build them together (I have not done cmake for quite a while so I cannot tell you how).
Or you could remove the check for Boost-Regex from cmake and hardcode the necessary references
Whatever you choose to do, you will have to build Boost-Regex with Emscripten, too!
As for Emscripten, you should really use Boost_USE_STATIC_LIBS=ON because dynamic libraries are currently not supported by Emscripten (see above).
Emscripten does also not support calls to pthread* or any concurrent handling. You should search for these things in your code.
Sorry to sound so negative, but currently using libraries with Emscripten is no piece of cake.

Resources