homer6 / frequent-cron

A linux daemon that you can call scripts more frequently than once per minute. This is extremely stable and runs in production for a number of systems.
49 stars 8 forks source link

Does not build on Ubuntu Focal Fossa #9

Open Kramerican opened 4 years ago

Kramerican commented 4 years ago

Howdy

Love Frequent Cron. Anyway, it no longer builds on the latest Ubuntu:

# cd /root/frequent-cron; cmake .; make;
CMake Warning (dev) at src/CMakeLists.txt:3 (add_executable):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "../frequent-cron" is reserved or not valid for certain
  CMake features, such as generator expressions, and may result in undefined
  behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- GCC detected, adding compile flags
-- Configuring done
-- Generating done
-- Build files have been written to: /root/frequent-cron
[ 50%] Linking CXX executable ../frequent-cron
/usr/bin/ld: CMakeFiles/../frequent-cron.dir/frequent.cc.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/../frequent-cron.dir/build.make:86: src/../frequent-cron] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: src/CMakeFiles/../frequent-cron.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Googling reveals this seems to be Boost related. apt reports:

# apt-get install libboost-all-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-all-dev is already the newest version (1.71.0.0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

Thanks :)

Kramerican commented 4 years ago

Without knowing what the hell I'm doing, I figured I'd try the suggestion from here:

https://github.com/facebook/Surround360/issues/3

And added SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread") to CMakeLists.txt so it becomes:

cmake_minimum_required(VERSION "2.8.0")
set(MAIN_EXECUTABLE frequent-cron)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")

project(${MAIN_EXECUTABLE} CXX C)
add_subdirectory(src)

Seems to totally work. But I'd love to get confirmation that it is OK/correct to do this :D

homer6 commented 4 years ago

Thanks for this @Kramerican !

Yeah, I think I'll remove the boost dependency. It's a bit of an overkill to require it for this and it causes headaches with newer versions.

Any thoughts on the oldest linux versions that we should support? I was thinking support for Ubuntu 14 and newer is probablly fine.

Kramerican commented 4 years ago

My two cents would be that Ubuntu 14+ is plenty conservative enough :)