Author Topic: Scriptbasic Build Linux  (Read 5734 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #150 on: January 12, 2019, 11:30:21 AM »
False Alarm

Code: Script BASIC
  1. numhex =  0x1D4A9EBC4E94E60
  2. PRINT numhex,"\n"
  3. PRINT HEX(numhex),"\n"
  4. PRINT FORMAT("%X",numhex),"\n"
  5. PRINT FORMAT("%0.17f", 0.131917119186620000),"\n"
  6.  


$ scriba phex.sb
131917119186620000
       C4E94E60
1D4A9EBC4E94E60
0.13191711918662005
$



Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #151 on: January 12, 2019, 12:36:51 PM »
I would like to create a SB test suite that validates the complete core syntax. This would be an ongoing project that would benefit all SB platform maintainers.

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #152 on: January 15, 2019, 07:11:01 PM »
Remove the 'l'.  The macros don't process all of the valid printf/sprintf format identifiers correctly.

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #153 on: January 15, 2019, 07:41:14 PM »
My problem was trying to run ./setup with an existing bin directory. It seems to work now with the fix you suggested.

Code: C
  1. sprintf(STRINGVALUE(RESULT),"%lX",lStore);
  2.  

Code: Script BASIC
  1. numhex = 0x1D4A9EBC4E94E60
  2. PRINT numhex,"\n"
  3. PRINT HEX(numhex),"\n"
  4.  


$ scriba phex.sb
131917119186620000
1D4A9EBC4E94E60
$


Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #154 on: January 15, 2019, 09:58:12 PM »
Maintaining the Linux distribution of Script BASIC is more dynamic then it seems. The desktop side is only a small portion compared to the web scripting aspect. Trying to take on Windows as well is more than I have time for.
« Last Edit: January 15, 2019, 10:00:03 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #155 on: January 15, 2019, 10:44:33 PM »
Maintaining the Linux distribution of Script BASIC is more dynamic then it seems. The desktop side is only a small portion compared to the web scripting aspect. Trying to take on Windows as well is more than I have time for.

What you really need to do, in my opinion, is put up full working apps showing why SB could be an option when deciding how to approach a given problem domain.

You used to do that on the SB forum; take some of those and put them in a centralized location, for starters.  At the very least, create a sticky post with links to each one with a brief blurb.


Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #156 on: January 15, 2019, 10:48:31 PM »
I would rather invest my time getting SB into a major Linux distribution by years end.

SB on Windows needs some love from someone that still believes in the platform.

« Last Edit: January 16, 2019, 12:37:56 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #157 on: January 20, 2019, 09:51:56 PM »
AIR,

I'm trying to get SBT working on my Ubuntu 18.10. I use to work on 14 & 16 if I remember correctly. It compiles without error but if I call a function and return something I get a seg fault. Can you give this a try on your end? Please ignore the UXLIBS: entry. I was going to try and use Peter's build system using the cURL ext. mod. as a ref.

Here is the makefile I didn't include in the zip.
Code: Bash
  1.  
  2.  
  3.  
  4. all : /home/jrs/sb/source/bin/mod/lib/sbt.a /home/jrs/sb/source/bin/mod/dll/sbt.so
  5.  
  6.  
  7.  
  8.  
  9. /home/jrs/sb/source/bin/mod/lib/sbt.a : /home/jrs/sb/source/bin/mod/obj/sbt/s_interface.o
  10.         ar -r /home/jrs/sb/source/bin/mod/lib/sbt.a /home/jrs/sb/source/bin/mod/obj/sbt/s_interface.o  
  11.  
  12. /home/jrs/sb/source/bin/mod/dll/sbt.so : /home/jrs/sb/source/bin/mod/obj/sbt/interface.o
  13.         ld -shared -fPIC -o /home/jrs/sb/source/bin/mod/dll/sbt.so /home/jrs/sb/source/bin/mod/obj/sbt/interface.o -lscriba -lpthread -lm
  14.  
  15. /home/jrs/sb/source/bin/mod/obj/sbt/interface.o : interface.c
  16.         gcc -O2 -w -m64 -fPIC -c -o /home/jrs/sb/source/bin/mod/obj/sbt/interface.o interface.c
  17.  
  18. /home/jrs/sb/source/bin/mod/obj/sbt/s_interface.o : interface.c
  19.         gcc -O2 -w -m64 -fPIC -DSTATIC_LINK=1 -c -o /home/jrs/sb/source/bin/mod/obj/sbt/s_interface.o interface.c
  20.  
  21.  


Thanks

John


« Last Edit: January 20, 2019, 10:05:48 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #158 on: January 21, 2019, 10:35:06 AM »
$ scriba hellomain.sb
Hello Thread
1

$ lsb_release -a
No LSB modules are available.
Distributor ID:   Ubuntu
Description:   Ubuntu 18.04.1 LTS
Release:   18.04
Codename:   bionic


what is the output of:
ldd sbt.so

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #159 on: January 21, 2019, 10:56:33 AM »
That's great it is working for you. Does the other SBT examples I posted in the SBOCX thread work as well?


jrs@jrs-laptop:~/sb/sb64/module$ ldd sbt.so
   linux-vdso.so.1 (0x00007ffca3482000)
   PIC => not found
   libscriba.so => /usr/lib/x86_64-linux-gnu/libscriba.so (0x00007f2dd763c000)
   libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2dd761b000)
   libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2dd748e000)
   libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2dd72a4000)
   libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2dd729e000)
   /lib64/ld-linux-x86-64.so.2 (0x00007f2dd78ff000)
jrs@jrs-laptop:~/sb/sb64/module$


Could you post your sbt.so so I can try it here?

Thanks AIR for the help with this!


Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #160 on: January 21, 2019, 11:35:53 AM »



jrs@jrs-laptop:~/sb/sb64/module$ ldd sbt.so
   PIC => not found
jrs@jrs-laptop:~/sb/sb64/module$


This *may* be the problem.  -fPIC is usually passed when compiling object files, not the library itself.  'ld' doesn't know what to do with '-fPIC', because '-f' is used to set a filter for linkage.  So try removing the '-fPIC' from the 'ld' invocation.

'gcc' itself knows what to do with the '-fPIC' flag, but doesn't actually pass that on to the linker.

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #161 on: January 21, 2019, 12:00:28 PM »
No luck.  :-\


jrs@jrs-laptop:~/sb/examples/test$ scriba hellomain.sb
hellothread.sb(3): error &H77:syntax error during checking the line and also noting that the syntax error so serious that none of the other syntax defintions can match the current line
Segmentation fault (core dumped)
jrs@jrs-laptop:~/sb/examples/test$


Can you send/post your SBT.so for me to try?


Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #162 on: January 21, 2019, 12:09:47 PM »
Attached.

Make sure you're not mixing instances of SB again, since this has been an issue in the past....

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #163 on: January 21, 2019, 12:28:15 PM »
I still get the same error with you sbt.so.

ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859037488
Node size is 24
Extension interface version is 11
Compilation: Nov 30 2018 02:25:18

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #164 on: January 21, 2019, 12:39:03 PM »
I got it working going back to my original system install of SB and not using your sb64 directory version,

jrs@jrs-laptop:~/sb/examples/test$ scriba hellomain.sb
Hello Thread
1
jrs@jrs-laptop:~/sb/examples/test$

jrs@jrs-laptop:~/sb/examples/test$ scriba t_run.sb
ABC
ABCABC
ABC
jrs@jrs-laptop:~/sb/examples/test$
« Last Edit: January 21, 2019, 12:42:54 PM by John »