May 28, 2012

Build the latest ownCloud-client git in Ubuntu 12.04

owncloud logo

I have the need to use a not-yet released version of ownCloud-client in my Ubuntu 12.04 Precise Pangolin.
The official build instructions are perhaps too generic and confusing for non-expert users. Additionally, there are several non-explained dependencies that must be installed, some of them unique to Ubuntu (maybe even to Debian). I wrote this tutorial that explains what to do in order to obtain latest, cutting-edge source code of csync and mirall (ownCloud-client) and install it.

Before we start, let me note that I wrote this post several days after I built the required software. There may be some omissions in the dependencies retrieiving. If any, either contact me or write a comment on this post and we will fix it.

First, install the dependencies already offered by the Ubuntu repositories:

Then, install libiniparser and libiniparser-dev from ownCloud repository. Download libiniparser_3.xx_i386.deb and libiniparser-dev_3.xx_i386.deb from the i386 repository or from the x64 (amd64) repository.

Install them using the Software Center or with the command line:

Create a source directory, clone csync project and use ownCloud’s dedicated branch

Prepare the build directory for csync and build it

Clone and install krazy2 tool (a requirement for mirall).

Checkout the mirall project, create a build dir. Add Krazy2 in $PATH, otherwise the build fails. Compile mirall

The development tests automatically run with the make command and some may fail. Eventually, the executable still builds and appears in ~/src/buildmirall/bin/owncloud.

Remember that this is unreleased software. It may contain lots of bugs, some of them still undiscovered. It is a good idea to report issues to the developers. Remember to be polite and respect their work, because they do that for free and on their free time.

If you want to update your source files with the latest commits in the repositories, just cd to the repository directories (~src/mirall, ~src/csync, and ~src/krazy) and input the git pull command. You have to build the programs again if changes in the code happen.

written by dgraziotin

Dr. Daniel Graziotin received his PhD in computer science, software engineering at the Free University of Bozen-Bolzano, Italy. His research interests include human aspects in empirical software engineering with psychological measurements, Web engineering, and open science. He researches, publishes, and reviews for venues in software engineering, human-computer interaction, and psychology. Daniel is the founder of the psychoempirical software engineering discipline and guidelines. He is associate editor at the Journal of Open Research Software, academic editor at the Research Ideas and Outcomes (RIO) journal, and academic editor at the Open Communications in Computer Science journal. He is the local coordinator of the Italian Open science local group for the Open Knowledge Foundation. He is a member of ACM, SIGSOFT, and IEEE.

  • OlliW Jun 12, 2012 Reply

    Thanks, I’m trying this but I get stuck at the mirall checkout:
    git checkout git://gitorious.org/owncloud/mirall.git

    fatal: Not a git repository (or any parent up to mount parent )
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

    Any ideas? (I’m not very good with git)

    • OlliW Jun 12, 2012 Reply

      Ok, I did a git clone instead of checkout and that worked…
      However I think there is some dependency missing in these instructions, because during cmake of mirall I get this:

      cmake -DCMAKE_BUILD_TYPE=”Debug” ../mirall
      Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as /usr/lib/i386-linux-gnu
      Warning: But QtCore couldn’t be found. Qt must NOT be installed correctly, or it wasn’t found for cross compiling.
      CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:594 (MESSAGE):
      Could NOT find QtCore. Check

      • dgraziotin Jun 12, 2012 Reply

        Hello and thank you for your report. I’ve just corrected the post.
        The error about the missing QtCore is because you are missing the QT libraries. This is my fault, I forgot to add them to the post.
        To be safe, do a

        If you install the development environment for the Qt framework (QtCreator), you are safe to throw in the dependencies.
        Just as a side note: the current last revision of mirall fails to build because of this error. We probably have to wait for an update to csync, because it looks like the error is caused by a (temporary) missing functionality to csync.

  • OlliW Jun 12, 2012 Reply

    Ah yes, thanks that did it, and building fails indeed. I’ll pull again in a couple of days and see if it works then 🙂

    • dgraziotin Jun 13, 2012 Reply

      I will tell you a secret: comment out line 336 of ~/src/mirall/src/mirall/application.cpp and it will build fine. Just be aware that the next pull may fail because of conflicts (if any).

      • OlliW Jun 15, 2012 Reply

        A great, I’ve pulled succesfully today and with your suggestion I was able to build and run it (so far so good).

        The line number was no longer correct, but I figured it was just a matter of commenting out the “csync_set_log_callback” bit and that worked fine.

        I’m pretty happy so far, so I’ll leave it until someone builds a new binary. Thanks so much for your help!

  • Hong Jul 1, 2012 Reply

    first, I’m very thank you for your post. 🙂
    In denpendencies, only ‘libiniparser-dev’ and ‘libiniparser’ is no found.

    So i cant further proceed.

    My OS is Ubuntu 12.04 LTS. is it problem??

    thank you!

    • dgraziotin Jul 2, 2012 Reply

      Hello Hong,
      As I replied in your e-mail, I am using your same Ubuntu version. The error that you receive looks strange, because you should have libiniparser installed after the first command in this how-to.

      What happens if you try to

      Do you receive any errors?

      • ventoux Aug 3, 2012 Reply

        Hi. I’m getting the same problem. The issue is that it doesn’t actually get installed on the first command as it can’t locate those files.

        When I run the command on it’s own:

        sudo apt-get install libiniparser libiniparser-dev

        I get a message back:

        E: Unable to locate package libiniparser
        E: Unable to locate package libiniparser-dev

        I checked my software centre and all my software repositories are ticked.

        I’m using Ubuntu 12.04 also.

        Any ideas?

        • trevorj Aug 19, 2012 Reply

          @ventoux and @Hong

          I ran into the same problem; it appears that libiniparser is a SuSE project but you can grab the source deb (or binary) from the owncloud Ubuntu repository on the client download page.

          • dgraziotin Aug 19, 2012

            This solves the mystery. I was having the repository enabled but I did not realize that libiniparser comes from there.
            Thank you, trevorj.

  • dgraziotin Aug 21, 2012 Reply

    The post has been updated with the new dependencies (added libssl-dev, libtie-ixhash-perl) and with the correct instructions on installing libiniparser and libiniparser-dev

  • Alexander Javier Salas Bastidas Aug 27, 2012 Reply

    undefined reference to `csync_set_log_callback’

    • Alexander Javier Salas Bastidas Aug 27, 2012 Reply

      You need to enable LOG_TO_CALLBACK in DefineOptions.cmake for csync before compiling mirall. So make the change above in csync, compile csync then compile mirall.

  • Alexander Javier Salas Bastidas Aug 27, 2012 Reply

    I need build for Windows!!!

  • miltonlab Oct 20, 2012 Reply

    i too need build for Windows, help me please

  • miltonlab Oct 22, 2012 Reply

    But i need recompile the source code of the client to do modifications and generate the windows version, exist some article over about it

  • Max Nov 5, 2012 Reply

    Thanks for the guide!

    I run into these errors on linux mint 13 which would probably happen on other distros:

    1. typo on libcsync.so rather than libocsync.so?

    make[2]: *** No rule to make target /home/mmongardini/src/mirall/../buildcsync/src/libcsync.so', needed by src/libmirallsync.so’. Stop.
    make[1]: *** [src/CMakeFiles/mirallsync.dir/all] Error 2
    make: *** [all] Error 2

    I guess it’s another typo:
    mmongardini@macs-nb ~/ $ cd ~/src/buildcsync/src
    mmongardini@macs-nb ~/src/buildcsync/src $ ln -sf libocsync.so libcsync.so

    2. as described in the comments, mirall won’t compile csync log_to_callback
    Linking CXX executable ../bin/mirall
    CMakeFiles/mirall.dir/mirall/application.cpp.o: In function Mirall::Application::setupLogBrowser()':
    /home/mmongardini/src/mirall/src/mirall/application.cpp:373: undefined reference to
    collect2: ld returned 1 exit status
    make[2]: *** [bin/mirall] Error 1
    make[1]: *** [src/CMakeFiles/mirall.dir/all] Error 2
    make: *** [all] Error 2

    comment out the line (373 currently):
    csync_set_log_callback( csyncLogCatcher );
    and make again.

  • Max Nov 5, 2012 Reply

    slightly confused now…

    why has it built 1.0.5 and not the latest?

    • dgraziotin Nov 5, 2012 Reply

      Hello Max and thanks for the previous comment.
      I think they are moving to Github now. Try to clone git://github.com/owncloud/mirall.git instead

      • billy Feb 28, 2013 Reply

        Hallo I got confused by which tool is the IDE to develop owncloud client?Is it Qtcreator?
        But i can not find the .PRO file in the source code..
        Sorry for my poor english!

  • gillbert Nov 14, 2012 Reply

    Good work!

    I have the same problem as Max, how I can fix it?

    make[2]: *** No rule to make target /home/mmongardini/src/mirall/../buildcsync/src/libcsync.so’, needed by src/libmirallsync.so’. Stop.
    make[1]: *** [src/CMakeFiles/mirallsync.dir/all] Error 2
    make: *** [all] Error 2

  • scott Oct 10, 2013 Reply

    hello,when i do the step “cmake -DCMAKE_BUILD_TYPE=”Debug” ../mirall”,I encount as follow:
    CMake Warning (dev) at cmake/modules/FindNeon.cmake:67 (SET):
    Cannot set “NEON_WITH_LFS”: current scope has no parent.
    Call Stack (most recent call first):
    CMakeLists.txt:78 (find_package)
    This warning is for project developers. Use -Wno-dev to suppress it.

    CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
    Could NOT find Csync (missing: CSYNC_LIBRARY)

    please help,wait for your response

    • scott Oct 10, 2013 Reply

      urgently help! I have saved the above problem with the commond:

      cmake -DCMAKE_BUILD_TYPE=”Debug” ../mirall \
      -DCSYNC_BUILD_PATH=/home/hadoop/src/ocsync-build \
      -DCSYNC_INCLUDE_PATH=/home/hadoop/src/ocsync/src .

      But when I run make it says:
      /home/hadoop/src/mirall/src/mirall/csyncthread.h:37:1: error: ‘CSYNC_STATUS’ was not declared in this scope

      I encount the follow problem:
      /home/hadoop/src/mirall/src/mirall/csyncthread.h:37:1: error: ‘CSYNC_STATUS’ was not declared in this scope

      And I search some documentation,so I add following to csync.h :
      typedef enum csync_status_codes_e CSYNC_STATUS;

      Now it shows :
      error: cannot convert ‘void (*)(int, const char*, const char*, void*)’ to ‘CSYNC* {aka csync_s*}’ for argument ‘1’ to ‘int csync_set_log_callback(CSYNC*, csync_log_callback)’
      /home/hadoop/src/mirall/src/mirall/folder.cpp:104:33: error: ‘csync_set_log_level’ was not declared in this scope
      /home/hadoop/src/mirall/src/mirall/folder.cpp:114:124: error: ‘csync_get_status_string’ was not declared in this scope

      No matter how many I add to csync.h it always shows some problem like this.

      This problem I haved before but I have not solved yet,and I do not know how to handle it.please help me !

  • José Carvalho Feb 17, 2014 Reply

    At first thanks for the article, it was very useful!
    I can sucefully compile mirall and “make package”, but i only got the .sh file and the .tar.gz file… I wanted to build the .deb package but i’m getting this error “CMake Error at /usr/share/cmake-2.8/Modules/CPackDeb.cmake:123 (MESSAGE):
    CPackDeb.cmake may only be used by CPack internally.”

    can someone help? thanks!

  • shiva Aug 5, 2014 Reply

    hi dude i success completed mirall package but i doknw were it is located pls help me

  • shiva Mar 11, 2015 Reply

    hi i came across your source for developing the owncloud client for windows..however i m newbie to this cross compile…i can forward in all ways but it always fails..i was stucked in these lines cmake -DCMAKE_BUILD_TYPE=”Debug” ../mirall…can u help by using any video tutorial..so tat i completed my project.
    thanks in advance.

Leave a comment