Page 2 of 2
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 9:43 am
by Saki
Look, the event handling under Windows is different than under Mac and Linux.
There are codes that give you output on Windows, but no output on Linux and Mac, or it hangs, or is incomplete.
This is not a bug of PB.
You don't ask for a feature, you ask for things that don't work, since the OS internally work differently !
Another thing, for example.
Linux has gtk3, which technically can never be absolutely compatible with Mac or Windows, because it works completely different.
Now comes gtk4, which makes the gap even wider.
That's why there is now qt for PB, but that's not a solution for the future either.
The OS will become further and further apart:
And then try marrying a fox to a duck
Best regards Saki
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 10:42 am
by the.weavster
Saki wrote:Look, the event handling under Windows is different than under Mac and Linux.
There are codes that give you output on Windows, but no output on Linux and Mac, or it hangs, or is incomplete.
This is not a bug of PB.
You don't ask for a feature, you ask for things that don't work, since the OS internally work differently !
Another thing, for example.
Linux has gtk3, which technically can never be absolutely compatible with Mac or Windows, because it works completely different.
Now comes gtk4, which makes the gap even wider.
That's why there is now qt for PB, but that's not a solution for the future either.
The OS will become further and further apart:
And then try marrying a fox to a duck
Best regards Saki
I'm asking to be able to cross-compile not for Linux executables to magically run on Windows.
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 11:09 am
by Saki
But that doesn't make sense if you can't test the codes on every OS.
And there is no difference between testing and compiling.
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 11:19 am
by deeproot
the.weavster wrote:Oh, OK then... perhaps Fred should just shut down the Feature Requests and Wishlists section of the forum <eye-roll>
I don't see anything wrong with making a Request, including this one. Some things may be easy, other things not possible. At the very least requests bring an awareness and discussion of peoples wishes and needs. Even if a request is never fulfilled, other good things may spin out of it. Only my opinion!
Personally I'm already happy with the results from working on three platforms, but always there could be scope for further improvements.
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 11:42 am
by the.weavster
Saki wrote:But that doesn't make sense if you can't test the codes on every OS.
And there is no difference between testing and compiling.
Actually it's what you thought I meant that didn't make any sense - why would I want to run a Linux executable on Windows when I could just compile a Windows executable?
Cross-compiling is a perfectly reasonable request and it's not something novel or extraordinary.
@Tenaja gave a very clear explanation of why Fred might see it as too burdensome and I appreciate the point.
Re: Kompilieren für eine Plattform von einer anderen
Posted: Tue Jun 23, 2020 12:01 pm
by Saki
There are licensing problems and it is not possible for technical reasons.
There is nothing more to say about this.
Best Regards Saki
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 2:15 pm
by Tenaja
the.weavster wrote:Tenaja wrote:Technically, it's possible. It seems he finds the maintenance overwhelming, which is understandable. He'd have to port the generation libraries to every platform, do there'd be nine instead of three... And if you add the recently promised arm output, it will be sixteen instead of four. Or, cumbersome #CompilerIfPlatform=TheRightOne statements.
Thanks for the perspective.
mk-soft wrote:We should be happy with what we have with Purebasic.
Oh, OK then... perhaps Fred should just shut down the
Feature Requests and Wishlists section of the forum <eye-roll>
You are not the first to request this, and also not the first to get it denied--and probably also not the last. Just because this one request is not honored is no reason to Throw the Baby Out With the Bathwater.
My guess is mk-soft is referring to the fact that we have the best and most long-standing cross-platform compiler, and we are blessed that most code compiles on all three platforms with very few edits. With a fourth on the horizon, Fred is undertaking his largest project yet (probably even larger than Spider Basic), and he's unlikely to stop and make a change that won't improve the code output
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 7:51 pm
by mk-soft
If you want an application to run on all OS, you need a common framework, which also runs on all OS. (Just like JAVA runtime environment).
But for the application to run, the huge framework must first be installed.
I think we don't want that either.
There is a project somewhere, where a Windows version is compiled under Linux. But for this you have to install the runtime environment for Windows (Wine). With macOS it won't work that way, because there is no such thing.
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 8:04 pm
by Saki
However, Wine must then also be 100% compatible.
It simply doesn't make sense, then you can compile on Wine,
because you have to check if the code of both OS are working properly anyway.
Re: Compile for one platform from another
Posted: Tue Jun 23, 2020 9:16 pm
by Tenaja
Saki wrote:However, Wine must then also be 100% compatible.
It simply doesn't make sense, then you can compile on Wine,
because you have to check if the code of both OS are working properly anyway.
Has anybody tried their wsl for pb?
Re: Compile for one platform from another
Posted: Wed Jun 24, 2020 10:21 am
by the.weavster
mk-soft wrote:But for this you have to install the runtime environment for Windows (Wine). With macOS it won't work that way, because there is no such thing.
WineHQ wrote:Wine (originally an acronym for "Wine Is Not an Emulator") is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, macOS, & BSD..
https://www.winehq.org/
* edit *
If you have an Android smartphone with an intel processor you can use the Wine app to run windows programs on that too:
https://dl.winehq.org/wine-builds/android/
Re: Compile for one platform from another
Posted: Wed Jun 24, 2020 10:58 am
by Marc56us
Tenaja wrote:Has anybody tried their wsl for pb?
Yes
Code: Select all
C:\>wsl
$:/mnt/c$
$:/mnt/c$ uname -a
Linux HPM 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 GNU/Linux
$:/mnt/c$ cd /tmp
$:/tmp$
$:/tmp$ curl -O https://www.purebasic.com/download/purebasic-demo_x64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 37.0M 100 37.0M 0 0 5615k 0 0:00:06 0:00:06 --:--:-- 8970k
$:/tmp$ ls -l
total 38016
-rw-rw-rw- 1 marc marc 38875885 Jun 24 11:32 purebasic-demo_x64.tar.gz
$:/tmp$ tar xvzf purebasic-demo_x64.tar.gz
purebasic_demo/
purebasic_demo/README
purebasic_demo/launch.sh
...
$:/tmp$ cd cd purebasic_demo/compilers/
$:/tmp/purebasic_demo/compilers$ ./pbcompiler
PureBasic 5.72 (Linux - x64) Free - (c) 2020 Fantaisie Software
A filename must be specified.
pbcompiler -h for help.
$:/tmp$ vi Hello.pb
PrintN("Hello World in WSL")
<Esc>:wq
$:/tmp/purebasic_demo/compilers$ ./pbcompiler Hello.pb
******************************************
PureBasic 5.72 (Linux - x64) Free
******************************************
Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.
pfff...
But I think it should work (at least for console applications) if you make some adjustments.
