Author Topic: RaspberryBASIC.org Forum  (Read 99498 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #165 on: December 19, 2019, 10:13:56 AM »
I just read a thread on the RPi forum on how to make Rasbian run as a 64 bit OS. Seems to be having a lot of issues getting standard tools to run unlike the Ubuntu 64 solution.

Offline jalih

  • Advocate
  • Posts: 111
Re: RaspberryBASIC.org Forum
« Reply #166 on: December 19, 2019, 11:59:48 AM »
John, 64-bit 8th binary for string and array challenge is available here

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #167 on: December 19, 2019, 12:26:42 PM »
Can you post the source as well?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #168 on: December 19, 2019, 01:51:03 PM »
AIR,

I've hit the wall trying to get IUP compiled from source on Ubuntu 64 RPi 4B. This is a critical tool for both Nim and embedded ScriptBasic efforts.

From what I can tell from the errors I'm getting, IUP make is having a problem determining the Linux platform, endian class and glib version..it's like if fell through its selection tree and trying to compile half baked.

Quote from: AIR@RB
Interestingly, the arch is "aarch64".

Can you take a look?
« Last Edit: December 19, 2019, 02:23:15 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #169 on: December 19, 2019, 04:12:43 PM »
GO generating over a 2 meg executable seem excessive for a program this small.

8th still holds the crown at 8 megs.
« Last Edit: December 19, 2019, 04:35:12 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #170 on: December 19, 2019, 04:17:54 PM »
What I gained from these rounds of language comparisons is Nim, Swift and PHP is going to get a lot more of my attention.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #171 on: December 19, 2019, 05:40:12 PM »
GO generating over a 2 meg executable seem excessive for a program this small.

8th still holds the crown at 8 megs.

Both include their runtimes, etc in the final executable.

Statically linking the C submission:

Code: C
  1. gcc -static mil.c $(pkg-config --libs --cflags glib-2.0) -lpthread -o mil64_s

Results in a binary that is 2.3MB in size.

For GO, try this:

Code: Go
  1. go build -ldflags="-s -w" mil64.go

On my raspi, I get a binary that is 1.4MB in size.

AIR.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #172 on: December 19, 2019, 06:06:55 PM »
AIR,

I've hit the wall trying to get IUP compiled from source on Ubuntu 64 RPi 4B. This is a critical tool for both Nim and embedded ScriptBasic efforts.

From what I can tell from the errors I'm getting, IUP make is having a problem determining the Linux platform, endian class and glib version..it's like if fell through its selection tree and trying to compile half baked.

Quote from: AIR@RB
Interestingly, the arch is "aarch64".

Can you take a look?

Are you using 'tecmake' to regenerate the makefile?

tecmake functions essentially the same as "./configure" does.  If you look at the tecmake.mak file, you'll see:

Code: GNU make
  1.   ifneq ($(findstring aarch64, $(TEC_SYSARCH)), )
  2.     TEC_SYSARCH:=arm64
  3.   endif
  4.  

It will also set the proper endianness for you, but there is something you need to be aware of:
Code: GNU make
  1. ifeq ($(TEC_SYSARCH), arm64)
  2.       # Our dynamic library build is not working in arm64
  3.       NO_DYNAMIC ?= Yes
  4.       BUILD_64=Yes
  5.       TEC_UNAME:=$(TEC_UNAME)_arm64
  6. endif

Best guess is that only static libs will be built, if so your binaries will (ironically) be larger.

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #173 on: December 19, 2019, 06:19:09 PM »
This is what I get when I try to make tecmake.mak.


ubuntu@rpi4b:~/iup-dev/lua53/src$ make -f tecmake.mak

Tecmake: starting [ lua53:Linux53_arm64 ]
if [ ! -d ../obj/Linux53_arm64 ] ; then mkdir -p ../obj/Linux53_arm64 ; fi
if [ ! -d ../lib/Linux53_arm64 ] ; then mkdir -p ../lib/Linux53_arm64 ; fi

Tecmake: compiling lapi.c ...
gcc -c -std=gnu99 -Wall -O2 -m64 -fPIC     -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -DTEC_UNAME=Linux53_arm64 -DTEC_SYSNAME=Linux -DLinux=5.3 -DTEC_LITTLEENDIAN -DTEC_64 -DFUNCPROTO=15 -DNDEBUG -o ../obj/Linux53_arm64/lapi.o lapi.c
gcc: error: unrecognized command line option ‘-m64’
make: *** [tecmake.mak:1701: ../obj/Linux53_arm64/lapi.o] Error 1
ubuntu@rpi4b:~/iup-dev/lua53/src$


Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #174 on: December 19, 2019, 06:30:31 PM »
You need to use TECMAKE

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #175 on: December 19, 2019, 06:52:12 PM »
Can explain what you mean by use TECMAKE?

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #176 on: December 19, 2019, 06:52:49 PM »
Is it configured for your system as the docs at that link specify?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #177 on: December 19, 2019, 07:05:33 PM »
I downloaded the TECMAKE zip and tried to use it and I get an error saying -f is missing.  I have spent hours on this and getting nowhere,

Can you try to build it on your end and send me a zip of the binaries.

I had no problems compiling this on Rasbain 32.
« Last Edit: December 19, 2019, 07:13:10 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #178 on: December 19, 2019, 07:14:05 PM »
NO, I don't do gui on my pi's...

I think the first issue is at around line 624 in the .mak file:

Code: GNU make
  1.     ifeq ($(TEC_SYSARCH), ia64)
  2.       STDFLAGS += -fPIC
  3.       X11_LIB := /usr/X11R6/lib
  4.     else
  5.       STDFLAGS += -m64 -fPIC
  6.       X11_LIB := /usr/X11R6/lib64
  7.     endif
  8.   else
  9.     X11_LIB := /usr/X11R6/lib
  10.   endif
  11.   X11_INC := /usr/X11R6/include
  12.   MOTIFGL_LIB :=
  13.   ifdef USE_OPENMP
  14.     STDFLAGS += -fopenmp
  15.     LIBS += gomp
  16.   endif
  17. endif
  18.  

There is no check for 'arm64' in that block, so it defaults to setting STDFLAGS to "-m64 -fpic" in line '5' above.

You can either add/fix that yourself, or file a bug report.

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #179 on: December 19, 2019, 07:19:19 PM »
Removing the -m64 allowed me to compile Lua, IM. CD and IUP are still hosed. This is a major show stopper for me with Ubuntu 64 on the RPi.