Skip to content
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

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

CusiniM
Copy link
Collaborator

@CusiniM CusiniM commented Jul 2, 2024

The merge of PR has broken compilation on my mac laptop. I have patched it like this.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.75%. Comparing base (94a0e86) to head (22737d9).
Report is 2 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

@rrsettgast
Copy link
Member

Time to use the GitHub M1 runners?

Copy link
Member

@rrsettgast rrsettgast left a 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?

@rrsettgast rrsettgast added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label Jul 3, 2024
@CusiniM
Copy link
Collaborator Author

CusiniM commented Jul 3, 2024

Is there another option on the Mac?

Is there another option on the Mac?

I found this but it's kind of old and I have not tried it.

@rrsettgast
Copy link
Member

Is there another option on the Mac?

Is there another option on the Mac?

I found this but it's kind of old and I have not tried it.

@arng40 Can you give it a shot? Do you have a Mac?

@arng40
Copy link
Contributor

arng40 commented Jul 3, 2024

Is there another option on the Mac?

Is there another option on the Mac?

I found this but it's kind of old and I have not tried it.

@arng40 Can you give it a shot? Do you have a Mac?

I don't have a MAC so it would be difficult to test alternatives.
A solution could be to integrate a compilation check on macos in CI

Copy link
Contributor

@MelReyCG MelReyCG left a 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." );
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

@MelReyCG MelReyCG Jul 3, 2024

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.

Suggested change
#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 ?

@CusiniM
Copy link
Collaborator Author

CusiniM commented Jul 3, 2024

Is there another option on the Mac?

Is there another option on the Mac?

I found this but it's kind of old and I have not tried it.

@arng40 Can you give it a shot? Do you have a Mac?

I don't have a MAC so it would be difficult to test alternatives. A solution could be to integrate a compilation check on macos in CI

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.

@rrsettgast rrsettgast changed the title Check for existence of_ SC_AVPHYS_PAGES to fix MacOS compilation. fix: Check for existence of_ SC_AVPHYS_PAGES to fix MacOS compilation. Jul 8, 2024
@rrsettgast rrsettgast merged commit 180f138 into develop Jul 8, 2024
35 of 39 checks passed
@rrsettgast rrsettgast deleted the cusini1/bugfix/fix-mac-compilation branch July 8, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants