Compiling on FreeBSD

Issue #9 resolved
Sean Iffland created an issue

I run swift on FreeBSD and last night upgraded a test node, but it wanted PyECLib installed which of course meant installing liberasurecode. Everything went fine except during the compile it dies due to -ldl in the test/makefile.am (lines 13,18 and 23), so i changed the following lines:

alg_sig_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/liberasurecode.la

liberasurecode_test_LDFLAGS = @GCOV_LDFLAGS@ $(top_srcdir)/src/liberasurecode.la -pthread

libec_slap_LDFLAGS = @GCOV_LDFLAGS@ $(top_srcdir)/src/liberasurecode.la -pthread

After that i received the following error:

Making all in builtin/xor_codes
Making all in builtin/null_code
Making all in test
  CCLD     liberasurecode_test
  CC       libec_slap-libec_slap.o
libec_slap.c:83:13: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
    if (pos < 0) {
        ~~~ ^ ~
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /root/liberasurecode/test
*** Error code 1

i edited the libec_slap.c file and removed the if statement (lines 83-85).

if (pos < 0) {
        return mask;
    }

then it compiled fine and seems to be working with no problems and there was much rejoicing. Is there any way we can get this fixed up so it compiles on FreeBSD. I know Openstack Swift is not really supported on FreeBSD but i still like to play.

Thanks,

Sean

Comments (6)

  1. Kevin Greenan

    @siffland Thanks! You are correct, we have not done much testing on FreeBSD. One of us will get a fix in this week.

  2. Sean Iffland reporter

    Also i forgot to mention i changed the -lpthreads to -pthreads in the lines above because that is what FreeBSD uses.

    Thanks for looking into this. I know FreeBSD is a little lesser used but it makes a small fast and stable swift host (and proxy). I look forward to a fix and testing it.

    Sean

  3. Shafiul hasan Account Deactivated

    I am getting the same error on OS X Yosemite (10.10.3). I commented the code and it is working fine. Please solve this issue.

  4. Log in to comment