-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Check for existence of_ SC_AVPHYS_PAGES to fix MacOS compilation. #3207
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3207 +/- ##
========================================
Coverage 55.75% 55.75%
========================================
Files 1041 1041
Lines 88534 88534
========================================
Hits 49358 49358
Misses 39176 39176 ☔ View full report in Codecov by Sentry. |
Time to use the GitHub M1 runners? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another option on the Mac?
I found this but it's kind of old and I have not tried it. |
I don't have a MAC so it would be difficult to test alternatives. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there, a few comments to contribute on this issue.
m_availableMemory = sysconf( _SC_AVPHYS_PAGES ) * sysconf( _SC_PAGESIZE ); | ||
#else | ||
GEOS_WARNING( "Unknown device avaialable memory size getter for this system." ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GEOS_WARNING( "Unknown device avaialable memory size getter for this system." ); | |
GEOS_WARNING( "Unknown device available memory size getter for this system." ); |
@@ -27,8 +27,13 @@ MemoryInfos::MemoryInfos( umpire::MemoryResourceTraits::resource_type resourceTy | |||
case umpire::MemoryResourceTraits::resource_type::pinned: | |||
#if defined( _SC_PHYS_PAGES ) && defined( _SC_PAGESIZE ) | |||
m_totalMemory = sysconf( _SC_PHYS_PAGES ) * sysconf( _SC_PAGESIZE ); | |||
#if defined(_SC_AVPHYS_PAGES) | |||
m_availableMemory = sysconf( _SC_AVPHYS_PAGES ) * sysconf( _SC_PAGESIZE ); | |||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this be a way to find the available memory on MaxOS? Unfortunately, I we don't have any MacOS to test that here.
#else | |
#elif /* is compiling for MacOS */ | |
{ | |
uint64_t mem; | |
size_t len = sizeof( mem ); | |
sysctlbyname( "hw.memsize", &mem, &len, nullptr, 0 ); | |
m_availableMemory= mem / sysconf(_SC_PAGE_SIZE); | |
} |
Should we regroup the system-dependant component like this in a namespace ?
is it now available? I thought that we could not find any M1 runner but if they now have one we really should. It's true that we don't really need to support MacOS but a lot of us work on macbooks so it would be convenient to have a CI job to cover it. |
#3207) * check for existence of_ SC_AVPHYS_PAGES --------- Co-authored-by: Randolph Settgast <[email protected]>
The merge of PR has broken compilation on my mac laptop. I have patched it like this.