Skip to content

Tweaks for building with macOS 26#11605

Open
mitchute wants to merge 4 commits into
developfrom
xcode-generated-builds
Open

Tweaks for building with macOS 26#11605
mitchute wants to merge 4 commits into
developfrom
xcode-generated-builds

Conversation

@mitchute
Copy link
Copy Markdown
Collaborator

@mitchute mitchute commented May 27, 2026

Pull request overview

  • A collection of tweaks needed to get EnergyPlus building on macOS 26 for Xcode- and Unix-generated makefiles.

Description of the purpose of this PR

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@mitchute mitchute requested a review from RKStrand May 27, 2026 00:25
@mitchute mitchute added the DoNotPublish Includes changes that shouldn't be reported in the changelog label May 27, 2026
@mitchute mitchute changed the title Suppress Implicit 64-to-32 bit Conversion Errors for Xcode Generated Builds Compiler Tweaks for macOS 26 May 27, 2026
@mitchute mitchute changed the title Compiler Tweaks for macOS 26 Tweaks for building with macOS 26 May 27, 2026
Copy link
Copy Markdown
Contributor

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread cmake/CompilerFlags.cmake
Comment on lines +131 to +133
if(CMAKE_GENERATOR STREQUAL "Xcode")
target_compile_options(project_warnings INTERFACE -Wno-shorten-64-to-32)
endif()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Comment thread idd/CMakeLists.txt

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't needed that either

Comment thread third_party/CLI/CLI11.hpp
Comment on lines +161 to +164
#ifndef CLI11_HAS_CODECVT
#if defined(__APPLE__) && defined(__clang__)
#define CLI11_HAS_CODECVT 0
#elif defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DoNotPublish Includes changes that shouldn't be reported in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants