Giter VIP home page Giter VIP logo

Comments (4)

chvink avatar chvink commented on June 11, 2024

Yeah, those two symbols don't exist on OSX from what I can tell. Unfortunately I don't have access to a machine running OSX at the moment so getting a fix working may be kind of painful. Take a look at the osx_compat branch I just pushed, this should hopefully add code for OSX to use. If this successfully compiles, can you do ./waf install --targets=OSTest, then run the program ${PREFIX}/tests/sys/OSTest? That should call the function that was causing problems, can you make sure it's printing reasonable values for system memory?

Thanks

Edit: You'll need to re-add your changes to projects/csm/wscript. If you can send me a diff I can get those in as well.

from six-library.

piyushrpt avatar piyushrpt commented on June 11, 2024

Came across this for SC_PHYS_PAGES when trying to solve the issue before posting here.

http://stackoverflow.com/questions/30511579/linux-sc-phys-pages-not-working-on-mac-os-x

I couldn't find anything similar for SC_AVPHYS_PAGES .

Here is a diff of the wscript:

@@ -5,6 +5,7 @@ PLUGIN             = 'CSM'
 REMOVEPLUGINPREFIX = True

 import sys, os, re
+from waflib import Errors

 DIRS = 'external'

@@ -22,6 +23,7 @@ def configure(conf):
     linuxRegex = r'.*-.*-linux-.*|i686-pc-.*|linux'
     solarisRegex = r'sparc-sun.*|i.86-pc-solaris.*|sunos'
     winRegex = r'win32'
+    osxRegex = r'darwin'
     if re.match(linuxRegex, sys.platform):
         platformName = 'linux'
     elif re.match(solarisRegex, sys.platform):
@@ -37,6 +39,8 @@ def configure(conf):
         #       For example, if you're building with VS 2008 Express, use:
         #       --enable-32bit "--msvc_version=msvc 9.0Exp"
         platformName = 'winVC' + str(conf.env['MSVC_VERSION']).replace('.', '')
+    elif re.match(osxRegex, sys.platform):
+        platformName='darwin'
     else:
         raise Errors.WafError('Unsupported platform %s' % sys.platform)

Will check out the new branch and report back.

Thanks

from six-library.

piyushrpt avatar piyushrpt commented on June 11, 2024

I had to make a minor change to get this to work

--- a/externals/coda-oss/modules/c++/sys/source/OSUnix.cpp
+++ b/externals/coda-oss/modules/c++/sys/source/OSUnix.cpp
@@ -291,7 +291,7 @@ void sys::OSUnix::getMemInfo(size_t &totalPhysMem, size_t &freePhysMem) const
 #if defined(__APPLE__)
     long long physMem = 0;
     size_t size = sizeof(physMem);
-    int status = sysctlbyname("hw.memsize", &physMem, &length, 0, 0);
+    int status = sysctlbyname("hw.memsize", &physMem, &size, 0, 0);
     if(status)
     {
         throw sys::SystemException(Ctxt("Call to sysctl() has failed"));

The code compiled fine after that and reported reasonable values:

Platform: Darwin (x86_64): 12.6.0 [build: Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64]
Num CPUs: 8
The delimiter on this platform: /
The process id: 55951
Total physical memory (MB): 16384
Total free memory (MB): 6181
Did not find file: /Users/dummy/packages/six-library/blah.txt
Found directory: /Users/dummy/packages/six-library
Created file: ./TMPOMXeqM with size: 35
Killed file: ./TMPOMXeqM
Created test directory: TEST_DIRECTORY
Time Now: 1444329235
Start: 1.44433e+12
Finish Loop 1
Finish Loop 2
Finish Loop 3
Stop: 0.448974609375
Time Now: 1444329235

Piyush

from six-library.

chvink avatar chvink commented on June 11, 2024

Thanks for your help! I'll put in pull requests for these changes.

Charles

from six-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.