1 Commits

Author SHA1 Message Date
33a760489e Remove NVIDIA stuff 2023-07-23 18:04:17 +02:00
4 changed files with 31 additions and 36 deletions

View File

@@ -1,12 +1,12 @@
pkgname=fantasize
pkgver=0.1.9
pkgver=0.2.0
pkgrel=1
pkgdesc='C++ fan control for Linux'
url='https://github.com/Tabascl/fantasize.git'
source=("$pkgname-$pkgver.tar.gz::https://github.com/Tabascl/fantasize/archive/refs/tags/v$pkgver.tar.gz")
arch=('x86_64')
license=('GPL3')
makedepends=('git' 'cmake' 'nlohmann-json' 'boost' 'cuda')
makedepends=('git' 'cmake' 'nlohmann-json' 'boost')
sha256sums=('SKIP')
build() {

View File

@@ -10,9 +10,9 @@ find_package(Boost 1.74 COMPONENTS program_options log log_setup date_time REQUI
add_executable(${PROJECT_NAME}
src/main.cxx
src/sensor/LMSensorsFacade.cxx
src/sensor/GPUSensorsFacade.cxx
# src/sensor/GPUSensorsFacade.cxx
src/sensor/Sensor.cxx
src/sensor/NvidiaSensor.cxx
# src/sensor/NvidiaSensor.cxx
src/sensor/LMSensor.cxx
src/pwm/PWMControl.cxx
src/pwm/PWMControlFacade.cxx
@@ -30,8 +30,10 @@ 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 nvidia-ml nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
# target_include_directories(${PROJECT_NAME} PUBLIC include /opt/cuda)
target_include_directories(${PROJECT_NAME} PUBLIC include)
# target_link_libraries(${PROJECT_NAME} PUBLIC sensors nvidia-ml nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PUBLIC sensors 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)

View File

@@ -20,7 +20,7 @@
#include <App.h>
#define PROJECT_VERSION "v0.1.9"
#define PROJECT_VERSION "v0.2.0"
namespace po = boost::program_options;
namespace logging = boost::log;
@@ -29,32 +29,26 @@ App app;
static int doInitialSetup = 0;
void
signal_handler(int s)
{
app.Shutdown();
}
void signal_handler(int s) { app.Shutdown(); }
void
InitLogging(bool verbose)
{
void InitLogging(bool verbose) {
logging::add_console_log(
std::clog,
logging::keywords::format =
(logging::expressions::stream
<< "["
<< logging::expressions::format_date_time<boost::posix_time::ptime>(
"TimeStamp", "%Y-%m-%d %H:%M:%S")
<< "]["
<< logging::expressions::format_named_scope(
"Scope", logging::keywords::format = "%c")
<< "]"
<< "[" << logging::trivial::severity << "] "
<< logging::expressions::smessage));
std::clog,
logging::keywords::format =
(logging::expressions::stream
<< "["
<< logging::expressions::format_date_time<boost::posix_time::ptime>(
"TimeStamp", "%Y-%m-%d %H:%M:%S")
<< "]["
<< logging::expressions::format_named_scope(
"Scope", logging::keywords::format = "%c")
<< "]"
<< "[" << logging::trivial::severity << "] "
<< logging::expressions::smessage));
logging::add_common_attributes();
logging::core::get()->add_global_attribute(
"Scope", logging::attributes::named_scope());
"Scope", logging::attributes::named_scope());
BOOST_LOG_FUNCTION();
@@ -66,9 +60,7 @@ InitLogging(bool verbose)
}
}
int
main(int argc, char** argv)
{
int main(int argc, char **argv) {
BOOST_LOG_FUNCTION()
BOOST_LOG_TRIVIAL(info) << "Version: " << PROJECT_VERSION;
@@ -77,8 +69,8 @@ main(int argc, char** argv)
po::options_description desc("Allowed options");
desc.add_options()("help,h", "produce help message")(
"setup,s", po::bool_switch(), "run initial setup")(
"verbose,v", po::bool_switch(), "print debug info");
"setup,s", po::bool_switch(),
"run initial setup")("verbose,v", po::bool_switch(), "print debug info");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -98,7 +90,7 @@ main(int argc, char** argv)
app.Init();
app.NormalOperation();
}
} catch (const std::exception& e) {
} catch (const std::exception &e) {
std::cout << "An exception was caught: " << e.what() << std::endl;
}

View File

@@ -11,8 +11,9 @@ vector<shared_ptr<Sensor>> SensorManager::TemperatureSensors() {
tempSensors = mLMSensorsFacade->TemperatureSensors();
auto gpuSensors = mGPUSensorsFacade->TemperatureSensors();
tempSensors.insert(tempSensors.end(), gpuSensors.begin(), gpuSensors.end());
// auto gpuSensors = mGPUSensorsFacade->TemperatureSensors();
// tempSensors.insert(tempSensors.end(), gpuSensors.begin(),
// gpuSensors.end());
return tempSensors;
}