Skip to content

Commit

Permalink
download_codes fixes for bonsai, flash and some fixes for mocassin (b…
Browse files Browse the repository at this point in the history
…ut that one needs

source update)
  • Loading branch information
ipelupessy committed Sep 22, 2022
1 parent 1f7ff91 commit e1220db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/amuse/community/bonsai2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CODELIB = src/bonsai/runtime/libbonsai_amuse.a

DOWNLOAD_FROM_WEB = $(PYTHON) ./download.py

DOWNLOAD_CODES?=1

all: compile bonsai_worker

Expand Down
25 changes: 2 additions & 23 deletions src/amuse/community/flash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,15 @@ flash_obj = $(filter-out $(ignore_obj), $(allflash_obj))

all: flash_worker

ifdef DOWNLOAD_CODES
$(CODEDIR)/makefile:
make -C . download
else
$(CODEDIR)/makefile:
@echo ""
@echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@echo ""
@echo "DOWNLOAD_CODES is not set. FLASH will not be downloaded and build."
@echo "If you do want FLASH, set DOWNLOAD_CODES to 1."
@echo "bash> export DOWNLOAD_CODES=1"
@echo "csh> setenv DOWNLOAD_CODES 1"
@echo "*** Unfortunately due to flash download restrictions;"
@echo "*** FLASH CANNOT be download automatically by this makefile"
@echo "*** Please register and download flash yourself"
@echo "*** You can do so at https://flash.rochester.edu/site/flashcode/coderequest/"
@echo ""
@echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@echo ""
@make -s --no-print-directory -C . raise_error
endif

download:
@echo ""
@echo "*** Unfortunately due to flash download restrictions;"
@echo "*** FLASH CANNOT be download automatically by this makefile"
@echo "*** Please register and download flash yourself"
@echo "*** You can do so at https://flash.rochester.edu/site/flashcode/coderequest/"
@echo ""
@make -s --no-print-directory -C . raise_error
@echo "*** aafter downloading, extract or copy the source to $(CODEDIR) such that a $(CODEDIR)/makefile exists"
@exit -1

clean:
$(RM) -f *.so *.o *.pyc worker_code.cc worker_code.h #flash.par
Expand Down
7 changes: 4 additions & 3 deletions src/amuse/community/mocassin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ OBJECTS = $(SOURCES:.f90=.o)
DOWNLOAD_FROM_WEB = $(PYTHON) ./download.py
PATCH_FILES = $(PYTHON) ./patch_files.py

DOWNLOAD_CODES?=1

FFLAGS += -Wall -g -I$(CODEDIR)/source
FFLAGS += -Wall -g -I$(CODEDIR)/source -fallow-invalid-boz
LDFLAGS += -lm $(MUSE_LD_FLAGS)

all: mocassin_worker
Expand All @@ -59,7 +60,7 @@ endif

download:
$(RM) -Rf .pc
$(DOWNLOAD_FROM_WEB) $(VERSION)
$(DOWNLOAD_FROM_WEB) --version $(VERSION)
$(PATCH_FILES)
make -C $(CODEDIR) clean

Expand All @@ -79,7 +80,7 @@ $(CODELIB): $(CODEDIR)/makefile
echo $(FC)
echo $(FORTRAN)
make -C $(CODEDIR) clean
make -C $(CODEDIR) all
make -C $(CODEDIR) all FFLAGS="$(FFLAGS)"

worker_code.f90: interface.py
$(CODE_GENERATOR) --type=f90 interface.py MocassinInterface -o $@
Expand Down
2 changes: 1 addition & 1 deletion src/amuse/community/mocassin/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def unpack_downloaded_file(self, filename):
cwd=os.path.join(self.src_directory())
)
subprocess.call(
['mv', 'mocassin.{version}'.format(version = self.version), 'mocassin'],
['ln','-s', 'mocassin.{version}'.format(version = self.version), 'mocassin'],
cwd = os.path.join(self.src_directory())
)
print("done")
Expand Down

0 comments on commit e1220db

Please sign in to comment.