diff --git a/CMakeLists.txt b/CMakeLists.txt index b75015b4f..07028d6c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,8 +294,6 @@ endif() #Maybe have an option guarding this? set(SLS_INTERNAL_RAPIDJSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson) -set(SLS_INTERNAL_QWT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/qwt-6.1.5) - set(ClangFormat_EXCLUDE_PATTERNS "build/" "libs/" "slsDetectorCalibration/" diff --git a/README.md b/README.md index 3727bb07f..d8d26f2d4 100644 --- a/README.md +++ b/README.md @@ -265,20 +265,13 @@ conda create -n myenv slsdetgui=7.0.0 conda activate myenv ``` -2. Using system installation on RHEL7 +2. Using system installation on RHEL7/RHEL8 ``` yum install qt5-qtbase-devel.x86_64 -yum install qt5-qtsvg-devel.x86_64 +yum install qt5-qtsvg-devel.x86_64 ``` -3. Using system installation on RHEL8 -``` -yum install qt5-qtbase-devel.x86_64 -yum install qt5-qtsvg-devel.x86_64 -yum install expat-devel.x86_64 -``` - -4. Using conda +3. Using conda ``` #Add channels for dependencies and our library conda config --add channels conda-forge diff --git a/conda-recipes/main-library/meta.yaml b/conda-recipes/main-library/meta.yaml index 1c495645d..adc7c177e 100755 --- a/conda-recipes/main-library/meta.yaml +++ b/conda-recipes/main-library/meta.yaml @@ -28,7 +28,6 @@ requirements: - libgl-devel # [linux] - libtiff - zlib - - expat - zeromq - fmt diff --git a/conda-recipes/python-client/meta.yaml b/conda-recipes/python-client/meta.yaml index d7411571e..aed1f4c21 100644 --- a/conda-recipes/python-client/meta.yaml +++ b/conda-recipes/python-client/meta.yaml @@ -9,6 +9,10 @@ package: build: number: 0 script: + # gcc_linux-64 16.2.0 build 3 passes bare tool names in CMAKE_ARGS + # (-DCMAKE_AR=x86_64-conda-linux-gnu-ar), which CMake resolves relative to + # SRC_DIR. Restore the full paths; no-op when they are already absolute. + - 'export CMAKE_ARGS="${CMAKE_ARGS//=${HOST}-/=${BUILD_PREFIX}/bin/${HOST}-}"' # [not win] - unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv --config-settings=cmake.define.SLS_USE_SYSTEM_ZMQ=ON # [not win] requirements: diff --git a/docs/src/installation.rst b/docs/src/installation.rst index 5a3ab91f9..b984c5132 100644 --- a/docs/src/installation.rst +++ b/docs/src/installation.rst @@ -323,22 +323,14 @@ using this compiler conda activate myenv -2. Using system installation on RHEL7 +2. Using system installation on RHEL7/RHEL8 .. code-block:: bash yum install qt5-qtbase-devel.x86_64 - yum install qt5-qtsvg-devel.x86_64 + yum install qt5-qtsvg-devel.x86_64 -3. Using system installation on RHEL8 - - .. code-block:: bash - - yum install qt5-qtbase-devel.x86_64 - yum install qt5-qtsvg-devel.x86_64 - yum install expat-devel.x86_64 - -4. Using conda +3. Using conda .. code-block:: bash diff --git a/libs/qwt/CMakeLists.txt b/libs/qwt/CMakeLists.txt index be7986822..2ffb33e22 100644 --- a/libs/qwt/CMakeLists.txt +++ b/libs/qwt/CMakeLists.txt @@ -8,18 +8,25 @@ set(PROJECT_VERSION 6.1.5) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -# Extract qwt sources from the supplied source file -set(INTERNALQWTDIR "qwt-source/") -set(QWTBASE ${CMAKE_CURRENT_BINARY_DIR}/${INTERNALQWTDIR}) -file(MAKE_DIRECTORY ${QWTBASE}) -execute_process( - COMMAND tar -xf ${CMAKE_CURRENT_SOURCE_DIR}/qwt-6.1.5.tar.bz2 -C ${QWTBASE} --strip-components=1 - RESULT_VARIABLE ret -) -if(ret AND NOT ret EQUAL 0) - message( FATAL_ERROR "Could not unpack qwt") +# cmake_minimum_required above resets the policies set in the top level file +if (${CMAKE_VERSION} VERSION_GREATER "3.24") + cmake_policy(SET CMP0135 NEW) #Fetch content download timestamp endif() +# Extract qwt sources from the supplied source file. FetchContent unpacks +# with the archive support built into CMake, so neither tar nor bzip2 has +# to be installed. The archive has no top level CMakeLists.txt, so nothing +# is added to the build here. +include(FetchContent) +FetchContent_Declare( + qwt_source + URL ${CMAKE_CURRENT_SOURCE_DIR}/qwt-6.1.5.tar.bz2 + # Compute hash: md5sum qwt-6.1.5.tar.bz2 + URL_HASH MD5=d65582f99312796ed42c3be3208ed3db +) +FetchContent_MakeAvailable(qwt_source) +set(QWTBASE ${qwt_source_SOURCE_DIR}) + # Without this define moc files are not included and linking of examples fails. add_definitions(-DQWT_MOC_INCLUDE) @@ -35,8 +42,8 @@ find_package(Qt5 REQUIRED ) -file(GLOB QWT_SOURCES ${QWTBASE}src/*.cpp) -file(GLOB QWT_HEADERS ${QWTBASE}src/*.h) +file(GLOB QWT_SOURCES ${QWTBASE}/src/*.cpp) +file(GLOB QWT_HEADERS ${QWTBASE}/src/*.h) add_library(qwt STATIC ${QWT_SOURCES} ${QWT_HEADERS} ) target_include_directories(qwt SYSTEM PUBLIC $ diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index b78ccdd95..48190b12f 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -91,7 +91,6 @@ target_include_directories(slsDetectorGui PUBLIC "$" "$" "$" - "$" "$" ) @@ -103,7 +102,6 @@ target_link_libraries(slsDetectorGui PUBLIC Qt5::Widgets Qt5::Gui Qt5::Core - expat PRIVATE slsProjectWarnings diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index ff37a8099..7005516e2 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 74666e5ff..dd9d82ede 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2374,6 +2374,7 @@ int powerChip(bool on, char *mess) { if (on) { LOG(logINFO, ("Powering chip: on\n")); bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK); + usleep(50 * 1000); // wait for chip to be ready if (configureChip(mess) == FAIL) return FAIL; } else { diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 765a5a7a5..a70730fcc 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 782b3f6fc..e0cb517e6 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -2420,6 +2420,7 @@ int powerChip(int on) { if (on) { LOG(logINFO, ("Powering chip: on\n")); bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PWR_CHIP_MSK); + usleep(50 * 1000); // wait for chip to be ready } else { LOG(logINFO, ("Powering chip: off\n")); bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_PWR_CHIP_MSK); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp index 8084efd84..86e0a2e0b 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp @@ -8,11 +8,14 @@ #include "acquire/ExpectedState.h" #include "acquire/FileState.h" #include "checks/MasterFileChecks.h" +#include "tests/globals.h" namespace sls { namespace acq = sls::test::acquire; namespace checks = sls::test::checks; +using test::GET; +using test::PUT; void acquire_and_check_file_size( Detector &det, std::optional ctb_state = std::nullopt) { @@ -270,4 +273,29 @@ TEST_CASE("acquire_check_binary_file_size", REQUIRE_NOTHROW(acquire_and_check_file_size(det)); } +TEST_CASE("rx_start_fails_fpath_permissions", "[.detectorintegration]") { + Detector det; + Caller caller(&det); + auto det_type = + det.getDetectorType().tsquash("Inconsistent detector types to test"); + + // not needed to test for every detector type, just one is enough + if (det_type == defs::JUNGFRAU) { + std::vector formats{defs::BINARY}; +#ifdef HDF5C + formats.push_back(defs::HDF5); +#endif + for (auto format : formats) { + INFO("File format: " << ToString(format)); + auto file_state = acq::default_file_state(); + file_state.file_format = format; + file_state.file_write = true; + // no write permission, rx_start fails later + file_state.file_path = "/"; + acq::FileStateGuard file_guard(det, file_state); + REQUIRE_THROWS(caller.call("rx_start", {}, -1, PUT)); + } + } +} + } // namespace sls diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 7bb779187..15e627284 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -4,10 +4,10 @@ #define APILIB "0.0.0 0x250909" #define APIRECEIVER "0.0.0 0x250822" #define APICTB "0.0.0 0x261109" -#define APIGOTTHARD2 "0.0.0 0x261106" +#define APIGOTTHARD2 "0.0.0 0x261112" #define APIMOENCH "0.0.0 0x261109" #define APIEIGER "0.0.0 0x261105" #define APIXILINXCTB "0.0.0 0x261106" #define APIJUNGFRAU "0.0.0 0x261109" -#define APIMYTHEN3 "0.0.0 0x261106" +#define APIMYTHEN3 "0.0.0 0x261112" #define APIMATTERHORN "0.0.0 0x260529"