Unofficial FreeBASIC 1.04.0 OS X release

General discussion for topics related to the FreeBASIC project or its community.
venom
Posts: 16
Joined: Apr 03, 2015 20:55
Location: Germany

Unofficial FreeBASIC 1.04.0 OS X release

Post by venom »

Hi,
I just built FreeBASIC 1.04.0 for OS X and thought that some of you might be interested in this. You can download it here (i don't know how long this link will stay valid, it would be cool if this could be uploaded to sourceforge where the other releases reside). Please note that for building and running graphical applications you will need XQuartz, and you probably also need to add "-asm att" when compiling with fbc.

I can't guarantee that it will run on your system (OS X support isn't very mature yet), but it did on mine and I was able to run graphical examples with it.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by D.J.Peters »

Spend me a mac and I will test it a night long ;-)

What a day in history of FreeBASIC
a MAC port and JavaScript HTML5 webGL backend on one day :-)

Joshy
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

first of all thank you for the Mac release of FB
I installed FB by running the install script, installed ok
fbc -version
FreeBASIC Compiler - Version 1.04.0 (10-12-2015), built for darwin-x86_64 (64bit)
Copyright (C) 2004-2015 The FreeBASIC development team.
but I had to hunt down crt1.o which was nowhere on my system, also had a problem with the type FILE which I found defined in inc\crt\dos\stdio.bi if I remember right, after that things started to work.
but it took several seconds for the fb graphics screen to show up

but get some warnings
fbc -w all -asm att hello.bas
clang: warning: optimization flag '-frounding-math' is not supported
clang: warning: argument unused during compilation: '-frounding-math'
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
1 warning generated.
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /usr/local/bin/../lib/freebasic/darwin-x86_64/fbextra.x, file was built for unsupported file format ( 0x2F 0x2A 0x20 0x54 0x68 0x69 0x73 0x20 0x6C 0x69 0x6E 0x6B 0x65 0x72 0x20 0x73 ) which is not the architecture being linked (x86_64): /usr/local/bin/../lib/freebasic/darwin-x86_64/fbextra.x
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

got geany working, for some reason it refused to open a basic file but after making a new file and saving it, it works.
of course I had to adjust the compiler command, other than the afore mentioned warnings everything seems to work
except console programs don't respond the the numeric pad.
venom
Posts: 16
Joined: Apr 03, 2015 20:55
Location: Germany

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by venom »

D.J.Peters wrote:What a day in history of FreeBASIC
a MAC port and JavaScript HTML5 webGL backend on one day :-)
Well, actually the OS X work is already a few weeks old and was merged together with my patches for NetBSD, FreeBSD and Solaris (which should be usable also, but I was too lazy to assemble a build yet ;) ).
But that emscripten port really is pretty amazing ;)
srvaldez wrote:but it took several seconds for the fb graphics screen to show up
Yep, that's one of the disadvantages of using XQuartz: It has to start a full X.org server before anything can show up. But once it's running windows should appear faster.
I have been playing around with Cocoa a bit, but I'm still unsure whether I should try writing a Cocoa-backend or simply doing a SDL2-backend, which would probably be a good idea for other platforms. And, of course, finding the time is another problem ;)
srvaldez wrote:but get some warnings
Yeah, the OS X port still lacks some polish.
venom
Posts: 16
Joined: Apr 03, 2015 20:55
Location: Germany

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by venom »

D.J.Peters wrote:What a day in history of FreeBASIC
a MAC port and JavaScript HTML5 webGL backend on one day :-)
Well, actually the OS X work is already a few weeks old and was merged together with my patches for NetBSD, FreeBSD and Solaris (which should be usable also, but I was too lazy to assemble a build yet ;) ).
But that emscripten port really is pretty amazing ;)
srvaldez wrote:but it took several seconds for the fb graphics screen to show up
Yep, that's one of the disadvantages of using XQuartz: It has to start a full X.org server before anything can show up. But once it's running windows should appear faster.
I have been playing around with Cocoa a bit, but I'm still unsure whether I should try writing a Cocoa-backend or simply doing a SDL2-backend, which would probably be a good idea for other platforms. And, of course, finding the time is another problem ;)
srvaldez wrote:but get some warnings
Yeah, the OS X port still lacks some polish.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

thanks for checking in and answering our concerns. :)
I would love to know the details of the process you went thorough to get this fb port working, give us the details in failures as well as the details in the success.
hope you keep up this project. :)
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

hello D.J.Peters
your C64 emulator compiles and works ok
the reason that programs using graphics take some seconds to appear on the screen is that they use X11
if X11 is not running, then X11 is first launched, but afterwards the program appearing on screen is instantaneous
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

hello venom
could you tell me the steps required to compile fb in os x?
considering that I will be using fb that you compiled
I have the latest os on my mac, but when running make I get the following error
src/compiler/obj/ast-gosub.c:1:0: error: -masm=intel not supported in this configuration
when I try compiling the rtlib I get the following error
make rtlib
CC src/rtlib/obj/darwin-x86_64/thread_call.o
src/rtlib/thread_call.c:33:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^
1 error generated.
make: *** [src/rtlib/obj/darwin-x86_64/thread_call.o] Error 1
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
booting into os x Yosemite and executing make rtlib works, but fail to compile fb

I probably need to re-install command line tools
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by St_W »

venom wrote:I just built FreeBASIC 1.04.0 for OS X and thought that some of you might be interested in this. [...] it would be cool if this could be uploaded to sourceforge where the other releases reside[...]
Maybe you know that FBC and its components use (L)GPL licenses? Personally I would consider it a NO-GO to publish a binary package on Sourceforge without the according source-code (if differing from the 1.04 one) and/or Makefiles/Tools (if needed). (but of course that's something dkl/counting_pine/... have to decide)
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

I think my system is missing some required libraries, but what I don't understand is the "error: -masm=intel not supported in this configuration"
the only thing I can think of other than the obvious missing lib is that the makefile may need tweaking which I have no idea how to do
venom
Posts: 16
Joined: Apr 03, 2015 20:55
Location: Germany

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by venom »

St_W wrote:Maybe you know that FBC and its components use (L)GPL licenses?
Yes.
St_W wrote:Personally I would consider it a NO-GO to publish a binary package on Sourceforge without the according source-code (if differing from the 1.04 one) and/or Makefiles/Tools (if needed). (but of course that's something dkl/counting_pine/... have to decide)
The code is the exact same as all other 1.04.0 releases. All my patches to make this work were merged by dkl before the release.
srvaldez wrote:I think my system is missing some required libraries, but what I don't understand is the "error: -masm=intel not supported in this configuration"
the only thing I can think of other than the obvious missing lib is that the makefile may need tweaking which I have no idea how to do
That's the reason why "-asm att" is needed. By default, fbc uses the Intel syntax for assembly, which isn't supported on the OS X toolchain. You should be able to build everything with this (should be correct, but I can't try it right now):
make FBFLAGS="-asm att" ENABLE_XQUARTZ=1 all
srvaldez wrote:when I try compiling the rtlib I get the following error
make rtlib
CC src/rtlib/obj/darwin-x86_64/thread_call.o
src/rtlib/thread_call.c:33:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^
1 error generated.
make: *** [src/rtlib/obj/darwin-x86_64/thread_call.o] Error 1
You need to have libffi installed to build the rtlib.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

thank you venom :)
btw, why the nickname venom = poison?
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by srvaldez »

hello venom and dkl
I finally Managed to compile fb on my mac, there were some warnings but it's working, except now I get a bunch
of ld warnings like following
ld: warning: option -s is obsolete and being ignored
ld: warning: -macosx_version_min not specified, assuming 10.10
ld: warning: object file (/usr/local/bin/../lib/freebasic/darwin-x86_64/fbrt0.o) was built for newer OSX version (10.11) than being linked (10.10)
..... more warnings
Compilation finished successfully.
any advice on how to fix this?
venom
Posts: 16
Joined: Apr 03, 2015 20:55
Location: Germany

Re: Unofficial FreeBASIC 1.04.0 OS X release

Post by venom »

srvaldez wrote:thank you venom :)
btw, why the nickname venom = poison?
See here
srvaldez wrote:any advice on how to fix this?
They're not critical, so you can basically ignore them until I find the time for the next round of patches ;)
Post Reply