|
Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Oct-28-2025 00:36 |
|
| Can ChartDirector support Loongson architecture? |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Oct-28-2025 17:33 |
|
Hi choujayyl,
There are many editions of ChartDirector. In theory, the Java edition of ChartDirector can run only any computer that supports Java. Also, ChartDirector for .NET can run only any machine that supports the .NET Framework. However, we have never tested it for the Loongson architecture.
The C++, PHP, Perl and Python editions of ChartDirector is compiled to native i686 and x64 code, so they will not directly run on Loongson CPU. However, it may still be possible if your system supports CPU emulation in a virtual machine.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Oct-28-2025 19:20 |
|
| Yes, I'm aware of what you said. Before I looked at the forum posts, I had provided ARM32, Raspberry Pi, and other compiled versions. So, can the Loongson compiler be used to compile ChartDirector for use? Our company has already purchased the Windows version license. |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Oct-28-2025 22:40 |
|
Hi choujayyi,
I can try to compile using a loongson virtual machine. To do this, I would need to know your operating system (eg. Debian Linux) and the programming language you are using (C++, Python, Perl, PHP). For Python/Perl/PHP, please specify the language version as well.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Oct-29-2025 10:21 |
|
| If you are referring to the virtual machine method, when testing on Intel or AMD, you need to use QEMU. This is because the CPU architecture is Loongson. My test system is Deepin (which is based on Debian Linux), and the programming language used is C++17 with gcc 8.3. You can use the cross-compilation tool gcc LoongArch64, and the download link is: https://www.loongnix.cn/zh/toolchain/GNU/ |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Oct-29-2025 11:03 |
|
Hi choujayyi,
Yes, I will use QEMU. In the past, the ChartDirector on ARM/ARM64 are built with a QEMU machine too.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-03-2025 10:19 |
|
Hi Peter Kwan.
How's it going? If possible, could you release a version first so that I can test it on my machine? |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-04-2025 10:50 |
|
Hi choujayyl,
We have set up a QEMU Loongarchy4 machine and compiled ChartDirector. Unluckily, it does not work immediately. The problem is font handling. It can produce the chart graphics but not the text. We still need to investigate and test it to see what is causing the problem.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-04-2025 15:34 |
|
Hi choujayyl,
I managed to produced a loongarch64 shared object that seems to work. At the moment, I have only tested it for a few charts and it works normally. If you want to try it as soon as possible, you can download the shared object using the link below:
https://www.advsofteng.com/support/loongarch64_libchartdir.so.7.0.0.zip
You can use the Linux (x86_64) edition of ChartDirector, and replace the x86_64 libchartdir.so.7.0.0 with the loongarch64 shared object. I tested with some of the sample code in ChartDirector/cppdemo and they work.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-04-2025 15:41 |
|
Hi choujayyl,
For your information, the Linux distribution I used is (reported by "uname -a"):
Linux loongsondeepin 6.6.84-loong64-desktop-hwe #23.01.00.56 SMP PREEMPT Thu Apr 3 23:51:58 CST 2025 loongarch64 GNU/Linux
and the gcc I used is (reported by gcc -v):
gcc version 12.3.0 (Deepin 12.3.0-17deepin12)
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-04-2025 18:35 |
|
Hi Peter Kwan.
Thank you very much. However, the version of gcc you are using is too high. It would be very troublesome for me to upgrade gcc. Could you use a lower version of gcc? Please don't exceed gcc 8.3. Also, for compatibility, the version of glibc that your previously released Linux version depends on should be very low. thank you |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-04-2025 22:07 |
|
Hi choujayyl,
Have you tested if the libchartdir.so.7.0.0 works in your machine? If it does not work, what is the error message?
My impression is that the gcc version is not too important. As long as the Linux OS includes all the dependency libraries, in theory it should work. You can use "ldd libchartdir.so" to check. It will list out the dependency libraries and whether it can be found in your Linux. In my machine, it is:
ldd libchartdir.so
linux-vdso.so.1 (0x00007ffffe0cc000)
libstdc++.so.6 => /lib/loongarch64-linux-gnu/libstdc++.so.6 (0x00007ffff01d0000)
libm.so.6 => /lib/loongarch64-linux-gnu/libm.so.6 (0x00007ffff0138000)
libgcc_s.so.1 => /lib/loongarch64-linux-gnu/libgcc_s.so.1 (0x00007ffff00d4000)
libc.so.6 => /lib/loongarch64-linux-gnu/libc.so.6 (0x00007fffeff24000)
/lib64/ld-linux-loongarch-lp64d.so.1 (0x00007ffff09e4000)
If in your machine some dependencies are not found or is of the incorrect version, ldd should report that problem.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-05-2025 09:28 |
|
Hi Peter Kwan.
This is a typical Linux software compatibility issue and it is very important. glibc is the core of the system, and upgrading it casually can cause the entire system to crash. Therefore, software releases are generally compiled with lower version compilers so that both old and new systems can use them.
This is the error log from my system. It's saying that it can't find the high-version glibc functions:
undefined reference to `tan@GLIBC_2.36'
undefined reference to `strcspn@GLIBC_2.36'
undefined reference to `pthread_mutex_init@GLIBC_2.36'
undefined reference to `wcstod@GLIBC_2.36'
undefined reference to `strand@GLIBC_2.36'
undefined reference to `sin@GLIBC_2.36'
undefined reference to `dladder@GLIBC_2.36'
undefined reference to `tolower@GLIBC_2.36'
undefined reference to `qsrt@GLIBC_2.36'
undefined reference to `atan2@GLIBC_2.36'
undefined reference to `isoc23_strtol@GLIBC_2.38'
undefined reference to `fread@GLIBC_2.36'
undefined reference to `throw_bad_array_new_length()@GLIBCXX_3.4.30'
undefined reference to `malloc@GLIBC_2.36'
undefined reference to `wcslencat_new@GLIBC_2.36'
undefined reference to `wcstombs@GLIBC_2.36'
undefined reference to `strncmp@GLIBC_2.36'
undefined reference to `sincos@GLIBC_2.36'
undefined reference to `strcat@GLIBC_2.36'
undefined reference to `ftell@GLIBC_2.36'
......
ldd check:
admin@admin-/ChartDirector/chartdir_cpp_linux_64/ChartDirector/lib$ ldd libchartdir.so.7.0.0
linux-vdso.so.1 (0x00007ffc0a000000)
libloongarch64-linux-gnu/libm.so.6 => /lib/loongarch64-linux-gnu/libm.so.6 (0x00000000fffce0000)
libloongarch64-linux-gnu/libc.so.6 => /lib/loongarch64-linux-gnu/libc.so.6 (0x00000000fff6e4000)
/lib/loongarch64-linux-gnu/ld-linux-so.1 (0x00000000fff7a9000)
libchartdir.so.7.0.0: /lib/loongarch64-linux-gnu/libm.so.6: version `GLIBC_2.36' not found (required by ./libchartdir.so.7.0.0)
libchartdir.so.7.0.0: /lib/loongarch64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./libchartdir.so.7.0.0)
libchartdir.so.7.0.0: /lib/loongarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./libchartdir.so.7.0.0)
libstdc++.so.6 => /lib/loongarch64-linux-gnu/libstdc++.so.6 (0x00000000fff6f74000)
libm.so.6 => /lib/loongarch64-linux-gnu/libm.so.6 (0x00000000fff6eb4000)
libgcc_s.so.1 => /lib/loongarch64-linux-gnu/libgcc_s.so.1 (0x00000000fff6e58000)
libc.so.6 => /lib/loongarch64-linux-gnu/libc.so.6 (0x00000000fff6cd0000)
/lib/loongarch64-linux-gnu/ld-linux-so.1 (0x00000000fff7a9000) |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-05-2025 14:39 |
|
Hi choujayyl,
I think the problem is due to the Linux glibc version. Using older gcc or other compilers may not solve the problem if it is compiled on the same Linux. I need to have an older version of Linux that uses an older glibc.
Would you mind to inform me how to download your Linux version? All the Loongarch64 Deepin Linux I can find are quite new.
So far I cannot download the cross compiler from https://www.loongnix.cn/zh/toolchain/GNU/. May be it is because I am outside of mainland China. The download is very slow (around 1KB/s), and after sometime it will fail. Even if I can download the cross compiler, I still need to download your Linux version so I can if the shared object works.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-10-2025 09:21 |
|
Hi Peter Kwan.
How's the situation progressing? Can I provide the link for use? |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-10-2025 19:00 |
|
Hi choujayyl,
Unluckily, we are unable to create a QEMU machine that can boot UOS. If you know how to boot UOS using QEMU, please inform me.
From online information, the incompatibility is due to the "old world loongson" vs the "new world loongson". See:
https://areweloongyet.com/docs/old-and-new-worlds/
https://bbs.loongarch.org/d/89
The two types of loongson are not compatible. Even the CPU instructions are not the same. The "old world" development tools are based on gcc 8, while the "new world" are based on gcc 12.
It is expected recent or future loongson CPU will be of the "new world" type.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-17-2025 09:36 |
|
Hi Peter Kwan,
I've been quite busy in the past few weeks. I know it's not easy, but I hope you can look into it. It's very important to us. Next week, I'll also try to set up an environment to see if it works.
Thank you. |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-18-2025 02:29 |
|
Hi choujayyl,
Currently, we are only able to boot the loongarch64 using open source Linux OS, such as Debian or Deepin.
If there is a way we can boot the UOS on our Intel based machine, we will try to compile ChartDirector on UOS.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-18-2025 10:03 |
|
Hi Peter Kwan,
The system doesn't matter as long as it's Loongson architecture and relies on a low version of glibc, it can be used. |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-20-2025 00:21 |
|
Hi choujayyl,
For some reasons, I can download the Loongson cross compiler now. So I tried to built using the cross compiler, which is based on gcc 8. I do not have an "Old World" Loongson machine to test the code. As it is never tested, there is a high chance it will not work.
https://www.advsofteng.com/support/loongarch64_gcc8_libchartdir.so.7.0.0.zip
I did tried the code on a QEMU "New World" Loongson machine. It does not work. There are a lot of errors like:
/usr/bin/ld: ../../lib/libchartdir.so: undefined reference to `memset@GLIBC_2.27
This suggests "New World" Loongson machine does not support old gcc8 GLIBC, while "Old World" Loongson machine does not support new gcc12 GLIBC.
Best Regards
Peter Kwan |
Re: Can ChartDirector support Loongson architecture? |
| Posted by choujayyl on Nov-20-2025 09:34 |
|
Hi Peter Kwan
I have tested it on our Loongson architecture UOS system and it works fine. If this is a stable version, we can use it normally. Thank you for your long-term support. We will continue to use ChartDirector. |
Re: Can ChartDirector support Loongson architecture? |
| Posted by Peter Kwan on Nov-22-2025 00:29 |
|
Hi choujayyl,
The Loongson version is compiled using the same code as our Intel/ARM stable versions. However, note that we do not have a Loongson machine so we are unable to test it. .
I am thinking, if you can set up a physical or virtual Loongson machine that we are able to remotely access using ssh (secure shell), then we can use it to test the Loongson version.
Best Regards
Peter Kwan |
|