Git Product home page Git Product logo

Comments (18)

luislavena avatar luislavena commented on May 17, 2024

Hello,

Did you compile FreeTDS or used TINYTDS_SKIP_PORTS environment variable?

https://github.com/rails-sqlserver/tiny_tds/blob/master/Rakefile#L35

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

Did you compile and installed it?

Can you verify the way you compiled it generated the proper shared object?

from tiny_tds.

PhilT avatar PhilT commented on May 17, 2024

I'm getting

rake-compiler must be configured first to enable cross-compilation

when I run rake. Should I be concerned?

It looks like freetds compiled.

When I do rake ports:freetds I get:

rake-compiler must be configured first to enable cross-compilation
Activating libiconv 1.13.1 (from ports/x86_64-linux/libiconv/1.13.1)...
Activating freetds 0.91 (from ports/x86_64-linux/freetds/0.91)...

from tiny_tds.

PhilT avatar PhilT commented on May 17, 2024

Should the shared object be in ports/x86_64-linux/freetds/0.91/share/?

If so, it's not.

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

Oh, I understood you compiled FreeTDS yourself, not that you used the ports.

Seems that FreeTDS needs to be recompiled: relocation R_X86_64_32 against.rodata' can not be used when making a shared object;`

Can't try right now (don't have a x64 Linux around) but will try later today and see if I can reproduce.

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

The shared object is in /home/phil/workspace/tiny_tds/ports/x86_64-linux/freetds/0.91/lib/libsybdb.a but it requires to be recompiled with -fPIC option, dunno why FreeTDS own configure didn't detect that.

from tiny_tds.

PhilT avatar PhilT commented on May 17, 2024

Yes I saw the error but not really sure what that means. I'm not up on compiling stuff on Linux.

So, is there anything else I can do or give you or shall I just hold on until you've managed to reproduce?

Also note, this was done on Ubuntu 11.04.

Thanks for getting back to me so quickly, btw.

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

Need to be able to reproduce so I can play with FreeTDS compiler flags :-)

You can avoid the waiting if you installed FreeTDS as shared object at system level, but since you're not up compiling stuff, the safest bet is wait (or maybe @metaskills can check this before me)

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

Ok, got something for you, and is packed of good news and a bit of work, hope you're not scared.

Seems that libtool, the tool used to compile both libiconv and freetds libraries used by TinyTDS is not properly doing -fPIC on the static libraries.

It should, by default, but is not. Found a similar issue on Gentoo that you could relate to:

http://www.psicenter.org/wiki/index.php/Gentoo_Info#Unable_to_Emerge_blas-atlas-3.7.11
https://bugs.gentoo.org/show_bug.cgi?id=142924

BTW: PIC stands for Position Independent Code

Anyhow, to solve this:

Open tasks/ports.rake and add recipe.configure_options << "CFLAGS='-fPIC'" above the recipe.cookline.

You will end with something like this (diff):

diff --git a/tasks/ports.rake b/tasks/ports.rake
index bb68788..0bc6d2b 100644
--- a/tasks/ports.rake
+++ b/tasks/ports.rake
@@ -28,6 +28,7 @@ namespace :ports do
     recipe = $recipes[:libiconv]
     checkpoint = "ports/.#{recipe.name}.#{recipe.version}.#{recipe.host}.timestamp"
     unless File.exist?(checkpoint)
+      recipe.configure_options << "CFLAGS='-fPIC'"
       recipe.cook
       touch checkpoint
     end
@@ -43,6 +44,7 @@ namespace :ports do
       recipe.configure_options << '--sysconfdir="C:/Sites"' if recipe.host != ORIGINAL_HOST
       recipe.configure_options << "--disable-odbc"
       recipe.configure_options << ENV['TINYTDS_FREETDS_082'] ? "--with-tdsver=8.0" : "--with-tdsver=7.1"
+      recipe.configure_options << "CFLAGS='-fPIC'"
       recipe.cook
       touch checkpoint
     end

Now, before compile, you first need to nuke tmp and ports directory.

After that, doing rake compile should work.

Dunno if this will connect with your SQL Server, but seems that compiles properly :-D

Have a nice day!

from tiny_tds.

metaskills avatar metaskills commented on May 17, 2024

Oh awesome! How is the new miniportile doing too?

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

@metaskills, haven't made too much progress, got distracted with some C code and some crazy ideas (like always)... Oh shiny :-D

from tiny_tds.

wayneeseguin avatar wayneeseguin commented on May 17, 2024

@metaskills @luislavena ~ Agreed w.r.t. "ohhhhh shiny..."

I had several people ask me about "rvm.exe" at the conference last week...

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

@wayneeseguin @metaskills check your inboxes, you will agree on the ohh shiny

re: rvm.exe and MiniPortile, too many cool things, not so much time :'(

from tiny_tds.

wayneeseguin avatar wayneeseguin commented on May 17, 2024

"too many cool things, not so much time :'(" ~ Wait till the babies start popping out ::grin::

from tiny_tds.

PhilT avatar PhilT commented on May 17, 2024

@luislavena Thanks! I'll give this a try.
@wayneeseguin Thanks for RVM. It makes my life easier :)

from tiny_tds.

PhilT avatar PhilT commented on May 17, 2024

You guys rock! This has fixed my issue. I can now compile and run the tiny_tds tests and in addition my own test (which was giving me invalid date errors) is now passing.

One thing I needed to do was to pass in TDSVER=7.1 into the tiny_tds rake tests and in irb. Setting :tds_version in Client.new seemed to have no effect. Until I did this I was getting TinyTds::Error: Adaptive Server connection failed errors.

Now back to the sqlserver_adapter and Rails and my new Ubuntu install (which still needs tweaking)...

Many thanks to you all for your assistance. Let me know if there is any further information you need.

Regards,
Phil

from tiny_tds.

luislavena avatar luislavena commented on May 17, 2024

You guys rock! This has fixed my issue

Happy to hear that!

One thing I needed to do was to pass in TDSVER=7.1 into the tiny_tds rake tests and in irb. Setting :tds_version in Client.new seemed to have no effect. Until I did this I was getting TinyTds::Error: Adaptive Server connection failed errors.

Strange, since we are defining TDSVER 7.1 as default during compilation:

https://github.com/rails-sqlserver/tiny_tds/blob/master/tasks/ports.rake#L45

I just executed ports/x86_64-linux/freetds/0.91/bin/tsql -C and this is the result:

Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91
             freetds.conf directory: /home/ubuntu/projects/oss/rails-sqlserver/tiny_tds/ports/x86_64-linux/freetds/0.91/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 5.0
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no

See TDS version...

Seems that it is ignoring the configuration option we added.

@metaskills, leaving this to you to figure out, you have more experience with FreeTDS than myself.

from tiny_tds.

metaskills avatar metaskills commented on May 17, 2024

That should finish it :)

from tiny_tds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.