Skip to content

swmm-python fails to compile in Apple M1 #93

@abhiramm7

Description

@abhiramm7

Hi all,

swmm-python fails to compile in M1 Macs. It seems to be an openmp issue. Digging more into it, I've discovered that llvm does not yet fully support openmp (see seq-lang/seq#248 (comment)). The same issue seems to persist with gcc as well.

Screen Shot 2021-12-29 at 10 47 52 PM

I found two ways to address this issue:

  1. Compile with set(CMAKE_OSX_ARCHITECTURES "x86_64")
  2. Disable openmp in CmakeLists

Though 1 works, it would need x86_64 python installed. For now I think 2 might be the best option. We would just have to update cmakelists file.

# If wheel build on Apple fetch and build OpenMP Library
if (APPLE AND (NOT CMAKE_OSX_ARCHITECTURES STREQUAL "arm64"))
    include(./extern/openmp.cmake)
else()
    find_package(OpenMP
        OPTIONAL_COMPONENTS
            C
    )
endif()

I'll keep looking for a way to support openmp on m1 Macs. For now, I am able to compile swmm-python and run pyswmm without openmp.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions