[Gluster-devel] [Gluster-users] Compiling on Solaris 11

Benjamin Kingston list at nexusnebula.net
Tue Oct 14 09:54:46 UTC 2014


So I was able to compile gluster 3.3.2. on Solaris 11 and have it running a
volume now! Which is great, I couldn't be more excited.

What this brings to mind, however, is I am missing out on the newer
features and management commands I was used to in version 3.4, when I
started with gluster, and why recent glusters need contrib/mount/mntent.c
(which mentions Darwin, BSD, and Linux, but not Solaris)

Here's the make and configure commands I used to build 3.3.2. sucessfully,
however don't work on 3.4 or above

./autogen.sh
    gmake distclean
LDFLAGS="-L/opt/csw/lib" CC=/usr/gcc/4.8/bin/gcc CPP=/usr/gcc/4.8/bin/cpp
CFLAGS="-m64" ./configure --disable-crypt-xlator --disable-qemu-block
--disable-fusermount --disable-systemtap --disable-ibverbs
--disable-fuse-client --prefix=/opt/glusterfs;
gmake;

I also had to edit nlm4-xdr.h to change the u_init32 and u_init64 to
uinit32 and uinit64 to resolve a type unknown compile error.

One edit I would like some feedback on because it throws a warning instead
of failing before the edit is in posix.c. I don't know any programming so
this is pulled from stack overflow and applied as best I can. Any proof
reading before I consider this complete would be greatly appreciated.

The error:
In file included from ../../../../libglusterfs/src/xlator.h:61:0,
                 from posix.h:50,
                 from posix.c:49:
posix.c: In function ‘posix_fill_readdir’:
posix.c:3628:44: error: ‘struct dirent’ has no member named ‘d_type’
                         if (DT_ISDIR (entry->d_type)) {
                                            ^
the edit:

[BEFORE]
                if (skip_dirs) {
                        if (DT_ISDIR (entry->d_type)) {
                                continue;
                        } else if (hpath) {
                                strcpy (&hpath[len+1],entry->d_name);
                                ret = lstat (hpath, &stbuf);
                                if (!ret && S_ISDIR (stbuf.st_mode))
                                        continue;
                        }
                }

[AFTER]
                if (skip_dirs) {
                        struct stat s;
                        stat(entry->d_name, &s);
                        if (DT_ISDIR ((s.st_mode & S_IFDIR))) {
                                continue;
                        } else if (hpath) {
                                strcpy (&hpath[len+1],entry->d_name);
                                ret = lstat (hpath, &stbuf);
                                if (!ret && S_ISDIR (stbuf.st_mode))
                                        continue;
                        }
                }
/d_


On Sun, Oct 12, 2014 at 11:56 AM, Benjamin Kingston <list at nexusnebula.net>
wrote:

> I fixed that particular issue as ucred.h was in /usr/include not
> /usr/include/sys so I made a symlink, unfortunately now I'm getting a new
> issue here:
>
> ../../contrib/mount/mntent.c: In function `statfs_to_mntent':
> ../../contrib/mount/mntent.c:129:36: error: dereferencing pointer to
> incomplete type
>          _mntent.mnt_fsname = mntbuf->f_mntfromname;
>                                     ^
> ../../contrib/mount/mntent.c:130:33: error: dereferencing pointer to
> incomplete type
>          _mntent.mnt_dir = mntbuf->f_mntonname;
>                                  ^
> ../../contrib/mount/mntent.c:131:34: error: dereferencing pointer to
> incomplete type
>          _mntent.mnt_type = mntbuf->f_fstypename;
>                                   ^
> ../../contrib/mount/mntent.c:136:25: error: dereferencing pointer to
> incomplete type
>          f_flags = mntbuf->f_flags;
>                          ^
> ../../contrib/mount/mntent.c: In function `getmntent':
> ../../contrib/mount/mntent.c:160:17: warning: implicit declaration of
> function `getmntinfo' [-Wimplicit-function-declaration]
>                  mntsize = getmntinfo (&mntbuf, MNT_NOWAIT);
>                  ^
> ../../contrib/mount/mntent.c:160:48: error: `MNT_NOWAIT' undeclared (first
> use in this function)
>                  mntsize = getmntinfo (&mntbuf, MNT_NOWAIT);
>                                                 ^
> ../../contrib/mount/mntent.c:168:9: error: invalid use of undefined type
> `struct statfs'
>          return (statfs_to_mntent (&mntbuf[pos]));
>          ^
> ../../contrib/mount/mntent.c:168:42: error: dereferencing pointer to
> incomplete type
>          return (statfs_to_mntent (&mntbuf[pos]));
>                                           ^
> ../../contrib/mount/mntent.c:169:1: warning: control reaches end of
> non-void function [-Wreturn-type]
>  }
>  ^
>
> On Fri, Oct 10, 2014 at 8:48 PM, Benjamin Kingston <list at nexusnebula.net>
> wrote:
>
>> I went back and build 3.6 and 3.7 with the build failing in the same
>> place when building libglusterfs
>>
>>
>> One thing I did find as different in the master build f5d544d
>> <https://forge.gluster.org/glusterfs-core/glusterfs/commit/f5d544d435b1ca0868846e74ce292faa2e7388e4>
>> :
>>
>> ../../contrib/mount/mntent.c as I receive an error when compiling
>> libglusterfs stating sys/ucred.h is not found and mount.h.
>> I have the proper libraries in /usr/include, so I went to edit mntent.c
>> to point them there (still not sure if I should use
>> /usr/include/sys/mount.h or nfs/mount.h I tried both). I now get an error of
>>
>> ../../contrib/mount/mntent.c:169:1: warning: control reaches end of
>> non-void function [-Wreturn-type]
>>  }
>>
>> this may be a bug?
>>
>>
>> On Fri, Oct 10, 2014 at 6:13 PM, Benjamin Kingston <list at nexusnebula.net>
>> wrote:
>>
>>> I tried building the 3.6.0 tag last night to no avail, but I'll try the
>>> newer betas as well as the master branch tonight, maybe even the 3.7alpha
>>> for good measure. Good to hear about recent x-platform work, so maybe a
>>> hope.
>>>
>>> As a side note, I'm considering using Solaris 11 as a tcp/ip NFS brick
>>> to a Centos 7 node, would that be inadvisable? This isn't production, just
>>> a lab for the moment.
>>>
>>> On Fri, Oct 10, 2014 at 2:55 PM, Justin Clift <justin at gluster.org>
>>> wrote:
>>>
>>>> ----- Original Message -----
>>>> > I'm trying to get gluster 3.5.2, or really any version at this point,
>>>> to
>>>> > compile on Solaris so I can take advantage of ZFS and encryption. This
>>>> > would be a killer app for me, as I'm a big fan of gluster on linux,
>>>> but I'm
>>>> > running into a number of road blocks with compiling.
>>>> >
>>>> > any pointers or success stories will be greatly appreciated.
>>>>
>>>> As a thought, have you tried compiling 3.6.0 <latest beta>, or our
>>>> upstream
>>>> master branch?
>>>>
>>>> Asking because there's been a bunch of cross-platform portability work
>>>> happening over the last few months, which _might_ have made things
>>>> easier
>>>> for Solaris too (unsure).
>>>>
>>>> Worth a shot, just in case. :)
>>>>
>>>> Regards and best wishes,
>>>>
>>>> Justin Clift
>>>>
>>>> --
>>>> GlusterFS - http://www.gluster.org
>>>>
>>>> An open source, distributed file system scaling to several
>>>> petabytes, and handling thousands of clients.
>>>>
>>>> My personal twitter: twitter.com/realjustinclift
>>>> _______________________________________________
>>>> Gluster-users mailing list
>>>> Gluster-users at gluster.org
>>>> http://supercolony.gluster.org/mailman/listinfo/gluster-users
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20141014/c2c37c5b/attachment-0001.html>


More information about the Gluster-devel mailing list