Firebird 3 on MacOS not working as an embedded server

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Firebird 3 on MacOS not working as an embedded server

Mark De Wit

Hi all,

 

I’m developing a cross-platform application, trying to use firebird for my data storage.  Everything works fine on Windows.

 

On Mac, I have built firebird 3 from source (official release 3.0.1.32609 sources), and isql runs fine.  However, when linking my application against libfbclient.dylib and calling isc_dsql_execute_immediate() with a “CREATE DATABASE ‘test.db’ USER ‘test’ PASSWORD ‘test’;” sql command, firebird returns the error message: “Unable to complete network request to host “localhost”.

 

This would suggest to me that it’s not running in embedded mode, but trying to act like a client.  The same statement in isql for my build works fine, so the binaries appear to be ok?

 

Is there anything in particular that I need to do to make libfbclient act as an embedded server?  Did I build it wrong (it was not a trivial build, not many instructions to help)?

 

Details, in case they are relevant:

I have placed libfbclient.dylib.3.0.1 in the same folder as my binary, and fixed the rpaths accordingly.  The same bin folder also holds libib_util.dylib, icu binaries etc.

I’ve created a subfolder called plugins which holds libEngine12.dylib and libfbtrace.dylib, as well as the intl subfolder for libfbintl.dylib.

 

Does anyone have any suggestions how I can get this working? 

 

With kind regards,

Mark


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: Firebird 3 on MacOS not working as an embedded server

Vlad Khorsun-2
23.02.2017 16:45, Mark De Wit wrote:

> Hi all,
>
>
>
> I’m developing a cross-platform application, trying to use firebird for my data storage.  Everything works fine on Windows.
>
>
>
> On Mac, I have built firebird 3 from source (official release 3.0.1.32609 sources), and isql runs fine.  However, when linking my
> application against libfbclient.dylib and calling isc_dsql_execute_immediate() with a “CREATE DATABASE ‘test.db’ USER ‘test’
> PASSWORD ‘test’;” sql command, firebird returns the error message: “Unable to complete network request to host “localhost”.
>
>
>
> This would suggest to me that it’s not running in embedded mode, but trying to act like a client.  The same statement in isql for my
> build works fine, so the binaries appear to be ok?
>
>
>
> Is there anything in particular that I need to do to make libfbclient act as an embedded server?  Did I build it wrong (it was not a
> trivial build, not many instructions to help)?
>
>
>
> Details, in case they are relevant:
>
> I have placed libfbclient.dylib.3.0.1 in the same folder as my binary, and fixed the rpaths accordingly.  The same bin folder also
> holds libib_util.dylib, icu binaries etc.
>
> I’ve created a subfolder called plugins which holds libEngine12.dylib and libfbtrace.dylib, as well as the intl subfolder for
> libfbintl.dylib.

   Do you have firebird.conf at the libfbclient folder ?

Regards,
Vlad


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: Firebird 3 on MacOS not working as an embedded server

Mark De Wit
Yes, the default firebird.conf (as produced by the build) is in the bin folder together with fbclient library.  I have not changed any settings, however (so all settings are commented out)

I also placed firebird.msg file in the same folder.  I've also tried running without firebird.conf, no change in behaviour.

I have set DYLD_PRINT_LIBRARIES=1, and noticed that plugins/libEngine12.dylib is never loaded.  That's surprising to me, on desktop it is being loaded quite early on.

Mark

-----Original Message-----
From: Vlad Khorsun [mailto:[hidden email]]
Sent: 23 February 2017 16:43
To: [hidden email]
Subject: Re: [Firebird-devel] Firebird 3 on MacOS not working as an embedded server

23.02.2017 16:45, Mark De Wit wrote:

> Hi all,
>
>
>
> I'm developing a cross-platform application, trying to use firebird for my data storage.  Everything works fine on Windows.
>
>
>
> On Mac, I have built firebird 3 from source (official release
> 3.0.1.32609 sources), and isql runs fine.  However, when linking my application against libfbclient.dylib and calling isc_dsql_execute_immediate() with a "CREATE DATABASE 'test.db' USER 'test'
> PASSWORD 'test';" sql command, firebird returns the error message: "Unable to complete network request to host "localhost".
>
>
>
> This would suggest to me that it's not running in embedded mode, but
> trying to act like a client.  The same statement in isql for my build works fine, so the binaries appear to be ok?
>
>
>
> Is there anything in particular that I need to do to make libfbclient
> act as an embedded server?  Did I build it wrong (it was not a trivial build, not many instructions to help)?
>
>
>
> Details, in case they are relevant:
>
> I have placed libfbclient.dylib.3.0.1 in the same folder as my binary,
> and fixed the rpaths accordingly.  The same bin folder also holds libib_util.dylib, icu binaries etc.
>
> I've created a subfolder called plugins which holds libEngine12.dylib
> and libfbtrace.dylib, as well as the intl subfolder for libfbintl.dylib.

   Do you have firebird.conf at the libfbclient folder ?

Regards,
Vlad


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: Firebird 3 on MacOS not working as an embedded server

Mark De Wit
Ahh, success (I think!)...  I ran isql with DYLD_PRINT_LIBRARIES, and confirmed that everything worked ok.

I think placed plugins/libEngine12.dylib one level above (not beneath) my bin folder, and now my CREATE statement works!

That is really awkward though, having to have the firebird plugins outside of my bin folder...  Can I control this path somewhere?  I already have a bin\plugins for my own plugins, Qt plugins, etc...  I would very much prefer to use that!

Mark

-----Original Message-----
From: Mark De Wit [mailto:[hidden email]]
Sent: 23 February 2017 17:33
To: For discussion among Firebird Developers <[hidden email]>
Subject: Re: [Firebird-devel] Firebird 3 on MacOS not working as an embedded server

Yes, the default firebird.conf (as produced by the build) is in the bin folder together with fbclient library.  I have not changed any settings, however (so all settings are commented out)

I also placed firebird.msg file in the same folder.  I've also tried running without firebird.conf, no change in behaviour.

I have set DYLD_PRINT_LIBRARIES=1, and noticed that plugins/libEngine12.dylib is never loaded.  That's surprising to me, on desktop it is being loaded quite early on.

Mark

-----Original Message-----
From: Vlad Khorsun [mailto:[hidden email]]
Sent: 23 February 2017 16:43
To: [hidden email]
Subject: Re: [Firebird-devel] Firebird 3 on MacOS not working as an embedded server

23.02.2017 16:45, Mark De Wit wrote:

> Hi all,
>
>
>
> I'm developing a cross-platform application, trying to use firebird for my data storage.  Everything works fine on Windows.
>
>
>
> On Mac, I have built firebird 3 from source (official release
> 3.0.1.32609 sources), and isql runs fine.  However, when linking my application against libfbclient.dylib and calling isc_dsql_execute_immediate() with a "CREATE DATABASE 'test.db' USER 'test'
> PASSWORD 'test';" sql command, firebird returns the error message: "Unable to complete network request to host "localhost".
>
>
>
> This would suggest to me that it's not running in embedded mode, but
> trying to act like a client.  The same statement in isql for my build works fine, so the binaries appear to be ok?
>
>
>
> Is there anything in particular that I need to do to make libfbclient
> act as an embedded server?  Did I build it wrong (it was not a trivial build, not many instructions to help)?
>
>
>
> Details, in case they are relevant:
>
> I have placed libfbclient.dylib.3.0.1 in the same folder as my binary,
> and fixed the rpaths accordingly.  The same bin folder also holds libib_util.dylib, icu binaries etc.
>
> I've created a subfolder called plugins which holds libEngine12.dylib
> and libfbtrace.dylib, as well as the intl subfolder for libfbintl.dylib.

   Do you have firebird.conf at the libfbclient folder ?

Regards,
Vlad


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: Firebird 3 on MacOS not working as an embedded server

Vlad Khorsun-2
In reply to this post by Mark De Wit
23.02.2017 19:33, Mark De Wit wrote:
> Yes, the default firebird.conf (as produced by the build) is in the bin folder together with fbclient library.
 > I have not changed any settings, however (so all settings are commented out)

   "plugins" folder is inside that "bin" folder, correct ?

> I also placed firebird.msg file in the same folder.  I've also tried running without firebird.conf, no change in behaviour.
>
> I have set DYLD_PRINT_LIBRARIES=1, and noticed that plugins/libEngine12.dylib is never loaded.  That's surprising to me,
 > on desktop it is being loaded quite early on.

   Probably it is searched at another location. I'm not a MacOS expert, so...
Anyway, try to set enviroment variable FIREBIRD to the full path to the "bin" folder.

   Another idea is to put your app into firebird folder (where isql works), just to
check if it will work at all.

Regards,
Vlad


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: Firebird 3 on MacOS not working as an embedded server

Paul Beach
In reply to this post by Mark De Wit
> I think placed plugins/libEngine12.dylib one level above (not beneath) my bin folder, and now my CREATE statement works!

Hmm the default build for Firebird on MacOSX creates a framework, and all the libraries/binaries
(where applicable - libfbclient) have the framework location built into them, you can verify
this by using otool -L

However code was added to config_root.cpp to simulate binreloc (posix) on MacOSX. so it can
find the name of the excutable in the directory below firebird, strip the executable name, strip
the lowest directory, now use the remainder to find the configuration file, firebird.conf, and read
the conf file to get the actual RootDirectory for Firebird so an embedded version can work in the
way that you suggest...i.e plugins will expect to be found one level down from wherever FIREBIRD
is assumed to be (the location of firebird.conf).

If you really want to proper embedded version of Firebird for your application you will need to do
some work with install_name_tool
cf
http://paulbeachsblog.blogspot.fr/2012/09/firebird-embedded-on-macosx.html

or change the build so it doesn't default to a framework...

Regards
Paul

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel