# installing firebird



## Lola (Feb 15, 2010)

I try compiling firebird 2.5 rc, but I get errors.


```
./configure -pass
gmake
```
and then get these errors.


```
vi.c:919:74: error: macro "__weak_reference" requires 2 arguments, but only 1 given
vi.c: In function 'get_alias_text':
vi.c:919: error: expected declaration specifiers before '__weak_reference'
vi.c:924: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:954: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:999: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:1055: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:1104: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:919: error: parameter name omitted
vi.c:1125: error: expected '{' at end of input
gmake[6]: *** [vi.lo] Error 1
gmake[6]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/extern/editline/src'
gmake[5]: *** [all] Error 2
gmake[5]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/extern/editline/src'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/extern/editline'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/extern/editline'
gmake[2]: *** [../gen/firebird/lib/libedit.a] Error 2
gmake[2]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/gen'
gmake[1]: *** [external_libraries] Error 2
gmake[1]: Leaving directory `/root/Downloads/Firebird-2.5.0.25920-ReleaseCandidate2/gen'
gmake: *** [firebird] Error 2
```

thanks


----------



## Lola (Feb 15, 2010)

freebsd 8.0 version.

processor -amd athlon 3500 xp + 64 bit


----------



## alerto (Feb 19, 2010)

*HOWTO install`n`configure FIREBIRD on FreeBSD?*

Can anybody help to configure FIREBIRD 2.1.3 on FreeBSD 8.0?


----------



## phoenix (Feb 19, 2010)

Don't post questions in the How To forum.  Only actual how-to documents should be posted there.  Thread moved.


----------



## fronclynne (Feb 19, 2010)

Well, it errors out at 
	
	



```
gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT vi.lo -MD -MP -MF .deps/vi.Tpo -c vi.c -o vi.o
vi.c:919:74: error: macro "__weak_reference" requires 2 arguments, but only 1 given
vi.c: In function 'get_alias_text':
vi.c:919: error: expected declaration specifiers before '__weak_reference'
vi.c:924: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:954: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:999: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:1055: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:1104: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
vi.c:919: error: parameter name omitted
vi.c:1125: error: expected '{' at end of input
gmake[6]: *** [vi.lo] Error 1
```
 which looks a bit like what happens when I get drunk and pipe /dev/urandom into gcc.

The installation guide for FreeBSd is as follows:  "Not currently available"

databases/firebird20-server is available, but I guess if you need 2.1.3, that won't do.

It might be possible to install the linux version under linux compatibility.

Good luck.


----------



## ranggadablues (Jun 4, 2010)

hi, I have problem when install firebird and I've got error message like this


```
make -DPACKAGE_BUILDING
===>   firebird-server-2.0.3_3 depends on executable: gmake - found
===>   firebird-server-2.0.3_3 depends on executable: bison - found
===>   firebird-server-2.0.3_3 depends on file: /usr/local/bin/automake-1.9 - no
t found
===>    Verifying install for /usr/local/bin/automake-1.9 in /usr/ports/devel/au
tomake19
===>   Returning to build of firebird-server-2.0.3_3
===>   firebird-server-2.0.3_3 depends on file: /usr/local/bin/autoconf-2.62 - f
ound
===>   firebird-server-2.0.3_3 depends on package: libtool>=2.2 - found
===>   firebird-server-2.0.3_3 depends on shared library: fbembed.2 - found
===>  Configuring for firebird-server-2.0.3_3
env: /usr/local/bin/aclocal-1.9: No such file or directory
*** Error code 127

Stop in /usr/ports/databases/firebird20-server.
```

any suggestion?


----------



## zeiz (Jun 4, 2010)

I would try reinstalling of devel/automake19


----------



## mariuz (Sep 4, 2010)

We (firebird-core-devel) have the instructions to compile Firebird 2.1.x on freebsd 

http://www.firebirdnews.org/?p=4717

the trick if you are on 32bit machine is to add  

--without-editline or --with-system-editline (the internal one can't be compiled on freebsd it seems)


----------



## DutchDaemon (Sep 7, 2010)

[ separate firebird threads merged ]


----------



## PGP (Sep 30, 2010)

mariuz said:
			
		

> We (firebird-core-devel) have the instructions to compile Firebird 2.1.x on freebsd
> 
> http://www.firebirdnews.org/?p=4717
> 
> ...



Still cannot compile FB2.5RC3 in FreeBSD 8.1-RELEASE (i386).
Trying
`./configure --with-system-editline`
or
`./configure --without-editline`

and after gmake i recieved the following:

```
gmake[2]: Leaving directory `/root/distfiles/FB2/gen'
gmake -f ../gen/Makefile.refDatabases empty_db
gmake[2]: Entering directory `/root/distfiles/FB2/gen'
gmake -f ../gen/Makefile.embed.util ../gen/firebird/bin/create_db
gmake[3]: Entering directory `/root/distfiles/FB2/gen'
gmake[3]: `../gen/firebird/bin/create_db' is up to date.
gmake[3]: Leaving directory `/root/distfiles/FB2/gen'
rm -f empty.fdb
../gen/firebird/bin/create_db empty.fdb
Fatal lock manager error: mutex init failed, errno: 2
--No such file or directory
gmake[2]: *** [empty.fdb] Segmentation fault: 11 (core dumped)
gmake[2]: *** Deleting file `empty.fdb'
gmake[2]: Leaving directory `/root/distfiles/FB2/gen'
gmake[1]: *** [empty_db] Error 2
gmake[1]: Leaving directory `/root/distfiles/FB2/gen'
gmake: *** [firebird] Error 2
```


----------



## mariuz (Oct 3, 2010)

you You must apply the mutex patch 


```
# Description: define USE_SYS5SEMAPHORE on FreeBSD
#  Without this, the mutex code tries to use some pthread functions which
#  aren't implemented on FreeBSD
#  I am not sure SYSV semaphores will work either, but since upstream uses them
#  on DARWIN, and DARWIN is based on FreeBSD, I think this is worth a try
#  If this makes things better, it should be forwarded upstream
# Forwarded: no
# Author: Damyan Ivanov <dmn@debian.org>
# Debian-Bug: 565801
--- a/src/jrd/isc.h
+++ b/src/jrd/isc.h
@@ -33,7 +33,7 @@
 
 // Firebird platform-specific synchronization data structures
 
-#if defined(DARWIN)
+#if defined(DARWIN) || defined(FREEBSD)
 #define USE_SYS5SEMAPHORE
 #endif
```


----------



## PGP (Oct 3, 2010)

mariuz said:
			
		

> you must apply the mutex patch
> 
> 
> ```
> ...



as i As I understood this patch already exists in FB2.5RC3

in file /src/jrd/isc.h from line 36.


```
// Firebird platform-specific synchronization data structures

#if defined(DARWIN) || defined(FREEBSD)
#define USE_SYS5SEMAPHORE
#endif
```


----------



## hangover (Oct 12, 2010)

I'm trying to install Firebird 2.1.3 on FreeBSD 8.1-RELEASE-p1 i386, but have no luck.
What I tried to do:

1) Unpacked sources archive

```
tar xvjf Firebird-2.1.3.18185-0.tar.bz2 && cd Firebird-2.1.3.18185-0
```

2) Since I already have installed ICU, 

```
root@range:[/home/hangover/Firebird-2.1.3.18185-0]# pkg_info | grep icu
icu-3.8.1_3         International Components for Unicode (from IBM)
```
I decided to configure sources with options --with-system-icu and --without-editline:

```
root@range:[/home/hangover/Firebird-2.1.3.18185-0]# ./autogen.sh --prefix="/usr/local" --localstatedir="/var/db/firebird" --with-system-icu --
without-editline
```
It successfuly finishes and returns next message:

```
.....
config.status: creating Makefile
config.status: creating gen/Makefile.extern.editline
config.status: creating src/include/gen/autoconfig.h
config.status: src/include/gen/autoconfig.h is unchanged
config.status: executing libtool commands


The Firebird2 package has been configured with the following options:

                   Architecture : ClassicServer
                          Debug : disabled
64 bit I/O for 32-bit platforms : enabled
                    Raw devices : enabled
                   Lock manager : enabled
                   Service name : gds_db
                   Service port : 3050
                   GPRE modules : c_cxx.cpp

                    Install Dir : /usr/local

Now type `make' to compile Firebird2
```

3) After that I'm trying to gmake it, and it fails:

```
.....
../src/jrd/unicode_util.cpp:1135: error: expected `(' before 'UChar'
../src/jrd/unicode_util.cpp:1135: error: expected primary-expression before '>' token
../src/jrd/unicode_util.cpp:1135: error: expected `)' before ';' token
../src/jrd/unicode_util.cpp:1135: error: expected `)' before ';' token
../src/jrd/unicode_util.cpp: In static member function 'static Jrd::UnicodeUtil::ICU* Jrd::UnicodeUtil::Utf16Collation::loadICU(const 
Firebird::string&, const Firebird::string&, const Firebird::string&)':
../src/jrd/unicode_util.cpp:1172: error: 'UErrorCode' was not declared in this scope
../src/jrd/unicode_util.cpp:1172: error: expected `;' before 'status'
../src/jrd/unicode_util.cpp:1176: error: 'struct Jrd::UnicodeUtil::ICU' has no member named 'ulocCountAvailable'
../src/jrd/unicode_util.cpp:1180: error: 'struct Jrd::UnicodeUtil::ICU' has no member named 'ulocGetAvailable'
../src/jrd/unicode_util.cpp:1188: error: 'U_MAX_VERSION_STRING_LENGTH' was not declared in this scope
../src/jrd/unicode_util.cpp:1189: error: 'struct Jrd::UnicodeUtil::ICU' has no member named 'uVersionToString'
../src/jrd/unicode_util.cpp:1189: error: 'struct Jrd::UnicodeUtil::ICU' has no member named 'collVersion'
../src/jrd/unicode_util.cpp:1189: error: 'version' was not declared in this scope
gmake[3]: *** [../temp/boot/jrd/unicode_util.o] Error 1
gmake[3]: Leaving directory `/usr/home/hangover/Firebird-2.1.3.18185-0/gen'
gmake[2]: *** [libfbstatic] Error 2
gmake[2]: Leaving directory `/usr/home/hangover/Firebird-2.1.3.18185-0/gen'
gmake[1]: *** [../gen/firebird/bin/gpre_static] Error 2
gmake[1]: Leaving directory `/usr/home/hangover/Firebird-2.1.3.18185-0/gen'
gmake: *** [firebird] Error 2
```

Apparently, it can't find system ICU libs. I tried to configure it with

```
LIBS="-L/usr/local/lib -licui18n -licuuc -licudat"
```
but it returns same error.

Also, I desperately tried to build it without option "--with-system-icu", and gmake was successful (but I had to patch sources with this patch: http://git.debian.org/?p=pkg-firebi...ebian/patches/no-static-linkage.patch;hb=HEAD).

Please, help - did anybody build it with system ICU libs successfully?


----------



## hangover (Nov 23, 2010)

Created PR with ports for server and client.

server
client

Successfully compiles on 7.1, 7.3, 8.0, 8.1 - i386 and amd64.

Hope, it will be added to ports tree..


----------



## acm@ (Dec 21, 2010)

hangover said:
			
		

> Created PR with ports for server and client.
> 
> server
> client
> ...



Hey 

Now, firebird20-*, firebird21-* and firebird25-* ports are part of FreeBSD ports tree

Enjoy it


----------



## hangover (Dec 22, 2010)

Thank you, especially for 2.5!


----------



## indul (Jan 6, 2011)

Hi,
Thank you for the ports!
I can't install Firebird 2.1.3 (or 2.5.0) client from ports. The error message:


```
[...]
config.status: executing libtool commands

The Firebird2 package has been configured with the following options:

                   Architecture : ClassicServer
                          Debug : disabled
64 bit I/O for 32-bit platforms : enabled
                    Raw devices : enabled
                   Lock manager : enabled
                   Service name : gds_db
                   Service port : 3050
                   GPRE modules : c_cxx.cpp

                    Install Dir : /var/db/firebird

Now type `make' to compile Firebird2
===>  Building for firebird-client-2.1.3
==> Please do not build firebird as 'root' because this may cause conflicts with SysV semaphores of running services.
*** Error code 1

Stop in /usr/ports/databases/firebird21-client.
*** Error code 1
```
Without root privileges:

```
/usr/ports/databases/firebird25-client]$ make install clean
===>  License check disabled, port has not defined LICENSE
===>  Extracting for firebird-client-2.5.0
=> SHA256 Checksum OK for firebird/Firebird-2.5.0.26074-0.tar.bz2.
mkdir: /usr/ports/databases/firebird25-client/work: Permission denied
*** Error code 1

Stop in /usr/ports/databases/firebird25-client.
```

How can I solve this problem?
Thanx.


----------



## hangover (Jan 7, 2011)

To solve it just make

```
chown -R your_username /usr/ports/databases/firebird25*
```
without root privileges, and type root password when it will be queued.


----------



## indul (Jan 8, 2011)

Thank you!
Works like a dream!


----------



## martinrame (May 14, 2011)

It seems that I only have databases/firebird25-server. How can I get firebird25-client again?


----------



## martinrame (May 14, 2011)

Sorry, I just needed to run `portsnap extract` to rebuild the ports tree.


----------



## indul (May 18, 2011)

hangover said:
			
		

> Created PR with ports for server and client.
> 
> server
> client
> ...



OK, is this Firebird 32bit or 64bit application? I can't find any info about that.
(But it still works fine on amd64.)


----------



## hangover (May 19, 2011)

indul said:
			
		

> OK, is this Firebird 32bit or 64bit application? I can't find any info about that.
> (But it still works fine on amd64.)



Well, because it compiles from sources, it depends on machine architecture. If you compile it on amd64, it will be compiled for 64bit arch, and vice versa. You can see compilation parameters like that way:


```
# cd /usr/ports/databases/firebird25-server
# make patch
# cd work/Firebird-2.5.0.26074-0
# ./autogen.sh --without-editline
  *  *  *


The Firebird2 package has been configured with the following options:

                   Architecture : ClassicServer
                          Debug : disabled
                    Raw devices : enabled
                   Service name : gds_db
                   Service port : 3050
                   GPRE modules : c_cxx.cpp

                    Install Dir : /usr/local/firebird

Now type `make' to compile Firebird2
```


----------



## foxx (Jun 20, 2011)

Hi!

Is it possible to install SuperServer with the current port? (firebird 2.1.x). Since there is no *make config* I assume, that there is only ClassicServer available, but maybe there is different way to switch it.

I managed to install ClassicServer from ports, but unfortunately I need SuperServer.

Thank you.


----------

