Compare commits
5 Commits
OptionalLi
...
v0.1.8
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b0b419a22 | |||
| ec480f5a17 | |||
| 0109f66be3 | |||
| 75d6af4c8b | |||
| 815b78aa67 |
2
PKGBUILD
2
PKGBUILD
@@ -1,5 +1,5 @@
|
||||
pkgname=fantasize
|
||||
pkgver=0.1.7
|
||||
pkgver=0.1.8
|
||||
pkgrel=1
|
||||
pkgdesc='C++ fan control for Linux'
|
||||
url='https://github.com/Tabascl/fantasize.git'
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
BasedOnStyle: Google
|
||||
@@ -1,32 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(fantasize VERSION 0.1.7)
|
||||
project(fantasize VERSION 0.1.8)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
find_package(nlohmann_json 3.7 REQUIRED)
|
||||
find_package(Boost 1.80 COMPONENTS program_options log log_setup date_time REQUIRED)
|
||||
|
||||
find_library(NVML_LIB nvidia-ml)
|
||||
|
||||
set(ADDITIONAL_LIBS)
|
||||
|
||||
if (NVML_LIB)
|
||||
set(HAVE_NVML)
|
||||
|
||||
add_library(nvidia-sensor-lib STATIC
|
||||
src/sensor/NvidiaSensor.cxx
|
||||
src/sensor/GPUSensorsFacade.cxx)
|
||||
|
||||
target_link_libraries(nvidia-sensor-lib PUBLIC NVML_LIB)
|
||||
|
||||
list(APPEND ADDITIONAL_LIBS nvidia-sensor-lib)
|
||||
endif()
|
||||
find_package(nlohmann_json 3.11.2 REQUIRED)
|
||||
find_package(Boost 1.74 COMPONENTS program_options log log_setup date_time REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
src/main.cxx
|
||||
src/sensor/LMSensorsFacade.cxx
|
||||
src/sensor/GPUSensorsFacade.cxx
|
||||
src/sensor/Sensor.cxx
|
||||
src/sensor/NvidiaSensor.cxx
|
||||
src/sensor/LMSensor.cxx
|
||||
src/pwm/PWMControl.cxx
|
||||
src/pwm/PWMControlFacade.cxx
|
||||
@@ -44,8 +30,7 @@ add_executable(${PROJECT_NAME}
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC include /opt/cuda)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC sensors nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES} ${ADDITIONAL_LIBS})
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC sensors nvidia-ml nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION usr/local/bin)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unit/fantasize.service DESTINATION usr/lib/systemd/system)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/json/object.hpp>
|
||||
|
||||
#include <fan/Fan.h>
|
||||
#include <pwm/PWMControl.h>
|
||||
#include <sensor/Sensor.h>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef PWMCONTROL_H_
|
||||
#define PWMCONTROL_H_
|
||||
|
||||
#include <boost/json/object.hpp>
|
||||
#include <string>
|
||||
|
||||
#include <Printable.h>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include <fan/FanCurve.h>
|
||||
|
||||
#include <boost/log/attributes/named_scope.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <sstream>
|
||||
|
||||
#include <fan/FanCurve.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <App.h>
|
||||
|
||||
#define PROJECT_VERSION "v0.1.6"
|
||||
#define PROJECT_VERSION "v0.1.8"
|
||||
|
||||
namespace po = boost::program_options;
|
||||
namespace logging = boost::log;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#ifdef HAVE_NVML
|
||||
|
||||
#include <include/nvml.h>
|
||||
#include <sensor/NvidiaSensor.h>
|
||||
|
||||
#include <boost/json/object.hpp>
|
||||
#include <sensor/NvidiaSensor.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -27,5 +24,3 @@ json NvidiaSensor::toJson() const {
|
||||
json obj = {"NvidiaSensor", toString()};
|
||||
return obj;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,26 +3,20 @@
|
||||
using namespace std;
|
||||
|
||||
SensorManager::SensorManager()
|
||||
: mLMSensorsFacade(make_unique<LMSensorsFacade>())
|
||||
, mGPUSensorsFacade(make_unique<GPUSensorsFacade>())
|
||||
{
|
||||
}
|
||||
: mLMSensorsFacade(make_unique<LMSensorsFacade>()),
|
||||
mGPUSensorsFacade(make_unique<GPUSensorsFacade>()) {}
|
||||
|
||||
vector<shared_ptr<Sensor>> SensorManager::TemperatureSensors()
|
||||
{
|
||||
vector<shared_ptr<Sensor>> SensorManager::TemperatureSensors() {
|
||||
vector<shared_ptr<Sensor>> tempSensors;
|
||||
|
||||
tempSensors = mLMSensorsFacade->TemperatureSensors();
|
||||
|
||||
#ifdef HAVE_NVML
|
||||
auto gpuSensors = mGPUSensorsFacade->TemperatureSensors();
|
||||
tempSensors.insert(tempSensors.end(), gpuSensors.begin(), gpuSensors.end());
|
||||
#endif
|
||||
|
||||
return tempSensors;
|
||||
}
|
||||
|
||||
vector<shared_ptr<Sensor>> SensorManager::RPMSensors()
|
||||
{
|
||||
vector<shared_ptr<Sensor>> SensorManager::RPMSensors() {
|
||||
return mLMSensorsFacade->RPMSensors();
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ ExecStart=/usr/local/bin/fantasize
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=graphical.target
|
||||
|
||||
Reference in New Issue
Block a user