|
ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-06-2013 06:34 |
|
I have installed chartdirector version in a Lighttpd Web Server with PHP Version 5.4.4-14. in
Linux (arm architecture).
I copied all the /lib files to the PHP extension directory.
I add the following line in php.ini with: extension=phpchartdir540.dll
Thread safety is disabled.
And restart the webserver. And it doesnt work,
Error Log
The version and type of PHP in this system does not support dynmaic loading of PHP
extensions. All PHP extensions must be loaded by using extension statements in the PHP
configuration file.
System Information
Operating System : Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST
2013 armv6l
PHP version : 5.4.4-14
PHP / Web Server interface : cgi-fcgi
PHP configuration file location : "/etc/php5/cgi/php.ini"
PHP extension directory : "/usr/lib/php5/20100525+lfs"
Thanks. |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-09-2013 02:19 |
|
Hi J.Mart?n,
Unlucikly, ChartDirector for PHP currently does not support Linux (armv6l) (this is the Linux type you are using). It only supports Linux (i386), Linux (x86_64) or other non-Linux OS. (In our download page, there is no ChartDirector for PHP for Linux (armv6l) for downloading.)
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-11-2013 02:51 |
|
thanks for your help.
there is any intention in the future to develop a version for arm architectures?
its very difficult to find a something as good as ChartDirector for arm architectures (and, in
others architectures too). |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-12-2013 02:35 |
|
Hi J.Martin,
Currently, we already have two experiment versions of ChartDirector for C++ for ARM. One is for the armv7 architecture, and the other is for the armv5 architecture.
There are many types of ARM architectures. Many chip manufacturers license the ARM architectures, extend them, and produces a large number of different ARM CPUs. The ARM CPUs are used on a wide variety of hardware types.
From our limited experience, we suspect that the ChartDirector compiled on a certain Linux brand for one ARM architecture on a particular hardware may not work on another Linux brand on another ARM architecture on another hardware. (Are you aware of anyone that has successful created a pre-compiled Apache/PHP binary distribution that can run on most ARM hardware?)
If you would like to help us to test the C++ editions, I can provide you the download links. You just need to type "make test" to see if it can run without crashing. I suspect the armv5 may have a chance to work on armv6l platforms too.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-16-2013 01:50 |
|
Thank you for your response. I understand that arm architectures are very different from
one another and thus develop software valid for the widest possible range of architectures
is difficult.
if its possible, i would like to test if Chart Director runns under ARMv6 (its a Raspberry Pi
minicomputer, with a Debian Wheezy OS for Arm architectures, called Raspbian).
Thanks in advance. |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-16-2013 04:16 |
|
Hi J.Martin,
I do not have the exact hardware, and therefore cannot run the exact OS as in your case. The build I have that may work in your case is a "ChartDirector for C++" for ARMv5 as follows:
http://www.advsofteng.com/chartdir_cpp_linux_armv5.tar.gz
Please kindly try it on your hardware to see if it works. To do this, please download it and copy it to your hardware, then open a shell, and enter:
tar xvfz chartdir_cpp_linux_armv5.tar.gz
cd ChartDirector/cppdemo/simplebar
make test
(Note: I assume in your system, you have the gcc/g++ compiler.)
If everything works, there should be no error message, and an image "simplebar.png" should be created in the "ChartDirector/cppdemo/simplebar" directory. In this case, there is a much better chance that we be able to produce a PHP edition that runs on your hardware (as the PHP edition is built on top of the C++ edition).
Please kindly let me know what is the result.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-17-2013 05:51 |
|
Unfotunately, the test crash.
-----------------
g++ -I../../include -L../../lib -Wl,-R../../lib simplebar.cpp -lchartdir -o simplebar
./simplebar
./simplebar: error while loading shared libraries: libchartdir.so.5.1: cannot open shared
object file: No such file or directory
make: *** [test] Error 127
----------------
The executable crashes on runtime with the shared library. I checked the paths and
checked that the dynamic library was available.
sudo ldconfig -p | grep Chart
libchartdir.so.5.1 (libc6) => /home/pi/ChartDirector/lib/libchartdir.so.5.1
libchartdir.so (libc6) => /home/pi/ChartDirector/lib/libchartdir.so
And everything appears to be ok. I didnt see any error.
then I guess that the library is not recognized by the system as a valid library.
Thanks for your help and support. |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-18-2013 01:44 |
|
Hi J.Martin,
The code has not crashed. In fact, the code has not been executed at all, because the operating system cannot load "libchartdir.so.5.1". According to the operating system, it is because of "No such file or directory".
The compiler flags should have configured the "libchartdir.so.5.1" to be at "../../lib/libchartdir.so.5.1". Would you mind to try the followings?
(a) ls -l ../../lib
Do you see "libchartdir.so.5.1"?
(b) ldd simplebar
The above should list out the dependencies of simplebar. It should include "libchartidir.so.5.1" and whether the shared library can be found or not.
(c) Please try to copy "libchartdir.so.5.1" to "/usr/bin" and run "./simplebar" again to see if it works.
If even (c) does not work, please kindly let me know what is the output of (a) and (b).
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-18-2013 05:23 |
|
I think that the error message is confusing.
(a) This appears to be correct.
ls -l ../../lib:
total 3832
drwxr-xr-x 2 pi pi 4096 jun 8 22:07 fonts
lrwxrwxrwx 1 pi pi 20 jun 8 22:07 libchartdir.so -> libchartdir.so.5.1.0
lrwxrwxrwx 1 pi pi 20 jun 8 22:07 libchartdir.so.5.1 -> libchartdir.so.5.1.0
-rwxr-xr-x 1 pi pi 3919287 jun 8 22:07 libchartdir.so.5.1.0
(b) Warning, this shows that the library is not found.
ldd simplebar
libstdc++.so.6 (CXXABI_1.3) => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
libgcc_s.so.1 (GCC_3.5) => /lib/arm-linux-gnueabihf/libgcc_s.so.1
libchartdir.so.5.1 (CDAPI) => not found
libc.so.6 (GLIBC_2.4) => /lib/arm-linux-gnueabihf/libc.so.6
(c)
i have copied in "/usr/bin", "/lib", "/lib/arm-linux-gnueabihf/" and in the "samplebar" folder.
i checked that ldconfig, knows the location of the library:
$ ldconfig -p | grep libchart
libchartdir.so.5.1 (libc6) => /lib/arm-linux-gnueabihf/libchartdir.so.5.1
and always got the same result:
$ ./simplebar
./simplebar: error while loading shared libraries: libchartdir.so.5.1: cannot open shared
object file: No such file or directory
-------------------
i have traced the program by "strace ./simplebar". i saw that the library was really
found.
open("/lib/arm-linux-gnueabihf/libchartdir.so.5.1", O_RDONLY) = 3
read(3, "\\177ELF\\1\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0(\\0\\1\\0\\0\\0004}\\4\\0004\\0\\0\\0"..., 512) =
512
lseek(3, 3918072, SEEK_SET) = 3918072
...
but later, appears...
writev(2, [{"./simplebar", 11}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ",
2}, {"libchartdir.so.5.1", 18}
---------------------
asking google i found something similar that would explain what happens:
http://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists
http://unix.stackexchange.com/questions/13391/getting-not-found-message-when-
running-a-32-bit-binary-on-a-64-bit-system/13409#13409
in summary:
"This situation often arises when you try to run a binary for the right system (or family of
systems) and superarchitecture but the wrong subarchitecture."
Im looking for "running armv5 apps libs on armv6 in raspberry" or some way to obtain
backwards library compatibility, but i didnt found nothing (at the moment) and i dont
know if its possible (or if it will be worth).
Thanks for all. |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-19-2013 02:54 |
|
Hi J.Martin,
What you mentioned (correct superarchitecture but the wrong subarchitecture) is quite possible. (I am aware that Linux can produce the "File Not Found" error can occur if someone using i386/i686 shared objects on an x86_64 OS or vice versa, and it is possible similar behaviour will occur for ARM.)
The OS we use to compile the ARMv5 release is Debian Lenny (which is an ARMv5 OS). The CPU used by our hardware is ARM926. We know that the actual code architecture produced by the compiler on that OS is marked as ARM v4T. The "readelf -A" reports libchartdir.so.5.1.0 as:
readelf -A libchartdir.so.5.1.0
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "ARM9TDMI"
Tag_CPU_arch: v4T
Tag_ARM_ISA_use: Yes
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align8_needed: Yes
Tag_ABI_align8_preserved: Yes, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_optimization_goals: Aggressive Speed
Using "readelf -d", it is found that the libchartdir.so.5.1.0. should depends on four other shared objects as follows:
readelf -d libchartdir.so.5.1.0
Dynamic section at offset 0x3b8088 contains 31 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x00000001 (NEEDED) Shared library: [ld-linux.so.3]
.....
May be you can use the "readelf -A simplebar" to determine the architecture of the "simplebar" as compiled in your computer. The difference in simplebar and libchartdir.so.5.1.0 may help us to determine the source of the problem.
Also, you may try to verify if the fiiles "libdl.so.2", "libm.so.6", "libc.so.7" and "ld-linux.so.3" exists on your machine. I suspect any Linux OS later than Debian Lenny should have these files.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-22-2013 02:06 |
|
Hi,
this is the output:
readelf -A simplebar
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_DIV_use: Not allowed
The files, "libdl.so.2", "libm.so.6", "libc.so.7" and "ld-linux.so.3", exists in the /lib path.
I hope this can help you.
Thanks. |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-23-2013 00:31 |
|
Hi J.Mart?n,
Thanks for you information. After some investigation, I suspect it may be because of hard floating point support "Tag_ABI_VFP_args: VFP registers".
According to the article below, apart from the CPU type, there are two types of ARM distributions and they are binary incompatible - armel and armhf. It appears the original Debian Wheezy is armel (the same as the current ChartDirector for ARM distribution), but Raspbian is armhf (not binary compatible with the original Debian Wheezy, and so not binary compatible with ChartDirector too). I read that from the following Oracle blog, which mentions that Oracle needs to release two editions of Java for ARM to support armel and armhf.
https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel
I will try to see if I can find a suitable armhf release for the hardware I have to test this theory and to solve this problem.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-25-2013 23:17 |
|
Hi J.Mart?n,
We have set up a Raspbian machine and tried ourselves. We found that the problem is in fact due to the armhf vs armel issue. We have since compiled another edition of ChartDirector for ARM based on armhf, and it works on our Raspbian machine. If you would like to try, you may use the following comands to download and test the code:
wget www.advsofteng.com/chartdir_cpp_linux_armv6_hf.tar.gz
tar xvfz chartdir_cpp_linux_armv6_hf.tar.gz
cd ChartDirector/cppdemo/simplebar
make test
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Jul-27-2013 05:19 |
|
yes! it works!!
|
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Jul-27-2013 22:42 |
|
Hi J.Martin,
Thanks for your feedback. It is really useful and encouraging to us. I understand what you really need is a release for PHP 5.4.4. I will try to make one to see if it works for your case.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by J.Mart?n. on Aug-02-2013 04:44 |
|
Thank you for your help and your support. |
Re: ChartDirector on Arm-Linux. |
Posted by Nicolas LM on Oct-25-2013 14:22 |
|
Hello,
I'm also interested by chartdirector for PHP 5.4.4
Please, inform us when the lib would be ready !! ^^ |
Re: ChartDirector on Arm-Linux. |
Posted by Peter Kwan on Oct-26-2013 01:36 |
|
Hi J.Martin / Nicolas LM,
Sorry for forgetting to update this thread. It is now available at:
http://www.advsofteng.com/chartdir_php_linux_armhf.tar.gz
Note that there are several different kinds of incompatible ARM Linux architectures, and the above is for the armhf architecture. If will not work if you are using the armel architecture.
Regards
Peter Kwan |
Re: ChartDirector on Arm-Linux. |
Posted by Nicolas LM on Oct-27-2013 03:20 |
|
Geat it's working !!
Thanks a lot |
Re: ChartDirector on Arm-Linux. |
Posted by J.Martin on Nov-13-2013 04:32 |
|
Great!!
I'm working with ChartDirector on Raspberry Pi Webserver. Works very well, fast and
reliable.
Thanks a lot. |
|