Uploaded image for project: 'UGENE'
  1. UGENE
  2. UGENE-2664

FreeBSD build problems

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.13
    • Fix Version/s: 1.13.2
    • Component/s: None
    • Labels:
      None
    • Tests Type:
      Untestable
    • Sprint:
      DEV-20/02/2014, DEV-27/02/2015, DEV-06/03/2014

      Description

      1) in src/plugins/dbi_bam/src/BAMDbiPlugin.h, in BAMImporterTask class,
      there is a private field startTime of type "time_t", but no #include of
      <time.h>. GCC/glibc do not care, but strictly speaking, it is required.

      2) in src/plugins/test_runner/src/TestViewReporter.h, in prepareHTMLText()
      private method, there is parameter with default value: int runTime=NULL,
      which is wrong: you should not mix 'int' and 'nullprt_t', it should be =0.

      1-2 - ugene-clang-fixes.diff patch

      3) In Ugene's external_tool_support directory, there are lots of code like
      this (or similar):

      #if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
      paths = pathEnv.split("=").at(1).split(":");
      #elif defined(Q_OS_WIN)
      paths = pathEnv.split("=").at(1).split(";");
      #endif

      The code is correct, but why limit ":"-case to just Linux and Mac? ":"
      is used probably on any modern Unix system. Attached patchset (covers over 20 source files) changes the check to #if defined(Q_OS_UNIX). It does not break existing behavior, yet allows Ugene to work on BSD and other systems. If I missed any, please fix them in a similar way, thank you.

      3 - ugene-unix-path-separator.diff patch

      4) This one is a bit controversial: while X11 stuff seems like overall-Unix,
      Q_OS_UNIX might also be defined for MacOSX. However, leaving it as it is
      right now (under Q_OS_LINUX) is wrong for FreeBSD (and many other Unices that use X11 for graphics).

      Consider attached patch. This is what I use currently for Ugene FreeBSD
      package, but if you'd like, feel free to change condition to e.g.

      #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)

      4 - ugene-X11-unix.diff patch

      5) Ugene has some of system-specific code to obtain 1) total physical memory;
      and 2) application current memory. On Linux, it reads from /proc/meminfo
      for 1st and looks inside struct proc_t.vsize for 2nd. Both are Linux-
      specific, yet for the 1st (total mem) it can be made POSIX-compliant – so
      it can work under Linux, *BSD, etc.

      POSIX.1 (IEEE Std 1003.1-1988) defines standard sysconf(3) interface to
      obtain some interesting numbers about the system. Particularly, take a
      look at _SC_PHYS_PAGES and _SC_PAGESIZE. Multiplying them will give you the same number you read from /proc/meminfo (but in bytes). This way is not only more portable, but also allows not to call external programs, e.g. awk(1), which is good.

      For the 2nd, on FreeBSD, I've decided to call ps(1) to obtain "vsize"
      value of the process. I don't like calling external programs, but this
      way I avoid linking against libkvm. I might rethink this in the future;
      for now it should be OK.

      Take a look at attached patches. With them, Ugene becomes fully FreeBSD ready (well, almost – more patches to come, but this patchset is the most important one).

      Comment about src/ugeneui/src/Main.cpp patch: checking for both Q_OS_LINUX and Q_OS_UNIX is redundant: Q_OS_UNIX is defined on Linux. Checking for Q_OS_MAC and Q_OS_LINUX is not very good: it leaves out other *nix OSes, so I also changed that to simply Q_OS_UNIX.

      5 - ugene-patchset1.zip

        Attachments

        1. ugene-clang-fixes.diff
          0.7 kB
          Yuliya Algaer
        2. ugene-unix-path-separator.diff
          19 kB
          Yuliya Algaer
        3. ugene-X11-unix.diff
          0.5 kB
          Yuliya Algaer

          Activity

            People

            Assignee:
            dkandrov Denis Kandrov
            Reporter:
            yalgaer Yuliya Algaer
            Assigned Tester:
            Ivan Protsyuk
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified