diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..478e8c1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +build +docker +docs +.git +.github +Doxyfile diff --git a/.gitignore b/.gitignore index 510848f..3358e6f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build docs/html docs/latex perf.data* +artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e66ac4..f59580f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.30) +cmake_minimum_required(VERSION 3.26) # set vars set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -79,7 +79,7 @@ find_package(glm REQUIRED) find_package (Eigen3 3.3 REQUIRED NO_MODULE) # tbb -find_package(TBB REQUIRED COMPONENTS TBB::tbb) +find_package(TBB REQUIRED COMPONENTS tbb) 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_LIB_DIR ${CMAKE_PROJECT_NAME}/lib) -install( - TARGETS ${AppExec} - RUNTIME DESTINATION ${ENZO_BIN_DIR} - LIBRARY DESTINATION ${ENZO_LIB_DIR} - ARCHIVE DESTINATION ${ENZO_LIB_DIR} + +set_target_properties(${AppExec} PROPERTIES + INSTALL_RPATH "$ORIGIN/../lib;$ORIGIN/../../lib" ) 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") # --- end packaging diff --git a/build.sh b/build.sh index 6c53ec8..97df344 100755 --- a/build.sh +++ b/build.sh @@ -2,5 +2,5 @@ mkdir -p build cd build -cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja .. +cmake -DCMAKE_BUILD_TYPE=Build -G Ninja .. ninja diff --git a/cmake/CPackProjectConfig.cmake b/cmake/CPackProjectConfig.cmake index 3afcf92..14096a3 100644 --- a/cmake/CPackProjectConfig.cmake +++ b/cmake/CPackProjectConfig.cmake @@ -1,12 +1,21 @@ -if (CPACK_GENERATOR MATCHES "RPM") +MESSAGE(STATUS "GENERATOR: ${CPACK_GENERATOR}") +if (${CPACK_GENERATOR} STREQUAL "RPM") # rpm specific config + MESSAGE(STATUS "RPM") + + set(CPACK_RPM_COMPONENT_INSTALL ON) + set(CPACK_COMPONENTS_ALL "runtimes") if(UNIX) set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") endif(UNIX) -elseif(CPACK_GENERATOR MATCHES "TGZ") +elseif(${CPACK_GENERATOR} STREQUAL "TGZ") # tgz specific config + MESSAGE(STATUS "TGZ") + + set(CPACK_TGZ_COMPONENT_INSTALL ON) + set(CPACK_COMPONENTS_ALL "tgz-runtimes") endif() diff --git a/docker/builds/Dockerfile.rocky9 b/docker/builds/Dockerfile.rocky9 new file mode 100644 index 0000000..91d63a9 --- /dev/null +++ b/docker/builds/Dockerfile.rocky9 @@ -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 diff --git a/docker/builds/build.sh b/docker/builds/build.sh new file mode 100755 index 0000000..6eb3b3d --- /dev/null +++ b/docker/builds/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +podman buildx build -f Dockerfile.rocky9 --output ./artifacts/rocky9 ../../ diff --git a/src/Engine/Operator/Attribute.h b/src/Engine/Operator/Attribute.h index 23eb096..abd2745 100644 --- a/src/Engine/Operator/Attribute.h +++ b/src/Engine/Operator/Attribute.h @@ -1,5 +1,4 @@ #pragma once -#include #include #include #include diff --git a/src/Engine/Operator/Geometry.cpp b/src/Engine/Operator/Geometry.cpp index b9dedf1..266724d 100644 --- a/src/Engine/Operator/Geometry.cpp +++ b/src/Engine/Operator/Geometry.cpp @@ -3,8 +3,8 @@ #include "Engine/Operator/AttributeHandle.h" #include "Engine/Types.h" #include -#include -#include +#include +#include #include #include #include diff --git a/src/Engine/Operator/Geometry.h b/src/Engine/Operator/Geometry.h index 961c381..666b905 100644 --- a/src/Engine/Operator/Geometry.h +++ b/src/Engine/Operator/Geometry.h @@ -5,7 +5,7 @@ #include #include "Engine/Operator/AttributeHandle.h" #include -#include +#include #include #include diff --git a/src/Engine/Operator/GeometryOpDef.cpp b/src/Engine/Operator/GeometryOpDef.cpp index b3c60d8..0651c34 100644 --- a/src/Engine/Operator/GeometryOpDef.cpp +++ b/src/Engine/Operator/GeometryOpDef.cpp @@ -1,4 +1,4 @@ -#include +#include #include "Engine/Operator/GeometryOpDef.h" #include #include diff --git a/src/Engine/Operator/OperatorTable.cpp b/src/Engine/Operator/OperatorTable.cpp index 7465b6a..9938e0c 100644 --- a/src/Engine/Operator/OperatorTable.cpp +++ b/src/Engine/Operator/OperatorTable.cpp @@ -101,13 +101,12 @@ void enzo::op::OperatorTable::initPlugins() static bool pluginsLoaded=false; if(pluginsLoaded) return; - // auto initPlugin = boost::dll::import_symbol( - // "build/src/OpDefs/libenzoOps1.so", "newSopOperator" - // ); - auto initPlugin = boost::dll::import_symbol( - findPlugin("enzoOps1"), "newSopOperator" - ); + using InitPluginFn = void(enzo::op::addOperatorPtr); + const auto so = findPlugin("enzoOps1"); + static boost::dll::shared_library lib(so, boost::dll::load_mode::default_mode); + + auto initPlugin = lib.get("newSopOperator"); initPlugin(enzo::op::OperatorTable::addOperator); pluginsLoaded = true; diff --git a/src/Gui/Network/NetworkGraphicsView.cpp b/src/Gui/Network/NetworkGraphicsView.cpp index 90dc5d2..efcbf3a 100644 --- a/src/Gui/Network/NetworkGraphicsView.cpp +++ b/src/Gui/Network/NetworkGraphicsView.cpp @@ -1,6 +1,7 @@ #include "Gui/Network/NetworkGraphicsView.h" #include #include "Gui/Network/Network.h" +#include #include "Gui/Network/NetworkGraphicsScene.h" #include "Gui/Network/SocketGraphic.h" #include diff --git a/src/Gui/Viewport/GLMesh.cpp b/src/Gui/Viewport/GLMesh.cpp index 15d0a98..2aac104 100644 --- a/src/Gui/Viewport/GLMesh.cpp +++ b/src/Gui/Viewport/GLMesh.cpp @@ -5,8 +5,8 @@ #include "Engine/Operator/Geometry.h" #include "Engine/Types.h" #include -#include -#include +#include +#include #include "icecream.hpp" diff --git a/src/Gui/Viewport/GLPoints.cpp b/src/Gui/Viewport/GLPoints.cpp index 89f9e97..e5a15cb 100644 --- a/src/Gui/Viewport/GLPoints.cpp +++ b/src/Gui/Viewport/GLPoints.cpp @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include "Engine/Types.h" #include "Gui/Viewport/GLCamera.h" #include "icecream.hpp" diff --git a/src/OpDefs/CMakeLists.txt b/src/OpDefs/CMakeLists.txt index 5cfa617..1b4edbe 100644 --- a/src/OpDefs/CMakeLists.txt +++ b/src/OpDefs/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.30) +cmake_minimum_required(VERSION 3.26) project(enzoOps1) diff --git a/src/OpDefs/GopGeometryImport.cpp b/src/OpDefs/GopGeometryImport.cpp index 61f46ca..f2dd4c7 100644 --- a/src/OpDefs/GopGeometryImport.cpp +++ b/src/OpDefs/GopGeometryImport.cpp @@ -2,7 +2,7 @@ #include "Engine/Operator/AttributeHandle.h" #include "Engine/Types.h" #include -#include +#include #include #include #include diff --git a/src/OpDefs/GopGrid.cpp b/src/OpDefs/GopGrid.cpp index a25612b..5ed51ce 100644 --- a/src/OpDefs/GopGrid.cpp +++ b/src/OpDefs/GopGrid.cpp @@ -3,7 +3,7 @@ #include "Engine/Types.h" #include #include -#include +#include #include #include #include diff --git a/src/OpDefs/GopHouse.cpp b/src/OpDefs/GopHouse.cpp index 0405a77..434d549 100644 --- a/src/OpDefs/GopHouse.cpp +++ b/src/OpDefs/GopHouse.cpp @@ -1,6 +1,6 @@ #include "OpDefs/GopHouse.h" #include "Engine/Operator/AttributeHandle.h" -#include +#include GOP_house::GOP_house(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) : GeometryOpDef(network, opInfo) diff --git a/src/OpDefs/GopOceanSurface.cpp b/src/OpDefs/GopOceanSurface.cpp index 487d280..40aa5d0 100644 --- a/src/OpDefs/GopOceanSurface.cpp +++ b/src/OpDefs/GopOceanSurface.cpp @@ -3,8 +3,8 @@ #include "Engine/Types.h" #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/OpDefs/GopSineWave.cpp b/src/OpDefs/GopSineWave.cpp index 695c68e..186479f 100644 --- a/src/OpDefs/GopSineWave.cpp +++ b/src/OpDefs/GopSineWave.cpp @@ -3,8 +3,8 @@ #include "Engine/Types.h" #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/OpDefs/GopTestCube.cpp b/src/OpDefs/GopTestCube.cpp index 0a2e374..2aefdc1 100644 --- a/src/OpDefs/GopTestCube.cpp +++ b/src/OpDefs/GopTestCube.cpp @@ -1,6 +1,6 @@ #include "OpDefs/GopTestCube.h" #include "Engine/Operator/AttributeHandle.h" -#include +#include GopTestGeoCube::GopTestGeoCube(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) : GeometryOpDef(network, opInfo) diff --git a/src/OpDefs/GopTransform.cpp b/src/OpDefs/GopTransform.cpp index 25a6702..e4ddd27 100644 --- a/src/OpDefs/GopTransform.cpp +++ b/src/OpDefs/GopTransform.cpp @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include GopTransform::GopTransform(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo) : GeometryOpDef(network, opInfo) diff --git a/tests/main-tests.cpp b/tests/main-tests.cpp index 7279cbf..c79804a 100644 --- a/tests/main-tests.cpp +++ b/tests/main-tests.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include "Engine/Network/NetworkManager.h" @@ -14,7 +14,7 @@ TEST_CASE("tbb") { constexpr int N = 100; - oneapi::tbb::parallel_for(0, N, [](int i) { + tbb::parallel_for(0, N, [](int i) { std::cout << "Iteration " << i << " is running on thread " << std::this_thread::get_id() << std::endl;