How to run Rebol script on Linux 64-bit - linux

I can not run this sample Rebol script
REBOL []
alert
"Hello World"
on Debian 10 Linux 64-bit OS.
The script is from the official Rebol tutorial.
I'm trying to run it using this command from console:
$ rebol hi
but it fails with error message
Script: "Untitled" (none)
** Script Error: alert has no value
** Near: alert "Hello World"
I use the latest available build for Linux x86-64 from the official Rebol site.
REBOL/Core 2.7.8.4.10 (23-Jan-2016)
Copyright 2016 REBOL Technologies
How to run the script?
Does Rebol support GUI on Linux?
I've found in the documentation Rebol runs on all mainstream platforms:
REBOL is cross-platform.
A program written on Windows runs equally well on Linux, BSD, OS X, and many other platforms... with no changes necessary.
Source: http://www.rebol.com/what-rebol.html
But I tried this script and also an Bookmarks example with layout dialect and they both fail with has no value error.
I also tried to add .r extension to the script but it seems it doesn't matter.

The problem is that Rebol has two versions: core and
view. And core version does not has graphics support. But view version does not support 64-bit Linux directly now. No 64-bit build exists, but there's 32-bit build.
To run an alert example using 32-bit build of Rebol View one may need to install required 32-bit libraries (and if I remember correctly first somehow enable 32-bit arch support on 64-bit linux):
On my Debian 10 machine I needed libx11.so.6 and some other X11 related libs:
$ sudo apt install libx11-6:i386 libxext6:i386 libxt6:i386 libxaw7:i386 libfreetype6:i386
Now the script can be run by command such as:
$ rebol hi.r

Related

is it possible to cross-compile from x86(x64) windows to x86(x64) linux?

I have been wonder about why x86(windows) to arm(linux) cross compile is possible but x86(windows) to x86(linux) cross compile is impossible or difficult only can use cygwin
As below link there is some cross-compiler for windows to arm from personal pc(x86), but there is no cross-compiler x86 to x86.
http://gnutoolchains.com/beaglebone/
why window(x86) to Debian(ARM) is available without cygwin , but window to Debian(x86) is difficult or must use cygwin?
Is this issue caused by POSIX size problem? The library size of Debian in ARM is little bit smaller than x86 ones?
I confuse....
I want to anyone clear to me.
Thank you for reading.
I installed WSL and then Debian as an Windows-App
directly under my Windows10 Home Edition.
Now I can open a Linux command prompt in every directory I want.
Installed g++ with apt-get (changed to root with "sudo su").
Using Mingw64 command prompt from the Git-Bash I can even use the same shell script
to compile console apps as Linux and Windows executables!

How can I run the program written in Ada?

I'm using Windows 10 (64-bit), I have downloaded GNAT GPL 2017, ARM ELF format (hosted on Windows) from http://libre.adacore.com/download/configurations#.
I have created a sample code:
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line("Hello from GPS!");
end Hello;
When I build my file everything is fine and it succeed. The problem is, that when I run my program, then get an error:
Error while trying to execute C:\Users\sigger\Desktop\ada\hello: not an executable
When I change property of my project:
Project -> Properties -> Sources -> Main -> Executable names
on hello.exe, then I get an error, that my program can't run on Windows 64-bit.
How can I create an exe file from my ada code on Windows 10?
"ARM ELF" is your problem. If you're trying to run an ARM executable on a Windows x86-64 bit platform, you will not succeed. You need a Windows x86-64 (or Windows x86-32) compiler.
What you downloaded was a "cross-compiler" - runs on one platform (Windows 64), but builds binaries for a different platform (ARM).
On the site you went to, try the "x86 Windows (32-bit)" compiler.

what are the alternatives for running a Mach-O 64-bit binary file on a linux machine?

step 1:
am running on a 64 bit linux machine.
(command): uname -a
(result): Linux ****** 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux.
step 2:
i checked the file type of the "binary file" i want to run.
(command): file keymaker
(result): keymaker: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
step 3:
i made the "mach-o" file executable by changing file permissions.
(command): chmod +x keymaker
step 4:
i run the "binary file".
(command): ./keymaker
(result): bash: ./keymaker: cannot execute binary file: Exec format error
step 5:
When i searched on stack overflow for a similar problem i found one but it said that:
(Answer): There is currently no working Mach-O loader for Linux.
(Reference): Can I run a binary file that is Mach-O executable i386 on linux?
step 6: i have a "linux version" of an application installed on my linux machine, but i need to run this "keymaker file" to provide me with a "license key".
And i don't want to install a full (4GB +) MAC OS operating system probably in a virtual machine just to run a simple binary file.
I understand this is a MAC OS file but my theory was that since we can use the "wine application" for Windows OS applications on linux, there must be alternatives as well for MAC OS needs.
The answer referenced in your question is from 2010. Unfortunately, it seems that it is still of actuality.
The link you gave in comment is a little more interesting because it links to the Darling project that declares
Darling is a translation layer that allows you to run unmodified macOS binaries on Linux. In its nature, it is similar to the well-known Wine project.
Wow exactly what you asked! But it looks to still be in early stages and not aimed at end users:
At this point, does not yet run macOS application with a GUI.
TL/DR: you should try the Darling project. Whether it is able to start your program is far from sure, but it seems to be your best bet, mainly if your prog does not use a GUI.

How to compile FFProbe as stand-alone application? (Mac/Linux/Win)

I'm trying to compile FFMPEG (I'm actually only looking for FFProbe, which is included in the FFMPEG tools) as a standalone application for MacOS X, Linux and possibly Windows.
With standalone I mean that the libraries (x264, OpenJPEG, etc) are "embedded" into the executable so that I have to distribute only one executable for FFProbe - I apologize that I don't know the proper lingo for this (please let me know), I'm a newbie when it comes to this.
I have started by trying to do this under MacOS X, without any luck, but plan to do this for Linux and MacOS X as well.
I did see a few pre-compiled binaries that do this, and do not depend on extra libraries, but the versions I have found so far are either not the current version (1.x) or do not included the libraries in the executable (evermeet).
I followed several guides (for example: FFMpeg MacOSX Compilation Guide, reneVolution), with or without the use of Brew, but none of these show me how to embed the libraries in the executable.
I assume this is an option to be set for linking.
I'm not sure if it's appropriate to ask this question for Win, Mac and Linux at the same time - if it's not appropriate: I'd like to start with doing this for the Mac version.
My system runs MacOS X 10.9, XCode 5.0.2, with commandline tools and brew installed. I'm only looking for an Intel binary, so not a universal or PowerPC binary.
For Windows I can use either Windows 8.1 or XP, for Linux I currently use Ubuntu 12, all of which are virtual machines.
You need to install FFProbe with all the options, like in mac
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Cross-platform build under Windows targeting Linux using CMake

I am developing a software in C++ on windows 32-bit (using MSVC++), but since I want to be able to use my software on every platform, I have decided to use CMake as my build generator.
Therefore, I am still just a beginner in CMake. From the CMake tutorials, I understand that in order to cross compile codes, first a toolchain simulating the target platform should be installed on the host platform. Then using the appropriate target-platform C and C++ compilers provided by this toolchain, CMake would be able to generate makefiles etc.
Now, I want to build my code for Linux platform(GNU/Linux) on a Win32 platform. I tried doing the above procedure using CMake combined with Cygwin and using gcc and g++ as compilers. It built fine, created makefiles, and when I issued "make" in Cygwin terminal, the generated makefiles were "made". Now I have got an executable which I was hoping would run on Linux platform. But on Linux I get the error: bash cannot execute binary file.
Using command file executablename, I realized the executable which is made by the above procedure is of type PE32 which is only for Windows.
Now my question is: Is my understanding of cross-platform build procedure using cmake correct?Or should I just use another Linux toolchain under windows to get a Linux ELF executable? What toolchains come to your mind which would give me what I want?
Many thanks
Setareh
You will want to look here: cmake-toolchains(7) if you do cross compiling. However, I would suggest that you install a Linux VM like virtual box on your windows machine and build naively on Linux. It will compile much faster and you will not have to worry about cross compiling. You can mount the windows disk from the linux VM so you can share the same source tree. The linux VM will compile much faster than gcc running under windows.
Your understanding of CMake is correct... it will determine how to create the build system you request (or is default for the platform you are currently on) based on rules in your CMakeLists.txt file. However, this won't necessarily help you compile for linux on a windows machine if you don't have something installed that can target linux.
To compile targeting linux, you will need to use a linux compiler. The link posted by #stjin tells you how to install one on cygwin. Then, to set up your CMake build, do this in the terminal:
CC=gcc-linux CXX=g++-linux cmake . [options]
This will tell CMake to locate the special linux targeted compilers. Hopefuly, after compiling with these compilers you will be able to run on linux.

Resources