Post

Replies

Boosts

Views

Activity

Unexpected error building on Ventura 13.4
Up to now I've been building my x64 binaries on Sequioa specifying a target macOS level of 13.4. That worked fine. In an attempt to debug a problem that was causing some pain I created a 13.4 x64 build environment and tried to build the code there. This code: using CacheKeyType = std::filesystem::path; using CacheValueType = std::tuple<LoadedImage, int, bool>; // <image, lastUse, currentlyLoading> using CacheType = std::unordered_map<CacheKeyType, CacheValueType>; friend class ThreadLoader; static inline constexpr int16_t MAXIMAGESINCACHE = 20; static inline constinit std::atomic_int age{ 0 }; static inline std::shared_mutex rwMutex{}; static inline CacheType imageCache{}; got me the following errors: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__hash_table:838:5: error: static_assert failed due to requirement 'integral_constant<bool, false>::value' "the specified hash does not meet the Hash requirements" static_assert(__check_hash_requirements<_Key, _Hash>::value, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__hash_table:853:1: note: in instantiation of template class 'std::__enforce_unordered_container_requirements<std::filesystem::path, std::hash<std::filesystem::path>, std::equal_to<std::filesystem::path>>' requested here typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/unordered_map:1152:30: note: while substituting explicitly-specified template arguments into function template '__diagnose_unordered_container_requirements' static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); ^ /Users/amonra/.vs/DSS/build/DeepSkyStackerKernel/DeepSkyStackerKernel_autogen/EWIEGA46WW/../../../../DeepSkyStackerKernel/imageloader.h:60:26: note: in instantiation of member function 'std::unordered_map<std::filesystem::path, std::tuple<LoadedImage, int, bool>>::~unordered_map' requested here static inline CacheType imageCache{}; ^ 2 errors generated. Which isn't "mega-helpful" :( I thought that specifying: set(CMAKE_OSX_DEPLOYMENT_TARGET 13.4 CACHE STRING "Minimum operating system version for deployment" FORCE) would have made the compilations use the same headers as for Ventura above, but it seems not? Is this to be expected?
5
0
87
1w
macOS .chm viewer
For the Linux version of my application which is written in C++ using Qt, I display the CHM format help files with this code: QString helpFile{ QCoreApplication::applicationDirPath() + "/Help/" + tr("DeepSkyStacker Help.chm","IDS_HELPFILE") }; QString program{ "kchmviewer" }; QStringList arguments{ "-token", "com.github.deepskystacker", helpFile }; helpProcess->startDetached(program, arguments); (helpProcess is a pointer to a QProcess object) The -token com.github.deepskystackerpart of that ensures that only a single instance of the viewer is used for any code that uses that invocation. Are there any chm file viewers for macOS that are capable of that sort of trick? The ones I've found on the App Store give minimal information and appear to be very simple minded tools that are not not intended for integration into an application as above. I know that MacPorts offers ports of kchmviewer but I'd prefer not to use either that or HomeBrew ... David
0
0
72
1w
Cocoa error on M4 Sequioa in x64 AVX code
One of our x64 AVX code tests we have fails when run on ARM The test results say: ------------------------------------------------------------------------------- AVX Stacking, Entropy One image ------------------------------------------------------------------------------- /Users/amonra/.vs/DSS/DeepSkyStackerTest/AvxStackingTest.cpp:381 ............................................................................... /Users/amonra/.vs/DSS/DeepSkyStackerTest/AvxStackingTest.cpp:416: FAILED: REQUIRE( avxEntropy.getRedEntropyLayer()[10] == 1.0f ) with expansion: 0.99993f == 1.0f The test code: TEST_CASE("AVX Stacking, Entropy", "[AVX][Stacking][Entropy]") { SECTION("One image") { constexpr int W = 61; constexpr int H = 37; typedef float T; DSSRect rect(0, 0, W, H); // left, top, right, bottom std::shared_ptr<CMemoryBitmap> pTempBitmap = std::make_shared<CGrayBitmapT<T>>(); REQUIRE(pTempBitmap->Init(W, H) == true); std::shared_ptr<CMemoryBitmap> pBitmap = std::make_shared<CGrayBitmapT<T>>(); REQUIRE(pBitmap->Init(W, H) == true); auto* pGray = dynamic_cast<CGrayBitmapT<T>*>(pBitmap.get()); for (int i = 0; i < W * H; ++i) pGray->m_vPixels[i] = 100.0f; std::shared_ptr<CMemoryBitmap> pEntropyCoverage = std::make_shared<CGrayBitmapT<float>>(); REQUIRE(pEntropyCoverage->Init(W, H) == true); TestEntropyInfo entropyInfo; entropyInfo.Init(pTempBitmap, 10, nullptr); AvxEntropy avxEntropy(*pTempBitmap, entropyInfo, pEntropyCoverage.get()); CPixelTransform pixTransform; CTaskInfo taskInfo; // Determines if method is ENTROPY or not. taskInfo.SetMethod(MBP_ENTROPYAVERAGE, 2, 5); CBackgroundCalibration backgroundCalib; backgroundCalib.SetMode(BCM_NONE, BCI_LINEAR, RBCM_MAXIMUM); AvxStacking avxStacking(0, H, *pBitmap, *pTempBitmap, rect, avxEntropy); REQUIRE(avxStacking.stack(pixTransform, taskInfo, backgroundCalib, std::shared_ptr<CMemoryBitmap>{}, 1) == 0); for (int i = 0; i < 10; ++i) REQUIRE(avxEntropy.getRedEntropyLayer()[i] == Approx(1.0f).epsilon(1e-4f)); REQUIRE(avxEntropy.getRedEntropyLayer()[10] == 1.0f); The test passes when run on x64 hardware. The full code for the AvxStacking class is a bit large to post inline. Sadly the attach file option won't let me attach cpp files D.
3
0
44
2w
How can I export the "Notary Profile" used by notarytool for CI/CD
Once I have built my macOS .app and signed it I run notarytool using this simple shell script: #!/bin/sh ditto -c -k --keepParent "$1.app" "$1.zip" xcrun notarytool submit "$1.zip" --keychain-profile "Notary Profile for DeepSkyStacker" --wait xcrun stapler staple $1.app rm -f $1.zip How can I export that "keychain-profile" (notary profile) so I can use it in CI/CD actions? Clearly I don't wish to expose the full invocation of xcrun notarytool store-credentials.
3
0
103
2w
Associating file extension with my application
My application uses a text file with an extension of .dssfilelist. On Linux I would register the Mime type and associate it with the application in the .desktop file. <?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="text/dssfilelist"> <comment>DeepSkyStacker file-list file</comment> <glob pattern="*.dssfilelist" /> </mime-type> </mime-info> I believe that I need to add stuff to the Info.plist for my application, but I also understand that CFBundleTypeExtensions is deprecated. So please could you show me what I now need to add to the Info.plist file so that these files will be registered as "text/dssfilelist" type and associated with my application and to associate a .icns file with it?
19
0
202
3w
Building an app with both GUI and Command Line versions
I use CMake for my builds not the XCode GUI. I want to be able to build a single .app that contains both the GUI version and the command line version. I have seen products that ship both as part of the same .app (e.g. CMake) so this is clearly entirely possible, the 64k question is HOW? Right now I am building them as separate apps - lets call them DSS and DSSCL (*). The code base for each is in its own directory - each with its own CMakelists.txt file. My initial thoughts are to change the build for DSSCL so it doesn't create a bundle and then simply copy the DSSCL command and related .qm files into DSS.app/.../MacOS. However that's likely enough totally wrong, so how should I handle this please. As much detail as possible please, I am very new to macOS development -please don't assume knowledge of stuff that's second nature to you Many thanks David (*) Strictly they are DeepSkyStacker and DeepSkyStackerCL
7
0
62
Apr ’25
Getting access to SharedSupport sub-folder of bundle
So if my executable is in the MacOS directory, am I correct in thinking the such things as a related command line application, the help files and other stuff should go into "Shared Support"? If yes, how can my C++ application find and use "stuff" in that SharedSupport sub-directory of the bundle (e.g. open a file or display the help files)? Thanks David
3
0
38
Apr ’25
Notarising two builds of the same app
I have built my application for arm and x64 so I have two files called DeepSkyStacker.app in different directories. I have followed the instructions to notarise the arm version of the app, but an concerned about what I should do to notarise the other one - do I just zip that up and then run: xcrun notarytool submit "DeepSkyStacker.zip" --keychain-profile "Notary Profile for DeepSkyStacker" --wait xcrun stapler staple DeepSkyStacker.app again or will that mess everything up? Related to that can I use the Notary Profile I created for DeepSkyStacker to notarise other apps that are part of the same product (DeepSkyStackerLive and DeepSkyStackerCL)?? Thanks David
3
0
61
Apr ’25
Code no longer builds "unsupported option for target"
A short while ago, I added: set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0 CACHE STRING "Minimum operating system version for deployment") to my top level CMake file. The code would not compile. So I removed the line and deleted the CMake cache and tried to rebuild. And for my pains I got this: c++: error: unsupported option '-mavx' for target 'arm64-apple-darwin24.4.0' c++: error: unsupported option '-mavx2' for target 'arm64-apple-darwin24.4.0' c++: error: unsupported option '-mfma' for target 'arm64-apple-darwin24.4.0' c++: error: unsupported option '-mssse3' for target 'arm64-apple-darwin24.4.0' This code was all compiled just fine up until this change, but now it just won't do so. Help!!! David
1
0
54
Apr ’25
Errors compiling C++ code for x86_64
I have a project (that uses pre-compiled headers) that uses different compiler options for SOME files. For those files I have this is in my CMakelists.txt: if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") set_source_files_properties(${AVX_Files} PROPERTIES COMPILE_OPTIONS "-mavx;-mavx2;-mfma;-mssse3;-msse4.2") set_source_files_properties(avx_simd_check.cpp PROPERTIES COMPILE_OPTIONS "-mxsave") endif() When I build for ARM, it all works :) When I try to build for X86_64, I get the following error for avx_simd_check.cpp: error: current translation unit is compiled with the target feature '+xsave' but the AST file was not 1 error generated. and for all the other files in question: error: current translation unit is compiled with the target feature '+avx' but the AST file was not error: current translation unit is compiled with the target feature '+avx2' but the AST file was not error: current translation unit is compiled with the target feature '+fma' but the AST file was not error: current translation unit is compiled with the target feature '+sse4.2' but the AST file was not error: current translation unit is compiled with the target feature '+ssse3' but the AST file was not 5 errors generated. How can I solve this please? David
3
0
42
Apr ’25
add /usr/bin/codesign to acl for private key
Displaying attribute for a private key I see a number of applications that are allowed to access it without needing a password e.g. racoon; Keychain Access.app; Certificate Assitant.app etc.. I want to add /usr/bin/codesign to the list but the gui window that pops up when I click on + doesn't seem to allow me to do that :( How do I do it please
Topic: Code Signing SubTopic: General
3
0
36
Apr ’25