-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6454 from garlick/macos
fix macos portability issues
- Loading branch information
Showing
32 changed files
with
258 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -625,6 +625,8 @@ gc | |
tgz | ||
tmpfiles | ||
EDEADLOCK | ||
EDEADLK | ||
BSD | ||
setpgrp | ||
nosetpgrp | ||
checkpointed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
die() { | ||
echo "$(basename $0): $@" >&2 | ||
exit 1 | ||
} | ||
|
||
DEPS_SCRIPT=scripts/install-deps-macos.sh | ||
|
||
test -f $DEPS_SCRIPT || die "please run from the top level of the source tree" | ||
test -d macos-venv || die "please run $DEPS_SCRIPT first" | ||
|
||
eval "$(/opt/homebrew/bin/brew shellenv)" | ||
|
||
CPPFLAGS=-I${HOMEBREW_PREFIX}/include/lua | ||
CPPFLAGS="-I$(brew --prefix epoll-shim)/include/libepoll-shim ${CPPFLAGS}" | ||
LDFLAGS=-L${HOMEBREW_PREFIX}/lib | ||
|
||
PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config) | ||
PKG_CONFIG_PATH=$(brew --prefix libarchive)/lib/pkgconfig:${PKG_CONFIG_PATH} | ||
|
||
PATH=$(brew --prefix libtool)/libexec/gnubin:$PATH | ||
|
||
source macos-venv/bin/activate | ||
|
||
./autogen.sh | ||
|
||
CPPFLAGS=$CPPFLAGS LDFLAGS=$LDFLAGS PKG_CONFIG_PATH=$PKG_CONFIG_PATH \ | ||
./configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
die() { | ||
echo "$(basename $0): $@" >&2 | ||
exit 1 | ||
} | ||
|
||
test -f scripts/requirements-dev.txt || die "Please run from top of source tree" | ||
|
||
eval "$(/opt/homebrew/bin/brew shellenv)" | ||
|
||
brew install \ | ||
autoconf \ | ||
automake \ | ||
libtool \ | ||
make \ | ||
pkg-config \ | ||
epoll-shim \ | ||
zeromq \ | ||
jansson \ | ||
lz4 \ | ||
libarchive \ | ||
hwloc \ | ||
sqlite \ | ||
[email protected] \ | ||
python3 \ | ||
cffi \ | ||
libyaml \ | ||
jq | ||
|
||
brew link [email protected] | ||
|
||
python3 -m venv macos-venv | ||
source macos-venv/bin/activate | ||
|
||
pip3 install setuptools | ||
pip3 install -r scripts/requirements-dev.txt | ||
|
||
echo "Now run scripts/configure-macos.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
#if HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
#include <string.h> | ||
#include <errno.h> | ||
|
||
#include "mempcpy.h" | ||
|
||
void *mempcpy (void *dest, const void *src, size_t len) | ||
{ | ||
return memcpy (dest, src, len) + len; | ||
} | ||
|
||
// vi:ts=4 sw=4 expandtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
#ifndef _MEMPCPY_H | ||
#define _MEMPCPY_H 1 | ||
|
||
void *mempcpy (void *dest, const void *src, size_t len); | ||
|
||
#endif // !_MEMPCPY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
#if HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
#include <unistd.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
|
||
#include "pipe2.h" | ||
|
||
static int setflags (int fd, int flags) | ||
{ | ||
int oflags; | ||
if ((oflags = fcntl (fd, F_GETFL)) < 0 | ||
|| fcntl (fd, F_SETFL, oflags | flags) < 0) | ||
return -1; | ||
return 0; | ||
} | ||
|
||
int pipe2 (int pipefd[2], int flags) | ||
{ | ||
int pfd[2]; | ||
if (pipe (pfd) < 0) | ||
return -1; | ||
if (setflags (pfd[0], flags) < 0 || setflags (pfd[1], flags) < 0) { | ||
int saved_errno = errno; | ||
(void)close (pfd[0]); | ||
(void)close (pfd[1]); | ||
errno = saved_errno; | ||
return -1; | ||
} | ||
pipefd[0] = pfd[0]; | ||
pipefd[1] = pfd[1]; | ||
return 0; | ||
} | ||
|
||
// vi:ts=4 sw=4 expandtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
#ifndef _PIPE2_H | ||
#define _PIPE2_H 1 | ||
|
||
int pipe2 (int pipefd[2], int flags); | ||
|
||
#endif // !_PIPE2_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.