Re: edbi on 64 bit machines?
- Posted by egis May 07, 2012
- 4141 views
EDBI works for me on Ubuntu 12.04 64 bit. THANKS FOR ALL OF YOUR HELP!
So here is a summary of my notes. It might not be correct for everyone but it worked for me. You will also need to fiddle with file/directory permissions and ownership as you go along (next time I do this I will add in chmod and chown to my notes here). If I knew more about scripts I would make one to make this easier. I just expect that these problems will eventually be fixed by the great Euphoria team.
- Removed existing euphoria
- Preferablly using the package manager remove euphoria
- Alternatively remove all references to my existing euphoria, and in my case:
- % rm -r /usr/share/euphoria
- % rm /usr/bin/eui
- Downloaded Matt's new eubins: http://openeuphoria.org/eubins/linux/4.1.0/64-bit/euphoria-4.1.0-Linux-ix86_64-6b3fc2c6be44.tar.gz
- % mkdir /euphoria
- using the archive manager decompressed the tarball and put it into /euphoria
- % mv euphoria-4.1.0-Linux-ix86_64-6b3fc2c6be44 euphoria-4.1.0
- Add /euphoria/euphoria-4.1.0/bin to the $PATH. Now this is probably not the correct way to do it but like I said it worked for me, so addjust it to your best knowledge.
- % echo 'pathmunge /euphoria/euphoria-4.1.0/bin' > /etc/profile.d/euphoria.sh
- % chmod +x /etc/profile.d/euphoria.sh
- I then had to log out and log back in to set $PATH.
- test your path: % echo $PATH
- build the new euphoria binaries
- % cd /euphoria/euphoria-4.1.0/source
- % ./configure
- % make (this takes a bit of time)
- % make install
- verify euphoria was installed
- % ls /usr/local/share/euphoria
- % ls /usr/local/lib/eu*
- see listing as per Matt's last comment
- Download edbi from jeremys web site:
- http://bitbucket.org/jcowgar/edbi/get/default.tar.gz
- decompress the files into /usr/local/share/euphoria
- % cd /usr/local/share/euphoria
- % mv jcowgar-edbi-106c52c61e33.tar-1 edbi
- Configure edbi files (since I am using mysql I made the following changes)
- % cd /usr/local/share/euphoria/edbi/drivers/mysql
- edit edbi_mysql.e
- find and modify the line just below constant lib_mysql = open_dll({
- in my case
"/usr/lib/x86_64-linux-gnu/libmysqlclient.so.18", -- stupid hack for openeuphoria.org
- you will need to make sure your libmysqlclient.so.xx file exists. In different versions of linux it is located in diffrent places. To make sure it exists and to match your specific version: % cd /usr; find -name libmysqlclient.so*;
- since I did not know how to set my edbi path in edbi_mysql.e I set it literally. I changed 'include edbi/defs.e' to 'include std/../../edbi/edbi/defs.e'
- edit eu.cfg. Mine looks like:
[all] -eudir /usr/local/share/euphoria -i /usr/local/share/euphoria/include -i ../../edbi [translate] -com /usr/local/lib/source/eu -lib /usr/local/lib/bin/eu.a -lib-pic /usr/local/lib/euso.a [bind] -eub /usr/local/share/euphoria/bin/eub
- build edbi_mysql.so
% euc -so edbi_mysql.e % chmod 755 edbi_mysql.so % cp /usr/local/share/euphoria/edbi/drivers/mysql/edbi_mysql.so /usr/local/lib/.
- FYI, the location of edbi_mysql.so is used in edbi.e. If you get errors verify that edbi_mysql.so is located in one of the places as specified in the variables (dll_name1 ... dll_name5)
- I changed the top of edbi's test example to work with just mysql and with a few minor changes. Here is the top of my modified /usr/local/share/euphoria/edbi/examples/example.ex. Make sure to change the constats: USER, PASSWORD, DB, and DB_ADDRESS.
include std/datetime.e
include std/../../edbi/edbi/edbi.e
-----------------------------------
-- change the following four constants to match your database configuration
-----------------------------------
constant USER="your_user"
constant PASSWORD="your_password"
constant DB="test"
constant DB_ADDRESS="localhost"
sequence data = {
{ "Ronald Mc'Donald", 29382, datetime:subtract(datetime:new(), 32, YEARS) },
{ "Super Man", 55555, datetime:new(1944, 5, 18) },
{ "Wonder Woman", 21232, datetime:new(1972, 9, 29) }
}
edbi:set_driver_path("../drivers")
edbi:db_handle dbh = edbi:open( "mysql://" & USER & ":" & PASSWORD & "@" & DB_ADDRESS & "/" & DB )
--ifdef sqlite3 then
-- edbi:db_handle dbh = edbi:open("sqlite3://example.db")
--elsifdef pgsql then
-- edbi:db_handle dbh = edbi:open( sprintf("pgsql://%s:%s@localhost/pgtest",{USER,PASSWORD}) )
--elsedef
--end ifdef
- finaly run example.ex: % eui example.ex
Please modify these notes to help others fumbling around in the dark.
If you like you can remove /euphoria.

