Trying to build 1.28 on Ubuntu 14x

Forum for questions and support relating to the 1.28.x releases only.
Locked
User avatar
Basildane
Posts: 108
Joined: Mon Sep 16, 2013 1:09 pm

Trying to build 1.28 on Ubuntu 14x

Post by Basildane »

I get to the step where I would "cmake -C zm_conf.cmake ."
But I get an error:

Code: Select all

--   package 'polkit-gobject-1' not found
-- Could NOT find Polkit (missing:  POLKIT_LIBRARIES POLKIT_INCLUDE_DIR)
CMake Error at CMakeLists.txt:484 (message):
  Running ZoneMinder requires polkit.  Building ZoneMinder requires the
  polkit development package.
The thing is, I installed polkit using "apt-get install gksu-polkit", and it said it installed successfully.
I've been at this for about 5 hours now and I cannot figure it out.
Any hints please?
c128
Posts: 88
Joined: Sat Sep 14, 2013 3:36 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by c128 »

Not tried building Zoneminder from scratch, but, it looks like you're missing the polkit dev package http://packages.ubuntu.com/search?keywo ... polkit-dev ?

"apt-get install gksu-polkit-dev"

Added Later

mmm...oh maybe not, an 14.04 - not sure what the equivalent package is in later Ubuntu releases.
User avatar
Basildane
Posts: 108
Joined: Mon Sep 16, 2013 1:09 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by Basildane »

OK, I tried gksu-polkit-dev.
Looking at the page you referenced, Ubuntu says there is libmatepolkit-dev for Ubuntu 14.04.
So I installed that too.

Still get the same error about polkit not installed.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Trying to build 1.28 on Ubuntu 14x

Post by knight-of-ni »

Each pull request submitted to zoneminder is tested using a service called Travis. This builds zoneminder in an Ubuntu environment, with the propsoed pull request, to verify that zoneminder will still build.

You can use this knowledge to find out what Ubuntu pacakges are required to build the latest version of zoneminder.

Look here:
https://github.com/ZoneMinder/ZoneMinde ... travis.yml

As you can see, it installed the "libpolkit-gobject-1-dev" package, which matches the name of the library that cmake was complaining about.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
Basildane
Posts: 108
Joined: Mon Sep 16, 2013 1:09 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by Basildane »

Thank you, that fixed the problem with polkit.
The big question I still have is where do you usually build from?
/usr/local/src ?
/usr/src ?

I have tried to find something that satisfies the compiler, but I still get fatal error: linux/videodev.h: No such file or directory

I'm trying to build in /usr/src.
I'm interested in best practice, so I would adjust it to whatever you guys use.
c128
Posts: 88
Joined: Sat Sep 14, 2013 3:36 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by c128 »

Is that actually related to the Zoneminder source location though?

Speaking a bit from ignorance here, as I haven't built Zoneminder, but I'd expect that failure to be the result of a header not being picked up by the compiler from an include path, and the include path being set to a dev library installed header again.

Did you try installing all the package dependencies linked from the yaml file that knnniggett linked?
User avatar
Basildane
Posts: 108
Joined: Mon Sep 16, 2013 1:09 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by Basildane »

I did install the complete list of dependencies from the travis file.
That's not the problem now, the problem seems to be confusion over the configuration of the build environment. I see some things are built using the prefix /usr, and it appears in the cmake logs that zoneminder is looking for some headers in /usr/local, which is causing the error about the missing videodev.h.

I'm trying to figure out how to configure cmake to run correctly. There are multiple documents about how to compile zoneminder and they are all conflicting. Some say you run ./configure, some say you don't....

I have extensive notes from building 1.27 that I saved, but they are not working now. That machine failed and had to be rebuilt, and that's why I'm in this situation now.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Trying to build 1.28 on Ubuntu 14x

Post by knight-of-ni »

The short answer to your best practices question is, for non-developers, don't build from source. Install from package instead.

I don't mean to sound discouraging, but iconnor & I build and maintain deb/rpm packages specifically so that people don't have to fill up the forum with basic "how do I build" questions. Here are the Ubuntu packages:
https://launchpad.net/~iconnor/+archive ... zoneminder

Ubuntu users can even run nightly builds if you like to stay on the bleeding edge of things.

If you really want to go down the build from source path, then here are some additional tips as you are getting off base with your build process:
  • On any Linux machine, software built from source will install under "/usr/local" and software installed from package will have a prefix of "/usr". This is called the Prefix and will be chosen automatically for you. Don't override this. You will get yourself into trouble if you do.
  • There are two methods to build ZoneMinder. The traditional method is autotools, and the newer method is cmake. You need to use one or the other; not both. You can't read documentation that applies to autotools and expect it to apply when using cmake. If the documentation mentions running "configure" or "bootstrap" (or really anything other than some form of “cmake .”) then that only applies to autotools. It won't work if you are using cmake.
  • Google it! If you get an error message complaining about some file, then Google the file name. Googling videodev.h reveals that this header file is part of Video for Linux version 1 (v4l1). Newer versions of Ubuntu have migrated to v4l version 2 (v4l2).

You have not provided the output from your build process or the contents of your cmake cache file, so I can only guess here. My guess is that cache file you are using came from a system that had v4l1 and your new system no longer has that on it. You can try to dissect your cache file and edit the file appropriately. However, you are probably better off not using the cache file at all. Just run “cmake .” and let it autodetect your system.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
Basildane
Posts: 108
Joined: Mon Sep 16, 2013 1:09 pm

Re: Trying to build 1.28 on Ubuntu 14x

Post by Basildane »

Thanks for the feedback and I will work on what you suggested.
I want to answer your comment about "I shouldn't build from source".

I am not trying to be on the bleeding edge, and I don't WANT to build from source. My only goal is have a working system.

Back in 1.27 there was a serious problem, the "red screen" problem that caused my system and many others to be unusable. Being an open source developer myself, I dug in and found the problem and even gave you the fix to the function that was failing. Since then, my system has been 100% perfect. That server has not even been restarted since then.

Saturday, I decided it was time to bite it and upgrade my server to 14.04. I'm trying to get back to a working system. I don't know if you implemented the fix for unreliable channels in ffmpeg, I haven't looked at the source for 1.28 yet. But, step one was for me to get it compiled. No one seemed to take me seriously, or even acknowledge that red screens every morning were a problem. So be it.

Yes, I was able to run 1.28 from apt-get install, and for the past 24 hours it has been stable... Time will tell.

Thanks for taking the time to respond and thanks for zoneminder.
Locked