Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ doc/amuse_examples
/nbody6xx.input
/test_results
autom4te.cache/
lib/sapporo_2/src/sapporo2-master
lib/sapporo_2/src/master.tgz
lib/sapporo_2/*.tar.gz
lib/sapporo_2/src



Expand Down
9 changes: 8 additions & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: Makefile
AMUSE_LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
AMUSE_LIBS = $(filter-out Makefile sapporo_light sapporo_2, $(wildcard *))


# We build sapporo_light separately and only on demand, because it needs CUDA and we
Expand All @@ -9,6 +9,13 @@ AMUSE_LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
$(MAKE) -C sapporo_light $*


# We build sapporo2 separately and only on demand, because it needs CUDA and we
# may not have that.
.PHONY: %-sapporo2
%-sapporo2:
$(MAKE) -C sapporo_2 $*


.PHONY: install uninstall clean distclean
install uninstall clean distclean: $(AMUSE_LIBS)

Expand Down
94 changes: 88 additions & 6 deletions lib/sapporo_2/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,92 @@
.PHONY: Makefile install uninstall
install uninstall:
@echo Sapporo2 is disabled for the moment, please let us know if you need it.
.PHONY: Makefile support/shared/lib-configure.mk
include support/shared/lib-configure.mk

.PHONY:

# Main targets
.PHONY: all
all: sapporo2

.DEFAULT_GOAL := all

VERSION := eeac0835f80d6e0e8ca778bdea4dbf3ae799ca29


# Install into an active venv or Conda env if no location is specified
ifdef VIRTUAL_ENV
PREFIX ?= $(VIRTUAL_ENV)
endif

ifdef CONDA_PREFIX
PREFIX ?= $(CONDA_PREFIX)
endif

ifndef PREFIX
ifeq ($(filter-out %install, $(MAKECMDGOALS)),)
$(error PREFIX is not set and no virtualenv or Conda env is active)
endif
endif


SRCDIR := src/sapporo2-$(VERSION)

sapporo2-$(VERSION).tar.gz:
$(DOWNLOAD) https://github.com/treecode/sapporo2/archive/$(VERSION).tar.gz >$@

src:
mkdir -p $@

$(SRCDIR): sapporo2-$(VERSION).tar.gz | src
$(TAR) xzf $<
mv sapporo2-$(VERSION) src/


.PHONY: sapporo2
sapporo2: | $(SRCDIR)
$(MAKE) -C $(SRCDIR) all PREFIX=$(PREFIX)


PKG_CONFIG_FILE := sapporo2.pc

define PKG_CONFIG_CONTENTS :=
prefix=$(PREFIX)
includedir=$${prefix}/include
libdir=$${prefix}/lib

Name: sapporo2
Description: The sapporo2 library
Version: $(VERSION)
Cflags: -I$${includedir}
Libs: -L$${libdir} -lsapporo2

endef

$(PKG_CONFIG_FILE):
# the file function is not available on old macOS make, so we make do with this
printf '' >$@
$(foreach line,$(PKG_CONFIG_CONTENTS),printf '%s\n' '$(line)' >>$@;)



# Note that the pkg-config files get built at install time, because PREFIX
# ends up inside of them, and it may not be defined when make all is called.
.PHONY: install
install: all $(PKG_CONFIG_FILE)
$(MAKE) -C $(SRCDIR) install PREFIX=$(PREFIX)
install -m 644 $(PKG_CONFIG_FILE) $(PREFIX)/lib/pkgconfig


.PHONY: uninstall
uninstall:
$(MAKE) -C $(SRCDIR) uninstall PREFIX=$(PREFIX)
rm -f $(PREFIX)/lib/pkgconfig/$(PKG_CONFIG_FILE)


.PHONY: clean
clean:
-$(MAKE) -C $(SRCDIR) clean
rm -f support/config.mk support/config.log support/config.status

.PHONY:
distclean:
.PHONY: distclean
distclean: clean
rm -rf support/autom4te.cache support/configure~

90 changes: 0 additions & 90 deletions lib/sapporo_2/download.py

This file was deleted.

6 changes: 6 additions & 0 deletions lib/sapporo_2/support/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
configure~
autom4te.cache
config.mk
config.log
config.status

18 changes: 18 additions & 0 deletions lib/sapporo_2/support/aclocal.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-

# Copyright (C) 1996-2021 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_include([shared/m4/amuse_cuda.m4])
m4_include([shared/m4/amuse_detect_os.m4])
m4_include([shared/m4/amuse_download.m4])
m4_include([shared/m4/amuse_log_envvars.m4])
17 changes: 17 additions & 0 deletions lib/sapporo_2/support/config.mk.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AMUSE_ON_MACOS = @AMUSE_ON_MACOS@

DOWNLOAD = @DOWNLOAD@
TAR = @TAR@

CC = @CC@
CXX = @CXX@

AR = @AR@
RANLIB = @RANLIB@
INSTALL = @INSTALL@

CUDA_TK = @CUDA_TK@
NVCC = @NVCC@
CUDA_FLAGS = @CUDA_FLAGS@
CUDA_LDFLAGS = @CUDA_LDFLAGS@

Loading
Loading