ScriptBasic

ScriptBasic => Download => Topic started by: Support on April 08, 2011, 09:09:13 PM

Title: ScriptBasic 64 Bit Linux
Post by: Support on April 08, 2011, 09:09:13 PM
Armando and I were able to build a version of ScriptBasic for Ubuntu 10.10 64 bit.

This version of ScriptBasic includes the additional math functions Tom contributed.

This package will install ScriptBasic's dependencies if they are not present.

sudo gdebi scriba-v2.1.1_amd64.deb  -  Install

sudo apt-get remove scriba  -  Remove

Here is the ScriptBasic source directory I used to build the runtime and install .deb file.

scriba-v2.1.1-src_amd64.tar.z (http://files.allbasic.info/ScriptBasic/scriba-v2.1.1-src_amd64.tar.z)

ScriptBasic Online Documentation (http://www.scriptbasic.org/wiki)


ScriptBasic 64 is a powerful scripting language/API that is easy to use and takes less code to get the job done.

Large Numbers

Code: [Select]
a = 9000000000000000000 / 2
PRINT a,"\n"

$ scriba biglong.sb
4500000000000000000

New Math Functions

Code: [Select]
The following 8 functions accept radians as their argument, so we use the
new RAD() function to convert 34 degrees to 5.934119e-01 (0.593412) radians.

Tangent Cotangent Secant Cosecant
TAN()   COTAN()   SECANT()     COSECANT()
6.745085e-01 1.482561e+00 1.206218e+00 1.788292e+00
0.674509 1.482561 1.206218 1.788292

Arctangent Arccotangent Arcsecant Arccosecant
ATAN()     ACTAN()   ASECANT() ACOSECANT()
5.934119e-01 5.934119e-01 5.934119e-01 5.934119e-01
0.593412 0.593412 0.593412 0.593412

There are 6 Hyperbolic functions. They also accept radian arguments.

H-Sine H-Cosine H-Tangent
HSIN() HCOS()   HTAN()
6.288574e-01 1.181297e+00 5.323451e-01
0.628857 1.181297 0.532345

H-Secant H-Cosecant H-Cotangent
HSECANT() HCOSECANT() HCTAN()
8.465274e-01 1.590186e+00 1.878481e+00
0.846527 1.590186 1.878481


Large Strings

Code: [Select]
a = string(100000000," ") & "John" & string(100000000," ")
PRINT INSTR(a,"John"),"\n"

$ scriba biginstr.sb
100000001

Easy Database Access

sbdb:test
(http://files.allbasic.info/ScriptBasic/sbdb_test.png)

Code: [Select]
' MySQL Test Program

INCLUDE mysql.bas

dbh = mysql::RealConnect("localhost","USER","PSWD","sbdb")

mysql::query(dbh,"SELECT * FROM test")

WHILE mysql::FetchHash(dbh,column)

PRINTNL
PRINT column{"ID"},"\n"
PRINT column{"NAME"},"\n"
PRINTNL

WEND

PRINTNL
PRINT "The database handle is: ",dbh,"\n"
PRINT "Affected rows by SELECT: ",mysql::AffectedRows(dbh),"\n"
PRINT "Character set name is: ",mysql::CharacterSetName(dbh),"\n"
PRINT "Last error is: ",mysql::ErrorMessage(dbh),"\n"
PRINT "Client info is: ",mysql::GetClientInfo(),"\n"
PRINT "Host info is: ",mysql::GetHostInfo(dbh),"\n"
PRINT "Proto info is: ",mysql::GetProtoInfo(dbh),"\n"
PRINT "Server info is: ",mysql::GetServerInfo(dbh),"\n"
PRINT "PING result: ",mysql::Ping(dbh),"\n"
PRINT "Thread ID: ",mysql::ThreadId(dbh),"\n"
PRINT "Status is: ",mysql::Stat(dbh),"\n"

mysql::Close(dbh)

END

$ scriba testmysql.sb
1
John Spikowski

The database handle is: 1
Affected rows by SELECT: 1
Character set name is: latin1
Last error is:
Client info is: 5.1.49
Host info is: Localhost via UNIX socket
Proto info is: 10
Server info is: 5.1.49-1ubuntu8.1
PING result: -1
Thread ID: 0
Status is: Uptime: 194893  Threads: 1  Questions: 2043  Slow queries: 0  Opens: 200  Flush tables: 1  Open tables: 64  Queries per second avg: 0.10

Network/Internet Access

This cURL extension module example downloads the ScriptBasic logo from it's project site.

Code: [Select]
IMPORT curl.bas

ch = curl::init()
curl::option(ch,"URL","http://scriptbasic.org/logo.png")
curl::option(ch,"FILE","sb_logo.png")
curl::perform(ch)
curl::finish(ch)

If programming for the web is your thing, ScriptBasic includes a multi-threaded application proxy server to run your GCI scripts with in memory session support with enhanced security safeguards. (files located outside of web root, .htaccess authorization caching, connection pooling with ODBC, real {binary format} programs and not embedded parsed HTML text scripts like php)

Feedback appreciated!



Title: Re: ScriptBasic 64 Bit Linux
Post by: meljr on April 09, 2011, 08:18:49 AM
I just wanted to express my appreciation for your efforts.  Having a ready to go Ubuntu 64 bit version will be really useful.

Thanks,

-meljr
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on April 09, 2011, 11:24:46 AM
Thanks for your reply and support!

This was really a group effort by Armando, Tom and myself getting this put together.

Armando and I are working on a 32 bit .deb for Ubuntu 10.10 and should be posted shortly.

Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on April 09, 2011, 08:45:21 PM
I created a 64 bit RPM for ScriptBasic 64 using alien to convert the .deb install file.

I included a tar file that can be used to install ScriptBasic if this method is preferred.

sudo tar xzvpf -C / scriba-v2.1.1_amd64.tgz

Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 18, 2013, 12:43:22 PM
John, The scriba-v2.1.1_amd64.deb would not install, error Maintainer line blank. Debian 7 Linux 64bit.

I downloaded and ran the install for scriba-v2.1.1-src_amd64.tar.z.  The install ran through ok and scriba runs ok. The modules do not work though. The install did make the .so files. I use mostly curl.so and cgi.so so need to get those working.
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 18, 2013, 10:46:49 PM
I highly recommend that you install ScriptBasic 2.2 beta for Ubuntu 64 bit. It has the new core math functions and extension modules updated. (along with a couple new ones)

Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 19, 2013, 10:31:28 AM
Thanks John, I found that version and will give it a try. In the ScriptBasic 2.2 beta for Ubuntu 64 bit package I do not see the sbhttpd server. Will sbhttpd from another linux 64bit package work? I tried scriba-v2.1.1_amd64.tgz and scriba worked but sbhttpd gave a segmentation fault.
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 19, 2013, 01:24:26 PM
I didn't test the SB 2.2 version of sbhttpd in its normal configuration (as root in /usr/bin) and was trying to make it work under a local user account with it's own configuration file. It looks like sbhttpd has to run as a root process due to it being run as a service.

Attached is my Ubuntu 12.04 LTS 64 bit version of sbhttpd.
Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 19, 2013, 05:46:50 PM
Thanks, The ScriptBasic 2.2 beta for Ubuntu 64 worked straight away. I will give your sbhttpd a try also.
Note, I have still not been able to get any of the .so modules to work? I get the error, module can not be loaded. If I change to a bad path for the modules I get, the module can not be found, so the modules are being found but not working for some reason.
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 19, 2013, 06:40:39 PM
Use full paths for your include and module references. I was experimenting with relative paths to where scriba starts but it isn't working for the include reference.

scriba -D will dump your current configuration to the screen. Redirect it to a file, edit it and scriba -k the configuration text file back to its binary form.

scriba -d your_script will put scriba in extension module load debug mode to help you determine why the module load is complaining.

Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 19, 2013, 10:28:59 PM
Thanks for the tips. testcurl.sb using the -d says GLIBC_2.14 not found.

Your sbhttpd works fine. So far only the hash.so and cgi.so are working ok.
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 19, 2013, 10:57:07 PM
This seems to be a Ubuntu 12.04 LTS and Debian 7 issue.

How do I fix a “version `GLIBC_2.14' not found” error? (http://stackoverflow.com/questions/10830650/how-do-i-fix-a-version-glibc-2-14-not-found-error)

If you feel comfortable doing so, I could send you a zip of the SB 2.2 source to compile on your Debian box. I'm not posting the SB 2.2 source until the official ScriptBasic 2.2 release. (too many half baked copies floating around as it is)

Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 20, 2013, 01:09:18 AM
'If you feel comfortable doing so, I could send you a zip of the SB 2.2 source to compile on your Debian box. '

Sure I would really like to give it a try. Thanks
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 20, 2013, 09:19:30 AM
Ron,

While I build a 2.2 source distribution, can you try compiling the 2.1 source first. That will make sure you have everything installed that is needed. Updating to 2.2 will will only take a few minutes if you have a working SB build directory in place.

John

P.S.

I was unable to find a Debian 7.1 64 bit ISO to install in a VirtualBox. The Debian files site also seemed down yesterday.

Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 20, 2013, 02:40:19 PM
I tried clean installs on these two. Machine Intel64 Debian7

SB_2.1_RC1_Linux.tar.gz

scriba was not made, sbhttpd ok, cgi ok, curl not working
------
scriba-v2.1.1-src_amd64.tar.z

scriba ok, sbhttpd ok, cgi ok, curl not working

 
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 20, 2013, 02:59:56 PM
ScriptBasic extension modules dynamically link to some of it's 3rd party interfaces. (cURL, MySQL, ODBC, libxml2, GD, ...) You must have these package dev libraries installed to get the SB extension modules to compile. The t.so, cgi.so, hash.so, ... should compile with no other dependencies.

I'm going to see if I can create a Debian micro instance on Amazon EC2 and build a SB 2.2 binary release.

Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 20, 2013, 06:39:48 PM
Ron,

Here is a Debian 7 64 bit build of ScriptBasic 2.2 binary files. If you can test it on your system and let me know how it goes, that would be great.

Code: [Select]
scriba executable OK  
sbhttpd executable OK  
libscriba library OK  
MODULE sqlite:   dll OK   lib OK   bas OK  
MODULE mt:       dll OK   lib OK   bas OK  
MODULE sdbg:     dll OK   lib OK   bas OK  
MODULE hash:     dll OK   lib OK   bas OK  
MODULE dbg:      dll OK   lib OK   bas OK  
MODULE gd:       dll OK   lib OK   bas OK  
MODULE odbc:     dll OK   lib OK   bas OK  
MODULE zlib:     dll OK   lib OK   bas OK  
MODULE trial:    dll OK   lib OK   bas OK  
MODULE mysql:    dll OK   lib OK   bas OK  
MODULE mxml:     dll FAIL lib FAIL bas OK  
MODULE cgi:      dll OK   lib OK   bas OK  
MODULE curl:     dll OK   lib OK   bas OK  
MODULE ux:       dll OK   lib OK   bas OK  
MODULE re:       dll OK   lib OK   bas OK  
MODULE curses:   dll OK   lib OK   bas OK  
MODULE t:        dll OK   lib OK   bas OK  
admin@ip-10-191-131-54:~/sb22/source$ cd bin/exe
admin@ip-10-191-131-54:~/sb22/source/bin/exe$ ./scriba -v
ScriptBasic v2.2
Variation >>Debian64<< build 1
Magic value 859010865
Node size is 24
Extension interface version is 11
Compilation: Jul 21 2013 01:22:45
admin@ip-10-191-131-54:~/sb22/source/bin/exe$


admin@ip-10-191-131-54:~/sb22$ ls -l bin
total 1468
-rwxr-xr-x 1 admin admin 765544 Jul 21 01:26 sbhttpd
-rwxr-xr-x 1 admin admin 735791 Jul 21 01:26 scriba
admin@ip-10-191-131-54:~/sb22$ ls -l lib
total 2948
-rw-r--r-- 1 admin admin 1086770 Jul 21 01:30 libscriba.a
-rwxr-xr-x 1 admin admin  840056 Jul 21 01:30 libscriba.so
-rw-r--r-- 1 admin admin 1082582 Jul 21 01:30 lscriba.a
admin@ip-10-191-131-54:~/sb22$ ls -l modules
total 1156
-rwxr-xr-x 1 admin admin  56630 Jul 21 01:28 cgi.so
-rwxr-xr-x 1 admin admin  57111 Jul 21 01:28 curl.so
-rwxr-xr-x 1 admin admin  22222 Jul 21 01:28 curses.so
-rwxr-xr-x 1 admin admin  20411 Jul 21 01:28 dbg.so
-rwxr-xr-x 1 admin admin  31232 Jul 21 01:28 gd.so
-rwxr-xr-x 1 admin admin  13776 Jul 21 01:28 hash.so
-rwxr-xr-x 1 admin admin  29147 Jul 21 01:28 mt.so
-rwxr-xr-x 1 admin admin  27824 Jul 21 01:28 mysql.so
-rwxr-xr-x 1 admin admin  15688 Jul 21 01:28 odbc.so
-rwxr-xr-x 1 admin admin  62226 Jul 21 01:28 re.so
-rwxr-xr-x 1 admin admin  22663 Jul 21 01:28 sdbg.so
-rwxr-xr-x 1 admin admin 757133 Jul 21 01:28 sqlite.so
-rwxr-xr-x 1 admin admin   8669 Jul 21 01:28 trial.so
-rwxr-xr-x 1 admin admin  13218 Jul 21 01:28 t.so
-rwxr-xr-x 1 admin admin   3912 Jul 21 01:28 ux.so
-rwxr-xr-x 1 admin admin  13597 Jul 21 01:28 zlib.so
admin@ip-10-191-131-54:~/sb22$

Update

I tried the following and the test programs ran fine.


I'm assuming MySQL, ODBC and SBHTTPD will run fine.


Title: Re: ScriptBasic 64 Bit Linux
Post by: RONB on July 20, 2013, 07:34:41 PM
I removed all *.so, scriba,sbhttpd.

cp *.so /usr/local/lib/scriba/
cp scriba /usr/bin/scriba
cp sbhttpd /usr/bin/sbhttpd

So far everything I have tried works perfectly; scriba, sbhttpd, all modules.
scriba ok
sbhttpd ok
curl ok
cgi ok
gd ok
others also

Are these files supposed to go somewhere? libscriba.a libscribaso lscrib.a
Or is this just the output from the build, not needed to use sb system?

Looks great, Thanks


Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 20, 2013, 08:01:37 PM
Quote
Are these files supposed to go somewhere? libscriba.a libscribaso lscrib.a
Or is this just the output from the build, not needed to use sb system?

The lib directory files are only needed if you compile your scripts to C.

Glad everything is working out for you!
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 20, 2013, 10:23:17 PM
I just tested the MySQL extension module under Debian 7 64 bit.

Code: [Select]
' MySQL Test Program

INCLUDE mysql.bas

dbh = mysql::RealConnect("localhost","root","******","sbtest")

mysql::query(dbh,"SELECT * FROM products WHERE productLine = 'Planes'")

WHILE mysql::FetchHash(dbh,column)
  PRINT column{"productCode"}," - ",column{"productName"},"\n"
WEND

PRINTNL
PRINT "The database handle is: ",dbh,"\n"
PRINT "Affected rows by SELECT: ",mysql::AffectedRows(dbh),"\n"
PRINT "Character set name is: ",mysql::CharacterSetName(dbh),"\n"
PRINT "Last error is: ",mysql::ErrorMessage(dbh),"\n"
PRINT "Client info is: ",mysql::GetClientInfo(),"\n"
PRINT "Host info is: ",mysql::GetHostInfo(dbh),"\n"
PRINT "Proto info is: ",mysql::GetProtoInfo(dbh),"\n"
PRINT "Server info is: ",mysql::GetServerInfo(dbh),"\n"
PRINT "PING result: ",mysql::Ping(dbh),"\n"
PRINT "Thread ID: ",mysql::ThreadId(dbh),"\n"
PRINT "Status is: ",mysql::Stat(dbh),"\n"

mysql::Close(dbh)


admin@ip-10-191-131-54:~/sb22/test$ scriba testmysql.sb
S18_1662 - 1980s Black Hawk Helicopter
S18_2581 - P-51-D Mustang
S24_1785 - 1928 British Royal Navy Airplane
S24_2841 - 1900s Vintage Bi-Plane
S24_3949 - Corsair F4U ( Bird Cage)
S24_4278 - 1900s Vintage Tri-Plane
S700_1691 - American Airlines: B767-300
S700_2466 - America West Airlines B757-200
S700_2834 - ATA: B757-300
S700_3167 - F/A 18 Hornet 1/72
S700_4002 - American Airlines: MD-11S
S72_1253 - Boeing X-32A JSF

The database handle is: 1
Affected rows by SELECT: 12
Character set name is: latin1
Last error is:
Client info is: 5.5.31
Host info is: Localhost via UNIX socket
Proto info is: 10
Server info is: 5.5.31-0+wheezy1
PING result: -1
Thread ID: 0
Status is: Uptime: 22639  Threads: 1  Questions: 624  Slow queries: 0  Opens: 432  Flush tables: 2  Open tables: 42  Queries per second avg: 0.027
admin@ip-10-191-131-54:~/sb22/test$
Title: Re: ScriptBasic 64 Bit Linux
Post by: Support on July 21, 2013, 08:50:18 PM
(https://www.centos.org/themes/centos/images/centos_logo_45.png)

I created a CentOS 6.4 64 bit version of ScriptBasic which will be included as one of the 2.2 release candidates.

[root@ip-10-188-28-135 sb22]# scriba -v
ScriptBasic v2.2
Variation >>CentOS64<< build 1
Magic value 859010866
Node size is 24
Extension interface version is 11
Compilation: Jul 22 2013 03:15:57
[root@ip-10-188-28-135 sb22]# cat /etc/*release
CentOS release 6.4 (Final)


Attached is a CentOS 6.4 64 bit SciptBasic runtime set of files for beta testing. Feedback appreciated!