Tweaks for building with macOS 26#11605
Conversation
jmarrec
left a comment
There was a problem hiding this comment.
I don't really get why we have XCode specific stuff but maybe it's really needed?
I pushed a branch with only 2 changes that allows me to build on Apple Clang 21 (macOS 26.5 fully up to date)
https://github.com/NatLabRockies/EnergyPlus/compare/build_apple-clang-21?expand=1
| if(CMAKE_GENERATOR STREQUAL "Xcode") | ||
| target_compile_options(project_warnings INTERFACE -Wno-shorten-64-to-32) | ||
| endif() |
There was a problem hiding this comment.
I have tweaks locally to build on apple-clang 21, and I haven't needed to add this?
Also, is this really Xcode generator specific?
(I would have expected CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||
| add_executable(generate_embeddable_epJSON_schema embedded/generate_embeddable_epJSON_schema.cpp) | ||
| target_link_libraries(generate_embeddable_epJSON_schema PRIVATE project_options project_fp_options project_warnings fmt::fmt) | ||
| target_link_libraries(generate_embeddable_epJSON_schema PRIVATE project_options project_fp_options project_warnings fmt::fmt nlohmann_json) |
There was a problem hiding this comment.
Haven't needed that either
| #ifndef CLI11_HAS_CODECVT | ||
| #if defined(__APPLE__) && defined(__clang__) | ||
| #define CLI11_HAS_CODECVT 0 | ||
| #elif defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5 |
There was a problem hiding this comment.
I see what you're doing. This is better than my own
target_compile_options(project_warnings INTERFACE -Wno-deprecated-declarations) # wstring_convert deprecated in newer libc++
I wonder if it's better to have it inline in CLI11.hpp or if it should be in CMake via target_compile_definitions(xxx PRIVATE CLI11_HAS_CODECVT=0) (for targets energyplus and convertInputFormat). I guess inline is fine.
|
@RKStrand can you give @jmarrec's branch a try? https://github.com/NatLabRockies/EnergyPlus/tree/build_apple-clang-21 |
|
OK. I also see this with Xcode and Apple Clang 17. Can you try a Unix makefile build with CLion? |
|
I was just able to successfully build using CLion--both energyplus and energyplus_tests. Was able to successfully run 1ZoneUncontrolled.idf using this energyplus build and the test suite completed 1260 test successfully. Not sure why it didn't do every unit test but at least it successfully completed what it did. I'd love to get Xcode running again, but at least having CLion up and running is super helpful. |
|
For the record, in case it helps, I'm running a Nov 2023 MacBook Pro 16-inch, with the Apple M3 Max chip, 128 GB of memory, macOS Tahoe26.5, and Xcode Version 26.5 (17F42). |
@RKStrand can you post anything regarding what caused the failure in completing all the tests? |
|
Thanks @RKStrand. I saw that as well. |
|
@RKStrand can you try this branch for both? https://github.com/NatLabRockies/EnergyPlus/tree/build_apple-clang-21_msm |
|
@mitchute Ok, here is what I got on my machine: Big Picture for "msm" branch: Xcode builds and runs successfully, CLion encounters an error building energyplus_tests (details below) Xcode: CLion: .../third_party/gtest/googletest/include/gtest/gtest-printers.h:478:35: error: implicit conversion from 'char8_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion] It points to the (c) in that line as the issue. |
|
Right... I missed that change here. I'll push a patch soon. |
|
@RKStrand give it another shot now. |
|
@mitchute Ok, after that, now I can say: Xcode--same as before (everything good). CLion--energyplus still builds and runs. energyplus_tests builds now. What is a bit weird is that when I run it, it only does 1260 tests and then at some point, I get the following pop-up window (see left of image below).
If I click on ignore, it just stops right there. If I click on "Reopen", it launches a terminal window and tries to run energyplus_tests from the terminal. But that doesn't finish either because as you can see from the right side of the image, it seems to crash in a Solar Shading test. |



Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer