feat: targz runtime libraries

This commit is contained in:
parker
2025-08-14 22:14:51 +01:00
parent 3557c4d4e7
commit 7b823f42f3
24 changed files with 142 additions and 38 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
build
docker
docs
.git
.github
Doxyfile

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ build
docs/html docs/html
docs/latex docs/latex
perf.data* perf.data*
artifacts

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.30) cmake_minimum_required(VERSION 3.26)
# set vars # set vars
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -79,7 +79,7 @@ find_package(glm REQUIRED)
find_package (Eigen3 3.3 REQUIRED NO_MODULE) find_package (Eigen3 3.3 REQUIRED NO_MODULE)
# tbb # tbb
find_package(TBB REQUIRED COMPONENTS TBB::tbb) find_package(TBB REQUIRED COMPONENTS tbb)
find_package(Boost REQUIRED COMPONENTS filesystem system) find_package(Boost REQUIRED COMPONENTS filesystem system)
@@ -104,15 +104,68 @@ set(CPACK_GENERATOR "RPM;TGZ")
set(ENZO_BIN_DIR ${CMAKE_PROJECT_NAME}/bin) set(ENZO_BIN_DIR ${CMAKE_PROJECT_NAME}/bin)
set(ENZO_LIB_DIR ${CMAKE_PROJECT_NAME}/lib) set(ENZO_LIB_DIR ${CMAKE_PROJECT_NAME}/lib)
install(
TARGETS ${AppExec} set_target_properties(${AppExec} PROPERTIES
RUNTIME DESTINATION ${ENZO_BIN_DIR} INSTALL_RPATH "$ORIGIN/../lib;$ORIGIN/../../lib"
LIBRARY DESTINATION ${ENZO_LIB_DIR}
ARCHIVE DESTINATION ${ENZO_LIB_DIR}
) )
include(CPack) include(CPack)
# cpack_add_component("runtimes")
# cpack_add_component("tgz-runtimes")
install(TARGETS ${AppExec}
RUNTIME DESTINATION ${ENZO_BIN_DIR}
LIBRARY DESTINATION ${ENZO_LIB_DIR}
ARCHIVE DESTINATION ${ENZO_LIB_DIR}
# COMPONENT "runtimes"
)
# install(TARGETS ${AppExec}
# RUNTIME_DEPENDENCY_SET app_deps
# RUNTIME DESTINATION ${ENZO_BIN_DIR}
# LIBRARY DESTINATION ${ENZO_LIB_DIR}
# ARCHIVE DESTINATION ${ENZO_LIB_DIR}
# COMPONENT "tgz-runtimes"
# )
# install(RUNTIME_DEPENDENCY_SET app_deps
# DIRECTORIES "${CMAKE_BINARY_DIR}"
# PRE_EXCLUDE_REGEXES
# "libc.so.*" "libm.so.*" "libpthread.so.*" "librt.so.*" "libdl.so.*"
# "libgcc_s.so.*" "libstdc++.so.*"
# DESTINATION ${ENZO_LIB_DIR}
# COMPONENT "tgz-runtimes"
# )
# install(
# DIRECTORY /usr/lib64/qt6
# DESTINATION ${CMAKE_PROJECT_NAME}
# COMPONENT "tgz-runtimes"
# )
# install(
# DIRECTORY /usr/lib64/
# DESTINATION ${ENZO_LIB_DIR}
# COMPONENT "tgz-runtimes"
# FILES_MATCHING PATTERN "*Qt*.so*"
# )
# file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/packaging/qt.conf
# "[Paths]
# Plugins = ../qt6/plugins
# Libraries = ../lib
# ")
# install(
# FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/qt.conf
# DESTINATION ${ENZO_BIN_DIR}
# COMPONENT "tgz-runtimes"
# )
# set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1.1, zlib >= 1.2.11") # set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1.1, zlib >= 1.2.11")
# --- end packaging # --- end packaging

View File

@@ -2,5 +2,5 @@
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja .. cmake -DCMAKE_BUILD_TYPE=Build -G Ninja ..
ninja ninja

View File

@@ -1,12 +1,21 @@
if (CPACK_GENERATOR MATCHES "RPM") MESSAGE(STATUS "GENERATOR: ${CPACK_GENERATOR}")
if (${CPACK_GENERATOR} STREQUAL "RPM")
# rpm specific config # rpm specific config
MESSAGE(STATUS "RPM")
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL "runtimes")
if(UNIX) if(UNIX)
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")
endif(UNIX) endif(UNIX)
elseif(CPACK_GENERATOR MATCHES "TGZ") elseif(${CPACK_GENERATOR} STREQUAL "TGZ")
# tgz specific config # tgz specific config
MESSAGE(STATUS "TGZ")
set(CPACK_TGZ_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL "tgz-runtimes")
endif() endif()

View File

@@ -0,0 +1,33 @@
FROM rockylinux:9
LABEL Description="Build environment"
WORKDIR /work
RUN dnf -y install dnf-plugins-core
# Enable CRB (CodeReady Builder on EL9)
RUN dnf config-manager --set-enabled crb
# Add EPEL on UBI by installing the release RPM
RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN dnf install -y \
tar \
rpm-build \
git \
cmake \
ninja-build \
qt6-qtbase-devel \
qt6-qtsvg-devel \
eigen3-devel \
glm-devel \
tbb \
tbb-devel \
boost-devel \
CGAL-devel
COPY . .
RUN ./build.sh
RUN cd build && cpack -G RPM

3
docker/builds/build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
podman buildx build -f Dockerfile.rocky9 --output ./artifacts/rocky9 ../../

View File

@@ -1,5 +1,4 @@
#pragma once #pragma once
#include <oneapi/tbb/concurrent_vector.h>
#include <string> #include <string>
#include <optional> #include <optional>
#include <string_view> #include <string_view>

View File

@@ -3,8 +3,8 @@
#include "Engine/Operator/AttributeHandle.h" #include "Engine/Operator/AttributeHandle.h"
#include "Engine/Types.h" #include "Engine/Types.h"
#include <memory> #include <memory>
#include <oneapi/tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
#include <oneapi/tbb/task_group.h> #include <tbb/task_group.h>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <CGAL/Polygon_mesh_processing/orientation.h> #include <CGAL/Polygon_mesh_processing/orientation.h>

View File

@@ -5,7 +5,7 @@
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include "Engine/Operator/AttributeHandle.h" #include "Engine/Operator/AttributeHandle.h"
#include <memory> #include <memory>
#include <oneapi/tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
#include <tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
#include <variant> #include <variant>

View File

@@ -1,4 +1,4 @@
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include "Engine/Operator/GeometryOpDef.h" #include "Engine/Operator/GeometryOpDef.h"
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>

View File

@@ -101,13 +101,12 @@ void enzo::op::OperatorTable::initPlugins()
static bool pluginsLoaded=false; static bool pluginsLoaded=false;
if(pluginsLoaded) return; if(pluginsLoaded) return;
// auto initPlugin = boost::dll::import_symbol<void(enzo::op::addOperatorPtr)>( using InitPluginFn = void(enzo::op::addOperatorPtr);
// "build/src/OpDefs/libenzoOps1.so", "newSopOperator"
// );
auto initPlugin = boost::dll::import_symbol<void(enzo::op::addOperatorPtr)>(
findPlugin("enzoOps1"), "newSopOperator"
);
const auto so = findPlugin("enzoOps1");
static boost::dll::shared_library lib(so, boost::dll::load_mode::default_mode);
auto initPlugin = lib.get<InitPluginFn>("newSopOperator");
initPlugin(enzo::op::OperatorTable::addOperator); initPlugin(enzo::op::OperatorTable::addOperator);
pluginsLoaded = true; pluginsLoaded = true;

View File

@@ -1,6 +1,7 @@
#include "Gui/Network/NetworkGraphicsView.h" #include "Gui/Network/NetworkGraphicsView.h"
#include <QGraphicsItem> #include <QGraphicsItem>
#include "Gui/Network/Network.h" #include "Gui/Network/Network.h"
#include <QCoreApplication>
#include "Gui/Network/NetworkGraphicsScene.h" #include "Gui/Network/NetworkGraphicsScene.h"
#include "Gui/Network/SocketGraphic.h" #include "Gui/Network/SocketGraphic.h"
#include <iostream> #include <iostream>

View File

@@ -5,8 +5,8 @@
#include "Engine/Operator/Geometry.h" #include "Engine/Operator/Geometry.h"
#include "Engine/Types.h" #include "Engine/Types.h"
#include <CGAL/Polygon_mesh_processing/compute_normal.h> #include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <oneapi/tbb/blocked_range.h> #include <tbb/blocked_range.h>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include "icecream.hpp" #include "icecream.hpp"

View File

@@ -4,8 +4,8 @@
#include <glm/fwd.hpp> #include <glm/fwd.hpp>
#include <CGAL/Polygon_mesh_processing/compute_normal.h> #include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <glm/geometric.hpp> #include <glm/geometric.hpp>
#include <oneapi/tbb/blocked_range.h> #include <tbb/blocked_range.h>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include "Engine/Types.h" #include "Engine/Types.h"
#include "Gui/Viewport/GLCamera.h" #include "Gui/Viewport/GLCamera.h"
#include "icecream.hpp" #include "icecream.hpp"

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.30) cmake_minimum_required(VERSION 3.26)
project(enzoOps1) project(enzoOps1)

View File

@@ -2,7 +2,7 @@
#include "Engine/Operator/AttributeHandle.h" #include "Engine/Operator/AttributeHandle.h"
#include "Engine/Types.h" #include "Engine/Types.h"
#include <cstdio> #include <cstdio>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>

View File

@@ -3,7 +3,7 @@
#include "Engine/Types.h" #include "Engine/Types.h"
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>

View File

@@ -1,6 +1,6 @@
#include "OpDefs/GopHouse.h" #include "OpDefs/GopHouse.h"
#include "Engine/Operator/AttributeHandle.h" #include "Engine/Operator/AttributeHandle.h"
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
GOP_house::GOP_house(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) GOP_house::GOP_house(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo)
: GeometryOpDef(network, opInfo) : GeometryOpDef(network, opInfo)

View File

@@ -3,8 +3,8 @@
#include "Engine/Types.h" #include "Engine/Types.h"
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <oneapi/tbb/blocked_range.h> #include <tbb/blocked_range.h>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>

View File

@@ -3,8 +3,8 @@
#include "Engine/Types.h" #include "Engine/Types.h"
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <oneapi/tbb/blocked_range.h> #include <tbb/blocked_range.h>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>

View File

@@ -1,6 +1,6 @@
#include "OpDefs/GopTestCube.h" #include "OpDefs/GopTestCube.h"
#include "Engine/Operator/AttributeHandle.h" #include "Engine/Operator/AttributeHandle.h"
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
GopTestGeoCube::GopTestGeoCube(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) GopTestGeoCube::GopTestGeoCube(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo)
: GeometryOpDef(network, opInfo) : GeometryOpDef(network, opInfo)

View File

@@ -6,8 +6,8 @@
#include <Eigen/src/Geometry/AngleAxis.h> #include <Eigen/src/Geometry/AngleAxis.h>
#include <Eigen/src/Geometry/Transform.h> #include <Eigen/src/Geometry/Transform.h>
#include <cstddef> #include <cstddef>
#include <oneapi/tbb/blocked_range.h> #include <tbb/blocked_range.h>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
GopTransform::GopTransform(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) GopTransform::GopTransform(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo)
: GeometryOpDef(network, opInfo) : GeometryOpDef(network, opInfo)

View File

@@ -1,5 +1,5 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <oneapi/tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <iostream> #include <iostream>
#include <boost/dll/import.hpp> #include <boost/dll/import.hpp>
#include "Engine/Network/NetworkManager.h" #include "Engine/Network/NetworkManager.h"
@@ -14,7 +14,7 @@ TEST_CASE("tbb")
{ {
constexpr int N = 100; constexpr int N = 100;
oneapi::tbb::parallel_for(0, N, [](int i) { tbb::parallel_for(0, N, [](int i) {
std::cout << "Iteration " << i std::cout << "Iteration " << i
<< " is running on thread " << " is running on thread "
<< std::this_thread::get_id() << std::endl; << std::this_thread::get_id() << std::endl;