User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 5:50 pm

You want to do a .deb install if you have any plans creating additional extension modules. The AppImage version is a self contained image of ScriptBasic and needs no install.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 5:54 pm

Those install instructions work for ANY Linux platform not just the RPi.

I you have interests in ScriptBasic beyond the RPi, you should join the AllBasic.info forum. AIR has taken over as the lead developer and is a very bright guy.
Last edited by ScriptBasic on Sun Jun 16, 2019 5:58 pm, edited 1 time in total.

jahboater
Posts: 4437
Joined: Wed Feb 04, 2015 6:38 pm

Re: ScriptBasic

Sun Jun 16, 2019 5:58 pm

Heater wrote:
Sun Jun 16, 2019 5:09 pm
I normally install .deb files with dpkg -i

A install that works from the gitlab repo and does not require root privs is what we need.
You will always need root privs to install things on Linux?

I hope so anyway.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 5:59 pm

Are we celebrating yet?

Andyroo
Posts: 3311
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: ScriptBasic

Sun Jun 16, 2019 6:00 pm

jahboater wrote:
Sun Jun 16, 2019 5:58 pm
...
You will always need root privs to install things on Linux?

I hope so anyway.
Nope and thats a problem :lol:

Python modules are the absolute worst in my mind - some need SUDO some do not and some need loading in the editor / virtual environment :roll: :evil:
Need Pi spray - these things are breeding in my house...

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 6:03 pm

Andyroo wrote:
Sun Jun 16, 2019 6:00 pm
jahboater wrote:
Sun Jun 16, 2019 5:58 pm
...
You will always need root privs to install things on Linux?

I hope so anyway.
Nope and thats a problem :lol:

Python modules are the absolute worst in my mind - some need SUDO some do not and some need loading in the editor / virtual environment :roll: :evil:
Every language has its own personality and quirks.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 6:12 pm

This is a non-invasive way to build and run ScriptBasic without doing the tradition .deb install.
[email protected] Forum wrote: Try the "mkdist.sh" file, passing it the path to place SB in.

Code: Select all

 ./mkdist ~/sb
Then you have the option of configuring SB (adding the bin folder to your path, and setting up the conf file) or you can do what I do, and use the sb.sh script located in the destination folder.


You can either source the sb.sh file and have everything set for that terminal session, OR run the sb.sh file (from within the DESTINATION sb folder itself) passing it the script to run.

I've updated the repo. A "git pull" will bring down the updated files.


AIR.
@Heater,

Can you post the procedure for building Python from source? I hope to learn from this distro accepted procedure.
Last edited by ScriptBasic on Sun Jun 16, 2019 7:03 pm, edited 3 times in total.

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 6:20 pm

ScriptBasic,
You want to do a .deb install if you have any plans creating additional extension modules.
I have no such plans.

Even if I did I see no reason why a .deb would be required.
Those install instructions work for ANY Linux platform not just the RPi.
No they don't. They start with a link to a deb for ARM.

Where is the amd64 package?
I you have interests in ScriptBasic beyond the RPi,...
I don't.

However I do want to install on my PC so as to try your fibo solution. When all goes well I will add your fibo to the challenge repository and find a Pi to check it out on.
You will always need root privs to install things on Linux?

I hope so anyway.
No you don't.

I have a lot of compilers, interpreters and other tools and programs installed on this machine that never go near any privileged directories. Node.js, clang/LLVM, GCC, Scala, Verilog, most of the languages in the challenge repository, etc, ect.

I am very happy that such things do not embed themselves in the bowels of my operating system.
Are we celebrating yet?
No. The booze ran out and everyone is going home.

We are far away from a works out of the box experience.

jahboater
Posts: 4437
Joined: Wed Feb 04, 2015 6:38 pm

Re: ScriptBasic

Sun Jun 16, 2019 6:24 pm

Heater wrote:
Sun Jun 16, 2019 6:20 pm
You will always need root privs to install things on Linux?

I hope so anyway.
No you don't.

I have a lot of compilers, interpreters and other tools and programs installed on this machine that never go near any privileged directories. Node.js, clang/LLVM, GCC, Scala, Verilog, most of the languages in the challenge repository, etc, ect.
OK better worded ...
You will always need root privs to install things in public directories on Linux.
So that they are available to any user.

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 6:58 pm

ScriptBasic,

OK. Now I can so this:

Code: Select all

$ pwd
/mnt/c/Users/michael/Documents/fibo_4784969/BASIC/scriptbasic
$ ls
fibo.sb  sb  sb-dev-cleanup  sb-dev-cleanup.zip
$ ls sb
bin  include  lib  module
$ scriba -D
dll ".so"
module "/mnt/c/Users/heater/Documents/fibo_4784969/BASIC/scriptbasic/sb-dev-cleanup/module/"
include "/mnt/c/Users/heater/Documents/fibo_4784969/BASIC/scriptbasic/sb-dev-cleanup/include/"
maxstep 0
maxlocalstep 0
maxlevel 29666
maxmem 0
$ scriba fibo.sb
fibo.sb(1): error &H3e:Include file is not found
$
Which is back where I was this morning...

Now, what is that conf file called, what do I put in it, and where do I put it???

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 7:08 pm

Do a find ~/ -name gmp2.so and the same for gmp2.bas. They should be in the directories scriba -D says the paths are.

Try running your fibo.sb script with the -d (module debug) option.

scriba -d fibo.sb
Last edited by ScriptBasic on Sun Jun 16, 2019 7:11 pm, edited 1 time in total.

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 7:10 pm

Already done that. I know where gmp things are.

Now, what is that conf file called, what do I put in it, and where do I put it???

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 7:13 pm

The basic.conf file is created dynamically with the method you're using. There is nothing to add to the basic.config file and you should be set to go.

Try sb fibo.sb instead of scriba fibo.sb per AIR's instructions.

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 7:19 pm

Code: Select all

$ sb fibo.sb
-bash: sb: command not found
$ find -name "sb"
./sb
There is no sb command here.

I do have a "./sb-dev-cleanup/sb.sh" but:

Code: Select all

$ ./sb-dev-cleanup/sb.sh fibo.sb
fibo.sb(1): error &H3e:Include file is not found

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 7:24 pm

In the 'home' directory where you said install the SB distribution, there should be a shell Script called sb.sh. Try this command and you can go back to using scriba.

$ source. /sb.sh

cd to where your fibo.sb Script is and run the following.

$ scriba fibo.sb

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 7:33 pm

Nope:

Code: Select all

$ pwd
/mnt/c/Users/heater/Documents/fibo_4784969/BASIC/scriptbasic
$ ls
fibo.sb  sb  sb-dev-cleanup  sb-dev-cleanup.zip
$ cd sb-dev-cleanup
$ source sb.sh
$ cd ..
$ scriba fibo.sb
fibo.sb(1): error &H3e:Include file is not found
$

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 7:37 pm

NO!

You need to run the mkdist.sh script as AIR instructed and then follow my instructions.

You're not going to run anything if doing it from your SB build directory.

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 7:46 pm

ScriptBasic,

I already did the mkdist thing ages ago.

That is why I have everything installed into an "sb" directory, not the download/build directory.

BUT, that sb command is actually sb.sh and it does not get installed to the installed target directory as it should.

What you have to do is:

1) Copy that sb.sh file from the build directory to the place where ScriptBasic was installed to (Why didn't mkdist do that as it should?)
2) Then change to the install directory and source it (Why can't it be sourced from some other directory like one would expect?)
3) Then change to the directory where ones basic is.
4) Then run it.

Like so:

Code: Select all

$ cp sb-dev-cleanup/sb.sh sb/
$ cd sb
$ source sb.sh
$ cd ..
$ scriba fibo.sb
$ scriba fibo.sb |head -c 32
10727395641800477229364813596225
$
Now why didn't you say that days ago?

I'll play with this.

When the gmp module is part of a proper release (As in the "master" branch of the repo) and works out of the box we can put it in the challenge repo.

Oh, some useful documentation in the repo would be very helpful.
Last edited by Heater on Sun Jun 16, 2019 8:14 pm, edited 1 time in total.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 8:03 pm

The cleanup repo is the new MASTER. AIR is still cleaning up things before he makes it the master which will then go to Gitlab's open source repository hosting service. (out of the sandbox)

Congrats getting SB running on your box.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 8:09 pm

Oh, some useful documentation in the repo would be very helpful.
As you know, developers make the worse documentation creators. They assume too much. I would be honored if you were to create a build and install guide others would understand.

BTW: How fast is AIR's fibo script on your PC?

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 8:22 pm

That is AIR's script I guess. It does not look anything like the fibo we were discussing.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 8:28 pm

We went from 1 min 9 sec with your recursive hfibo.sb to 5 sec with AIR's.

The hfibo.sb I did was using my version of the GMP extension module. It should be rather easy to convert it to AIR's GMP2 extension module

Airr
Posts: 19
Joined: Sun Jun 16, 2019 5:17 pm

Re: ScriptBasic

Sun Jun 16, 2019 9:14 pm

Heater wrote:
Sun Jun 16, 2019 7:46 pm
ScriptBasic,

I already did the mkdist thing ages ago.

That is why I have everything installed into an "sb" directory, not the download/build directory.

BUT, that sb command is actually sb.sh and it does not get installed to the installed target directory as it should.

What you have to do is:

1) Copy that sb.sh file from the build directory to the place where ScriptBasic was installed to (Why didn't mkdist do that as it should?)
2) Then change to the install directory and source it (Why can't it be sourced from some other directory like one would expect?)
3) Then change to the directory where ones basic is.
4) Then run it.

Like so:

Code: Select all

$ cp sb-dev-cleanup/sb.sh sb/
$ cd sb
$ source sb.sh
$ cd ..
$ scriba fibo.sb
$ scriba fibo.sb |head -c 32
10727395641800477229364813596225
$
Now why didn't you say that days ago?

I'll play with this.

When the gmp module is part of a proper release (As in the "master" branch of the repo) and works out of the box we can put it in the challenge repo.

Oh, some useful documentation in the repo would be very helpful.
The mkdist.sh file will copy over the sb.sh file, IF you have the latest version from the repo. My post on allbasic concludes by saying do a "git pull" to get the updated files, which includes an updated sb.sh file.

You should be able to source the sb.sh file from anywhere in the file system. It works on my Linux server, my Mac systems, my RPI, and a VPS runnning Linux.

AIR.

User avatar
ScriptBasic
Posts: 1239
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: ScriptBasic

Sun Jun 16, 2019 10:07 pm

Welcome to the RPi forum AIR!

Heater
Posts: 12649
Joined: Tue Jul 17, 2012 3:02 pm

Re: ScriptBasic

Sun Jun 16, 2019 10:27 pm

Airr,

Welcome to the forum. Great job on the ScriptBasic GMP extesion.

What is that fibo algorithm you wrote? Is that the matrix formulation?
The mkdist.sh file will copy over the sb.sh file, IF you have the latest version from the repo. My post on allbasic concludes by saying do a "git pull" to get the updated files, which includes an updated sb.sh file.
Sadly that is not the case here.

I am in the habit of doing "git pull" before I start building things. When I do that here it says "Already up to date". But still mkinst does not copy the sb.sh file. Like so:

Code: Select all

$ pwd
/mnt/c/Users/heater/Documents/fibo_4784969/BASIC/scriptbasic/sb-dev-cleanup
$ git pull
Already up-to-date.
$ cd ..
$ ls
fibo.sb  sb-dev-cleanup  sb-dev-cleanup.zip
$ cd sb-dev-cleanup
$ mkdir ../sb
$ ./mkdist.sh ../sb
$ cd ../sb
$ ls
bin  include  lib  module
$ find -name "sb.sh"
$
You should be able to source the sb.sh file from anywhere in the file system. It works on my Linux server, my Mac systems, my RPI, and a VPS running Linux.
Sadly that is also not the case. Not here on my Debian Stretch PC at least. Like so:

Code: Select all

$ scriba
-bash: scriba: command not found
$ source sb/sb.sh
-bash: sb/sb.sh: No such file or directory
$ cp sb-dev-cleanup/sb.sh sb/
$ source sb/sb.sh
$ scriba
-bash: scriba: command not found
$ cd sb
$ source ./sb.sh
$ cd ..
$ scriba
Usage: basic [options] program.bas
...
$

Return to “Other programming languages”