Updates to build on OS X #7166

Merged
merged 6 commits into from Apr 20, 2015

Conversation

Projects
None yet
3 participants
@boneill42
Contributor

boneill42 commented Mar 30, 2015

I need some help here.. it's been about 15 years since I did C/POSIX.

I don't know the implications of NOT setting the process scheduler, but it appears as those OS X does not have the function:
https://www.gnu.org/software/gnulib/manual/html_node/sched_005fsetscheduler.html

For now, I used preprocessing to exclude this from the APPLE build.

@@ -39,6 +39,8 @@
# define OSFreeBSD
#elif defined(__NetBSD__)
# define OSNetBSD
+#elif defined(__APPLE__)
+# define OSLinux

This comment has been minimized.

@richardkchapman

richardkchapman Mar 30, 2015

Member

I would have thought apple was closer to OSFreeBSD than OSLinux

@richardkchapman

richardkchapman Mar 30, 2015

Member

I would have thought apple was closer to OSFreeBSD than OSLinux

This comment has been minimized.

@boneill42

boneill42 Mar 30, 2015

Contributor

I thought the same thing. When using OSFreeBSD, I got the following incompatibilities:

In file included from /Users/bone/git/boneill42/hpcc/tools/start-stop-daemon/start-stop-daemon.c:65:
/usr/include/sys/proc.h:118:19: error: field has incomplete type 'struct itimerval'
struct itimerval p_realtimer; /* Alarm timer. /
^
/usr/include/sys/proc.h:118:9: note: forward declaration of 'struct itimerval'
struct itimerval p_realtimer; /
Alarm timer. */
^
/Users/bone/git/boneill42/hpcc/tools/start-stop-daemon/start-stop-daemon.c:1263:9: warning: implicit declaration of function 'do_procinit' is invalid in C99 [-Wimplicit-function-declaration]
do_procinit();

@boneill42

boneill42 Mar 30, 2015

Contributor

I thought the same thing. When using OSFreeBSD, I got the following incompatibilities:

In file included from /Users/bone/git/boneill42/hpcc/tools/start-stop-daemon/start-stop-daemon.c:65:
/usr/include/sys/proc.h:118:19: error: field has incomplete type 'struct itimerval'
struct itimerval p_realtimer; /* Alarm timer. /
^
/usr/include/sys/proc.h:118:9: note: forward declaration of 'struct itimerval'
struct itimerval p_realtimer; /
Alarm timer. */
^
/Users/bone/git/boneill42/hpcc/tools/start-stop-daemon/start-stop-daemon.c:1263:9: warning: implicit declaration of function 'do_procinit' is invalid in C99 [-Wimplicit-function-declaration]
do_procinit();

This comment has been minimized.

@boneill42

boneill42 Mar 30, 2015

Contributor

(which is why I punted and went with OSLinux)

@boneill42

boneill42 Mar 30, 2015

Contributor

(which is why I punted and went with OSLinux)

@richardkchapman

This comment has been minimized.

Show comment
Hide comment
@richardkchapman

richardkchapman Mar 30, 2015

Member

The effect will be that the -P option will not work:

   -P, --procsched policy:priority
          This alters the process scheduler policy and priority of the process before starting it. The priority can be optionally specified by appending a : followed by the value.
          The default priority is 0. The currently supported policy values are other, fifo and rr.

AFAIK we don't use that option in any of our usage of this program (though I'm not really very familiar with how we use it - @Michael-Gardner or @xwang2713 may know more).

Member

richardkchapman commented Mar 30, 2015

The effect will be that the -P option will not work:

   -P, --procsched policy:priority
          This alters the process scheduler policy and priority of the process before starting it. The priority can be optionally specified by appending a : followed by the value.
          The default priority is 0. The currently supported policy values are other, fifo and rr.

AFAIK we don't use that option in any of our usage of this program (though I'm not really very familiar with how we use it - @Michael-Gardner or @xwang2713 may know more).

@Michael-Gardner

This comment has been minimized.

Show comment
Hide comment
@Michael-Gardner

Michael-Gardner Mar 30, 2015

Contributor

We don't use the -P option at all for start-stop-daemon. It shouldn't be an issue if OS X doesn't support it.

Contributor

Michael-Gardner commented Mar 30, 2015

We don't use the -P option at all for start-stop-daemon. It shouldn't be an issue if OS X doesn't support it.

@richardkchapman

View changes

tools/CMakeLists.txt
@@ -39,3 +39,7 @@ if ( CMAKE_SYSTEM MATCHES Linux )
message ("-- Building start-stop-daemon")
HPCC_ADD_SUBDIRECTORY (start-stop-daemon)
endif()
+

This comment has been minimized.

@richardkchapman

richardkchapman Mar 31, 2015

Member

Would be preferable to say

  if ( CMAKE_SYSTEM MATCHES "Linux|APPLE" )

above (and at the same time update the comment that says start-stop-daemon is linux only)

@richardkchapman

richardkchapman Mar 31, 2015

Member

Would be preferable to say

  if ( CMAKE_SYSTEM MATCHES "Linux|APPLE" )

above (and at the same time update the comment that says start-stop-daemon is linux only)

This comment has been minimized.

@boneill42

boneill42 Apr 2, 2015

Contributor

Agreed, will do.

@boneill42

boneill42 Apr 2, 2015

Contributor

Agreed, will do.

@boneill42 boneill42 changed the title from Updates that allow start-stop-daemon to build on OS X to Updates to build on OS X Apr 2, 2015

@boneill42

This comment has been minimized.

Show comment
Hide comment
@boneill42

boneill42 Apr 2, 2015

Contributor

Just a heads up, I'm pushing another change to this commit. jfile.cpp had an issue on OS X, which resulted in a failed ECL compile:

W20150402-123033 failed
UNIMPLEMENTED feature at /Users/bone/git/boneill42/hpcc/system/jlib/jfile.cpp(474)

Contributor

boneill42 commented Apr 2, 2015

Just a heads up, I'm pushing another change to this commit. jfile.cpp had an issue on OS X, which resulted in a failed ECL compile:

W20150402-123033 failed
UNIMPLEMENTED feature at /Users/bone/git/boneill42/hpcc/system/jlib/jfile.cpp(474)

boneill42 added some commits Apr 2, 2015

ECL compiles were failing on OS X, with:
<Result>
 <Exception><Code>4294967295</Code><Source>Roxie</Source><Message>UNIMPLEMENTED feature at /Users/bone/git/boneill42/hpcc/system/jlib/jfile.cpp(474)</Message></Exception>
</Result>

This commit fixes jfile, making the implementation the same as Linux.

Also -- addresses @richardkchapman's comments on the pull request.
@@ -470,8 +472,6 @@ bool CFile::setTime(const CDateTime * createTime, const CDateTime * modifiedTime
if (modifiedTime)
am.modtime = timetFromIDateTime (modifiedTime);
return (utime(filename, &am)==0);
-#else

This comment has been minimized.

@boneill42

boneill42 Apr 2, 2015

Contributor

NOTE: This is where the issue was -- was failing the ECL compile because this was UNIMPLEMENTED for APPLE

@boneill42

boneill42 Apr 2, 2015

Contributor

NOTE: This is where the issue was -- was failing the ECL compile because this was UNIMPLEMENTED for APPLE

Resolves an issue when compiling ECL on OS X.
@loader_path is not available in this context, which means the library cannot load.

This results in an error:

<Result>
 <Exception><Source>Roxie</Source><Message>Error loading /var/lib/HPCCSystems/queries/myroxie/libW20150402-131125.dylib: dlopen(/var/lib/HPCCSystems/queries/myroxie/libW20150402-131125.dylib, 2): Library not loaded: @loader_path/../lib/libeclrtl.dylib
  Referenced from: /var/lib/HPCCSystems/queries/myroxie/libW20150402-131125.dylib
  Reason: image not found</Message></Exception>
</Result>

This fixes that error and allows the ECL->C to link properly.

This final commit allows the helloworld.ecl to pass on OS X.
(running esp, dali, eclcc, and roxie)
@boneill42

This comment has been minimized.

Show comment
Hide comment
@boneill42

boneill42 Apr 2, 2015

Contributor

OK, with the final change to commonSetup.cmake, I am able to run esp, eclcc, dali and roxie on OS X. I can issue the helloworld.ecl, and receive a valid result!

Contributor

boneill42 commented Apr 2, 2015

OK, with the final change to commonSetup.cmake, I am able to run esp, eclcc, dali and roxie on OS X. I can issue the helloworld.ecl, and receive a valid result!

@boneill42

This comment has been minimized.

Show comment
Hide comment
@boneill42

boneill42 Apr 2, 2015

Contributor

Update: the plugins work as well, but I needed to copy the libraries into /opt/HPCCSystems/lib.

Contributor

boneill42 commented Apr 2, 2015

Update: the plugins work as well, but I needed to copy the libraries into /opt/HPCCSystems/lib.

@richardkchapman

This comment has been minimized.

Show comment
Hide comment
@richardkchapman

richardkchapman Apr 20, 2015

Member

Worth opening a JIRA for the plugins issue. I can take a look at that (or you can if you get to it first).

Member

richardkchapman commented Apr 20, 2015

Worth opening a JIRA for the plugins issue. I can take a look at that (or you can if you get to it first).

richardkchapman added a commit that referenced this pull request Apr 20, 2015

Merge pull request #7166 from boneill42/master
Updates to build on OS X

Reviewed-By: Michael Gardner <michael.gardner@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>

@richardkchapman richardkchapman merged commit 6f2c8d8 into hpcc-systems:master Apr 20, 2015

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