Skip to content

Support macOS in the pipeline Makefile - #158

Open
ibirol wants to merge 1 commit into
mainfrom
macos-arm64
Open

ibirol wants to merge 1 commit into
mainfrom
macos-arm64

Conversation

@ibirol

@ibirol ibirol commented Oct 26, 2026

Copy link
Copy Markdown

Two small changes to the pipeline Makefile (bin/goldrush) so that it runs cleanly on macOS. Linux behaviour is unchanged.

Changes

  • track_time=1: on macOS without GNU time (gtime), use /usr/bin/time -l. macOS time has no -v, so timing failed there. gtime and memusg still take precedence when installed.
  • shared_mem: default to /dev/shm only where it exists. Elsewhere, such as macOS, the polishing step passes the working directory to GoldPolish. GoldPolish already falls back to that directory, so polishing is unchanged, without the /dev/shm not present warning. An explicit shared_mem= still wins.

Testing

On macOS 27 with Apple Silicon (arm64):

  • tests/goldrush_test_demo.sh passes (L50 = 2). With track_time=1, each step writes a .time file.
  • make -n with the system GNU Make 3.81 shows the expected commands without /dev/shm, with and without an explicit shared_mem=, and with track_time=1.

Not run on Linux. There $(wildcard /dev/shm) is non-empty, so shared_mem stays /dev/shm, and the timing branch only applies when uname -s is Darwin.

Running GoldRush on Apple Silicon

GoldRush compiles on Apple Silicon without source changes, but packages are missing:

Once #153 is released, osx-arm64 recipes on bioconda would make GoldRush installable on Apple Silicon.

🤖 Generated with Claude Code

- track_time=1: on macOS without GNU time (gtime), use /usr/bin/time -l.
  macOS time has no -v option, so timing failed there.
- shared_mem: default to /dev/shm only where it exists. Elsewhere, such as
  macOS, pass the working directory to GoldPolish. That is where GoldPolish
  already falls back to, so polishing behaves the same, without the
  "/dev/shm not present" warning. An explicit shared_mem= still wins.

Tested on macOS (Apple Silicon, arm64) with tests/goldrush_test_demo.sh:
the demo passes (L50 = 2), and with track_time=1 each step writes a
.time file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ibirol
ibirol requested review from jwong-1 and lcoombe October 26, 2026 19:28
Comment thread bin/goldrush
Comment on lines +16 to +18
# Shared memory location for GoldPolish. Left empty on systems without /dev/shm
# (e.g. macOS); polishing then runs in the working directory, as GoldPolish
# itself would.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Shared memory location for GoldPolish. Left empty on systems without /dev/shm
# (e.g. macOS); polishing then runs in the working directory, as GoldPolish
# itself would.
# Shared memory location for GoldPolish.

I might suggest leaving the comment as-is, since the default is already documented in the help page, and it can also be explicitly set by a user.

Comment thread bin/goldrush
Comment on lines +125 to 130
else ifeq ($(shell uname -s),Darwin)
# macOS time has no -v; -l reports the same run time and peak memory
time=command /usr/bin/time -l -o $@.time
else
time=command time -v -o $@.time
endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
else ifeq ($(shell uname -s),Darwin)
# macOS time has no -v; -l reports the same run time and peak memory
time=command /usr/bin/time -l -o $@.time
else
time=command time -v -o $@.time
endif
else ifeq ($(shell /usr/bin/time -v true >/dev/null 2>&1 && echo yes),yes)
time=command /usr/bin/time -v -o $@.time
else
time=command /usr/bin/time -l -o $@.time
endif

A suggestion for how it could be updated without making any explicit OS assumptions

Comment thread bin/goldrush
# Shared memory location for GoldPolish. Left empty on systems without /dev/shm
# (e.g. macOS); polishing then runs in the working directory, as GoldPolish
# itself would.
shared_mem=$(if $(wildcard /dev/shm),/dev/shm,)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
shared_mem=$(if $(wildcard /dev/shm),/dev/shm,)
shared_mem=$(if $(wildcard /dev/shm),/dev/shm,$(CURDIR))

If we handle the /dev/shm check and fallback to the current directory here, we could simplify the goldpolish command below by removing the additional logic.

Comment thread bin/goldrush

%.goldpolish-polished.fa: %.fa $(long_reads)
$(time) $(set_ulimit) goldpolish $(goldpolish_opts) -t$(t) -m$(shared_mem) $< $(long_reads) $@
$(time) $(set_ulimit) goldpolish $(goldpolish_opts) -t$(t) -m$(or $(shared_mem),$(CURDIR)) $< $(long_reads) $@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we change the default setting of shared_mem as suggested above, we could revert this change

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants