From 3be80d165e227598676a6117e2eb0bfb2980b9f3 Mon Sep 17 00:00:00 2001 From: Warrick Ball Date: Sat, 28 Dec 2024 19:39:49 +0000 Subject: [PATCH] neu: port to new build system --- install | 1 - make/subdirs.mk | 2 +- neu/Makefile | 23 ++++++++ neu/build_and_test | 3 - neu/build_and_test_parallel | 3 - neu/clean | 2 - neu/export | 2 - neu/i1 | 1 - neu/i1p | 1 - neu/make/makefile | 8 --- neu/make/makefile_base | 111 ------------------------------------ neu/mk | 1 - neu/test/ck | 1 - neu/test/clean | 2 - neu/test/cleanup | 4 -- neu/test/export | 2 - neu/test/make/makefile | 8 --- neu/test/make/makefile_base | 92 ------------------------------ neu/test/mk | 14 ----- neu/test/mkx | 1 - neu/test/rn | 3 - touch | 1 - 22 files changed, 24 insertions(+), 262 deletions(-) create mode 100644 neu/Makefile delete mode 100755 neu/build_and_test delete mode 100755 neu/build_and_test_parallel delete mode 100755 neu/clean delete mode 100755 neu/export delete mode 100755 neu/i1 delete mode 100755 neu/i1p delete mode 100644 neu/make/makefile delete mode 100644 neu/make/makefile_base delete mode 100755 neu/mk delete mode 100755 neu/test/ck delete mode 100755 neu/test/clean delete mode 100755 neu/test/cleanup delete mode 100755 neu/test/export delete mode 100644 neu/test/make/makefile delete mode 100644 neu/test/make/makefile_base delete mode 100755 neu/test/mk delete mode 100755 neu/test/mkx delete mode 100755 neu/test/rn diff --git a/install b/install index 8be9f793d..b592264dc 100755 --- a/install +++ b/install @@ -335,7 +335,6 @@ function do_input_data { cd .. } -do_one_parallel neu do_one_parallel net if [ ! -r data/ionization_data ] diff --git a/make/subdirs.mk b/make/subdirs.mk index 47f83682b..64ab0bfa5 100644 --- a/make/subdirs.mk +++ b/make/subdirs.mk @@ -1 +1 @@ -SUBDIRS := const utils math mtx auto_diff num interp_1d interp_2d chem eos forum colors rates gyre kap +SUBDIRS := const utils math mtx auto_diff num interp_1d interp_2d chem eos forum colors rates neu gyre kap diff --git a/neu/Makefile b/neu/Makefile new file mode 100644 index 000000000..2c67f1d8b --- /dev/null +++ b/neu/Makefile @@ -0,0 +1,23 @@ +include ../make/defaults-module.mk + +# Build + +MODULE_NAME := neu +SRCS := public/neu_def.f90 \ + public/neu_lib.f90 \ + private/mod_neu.f90 +SRCS_CHECK := test/src/test_neu.f90 +INTERNAL_DEPENDS_ON := const utils math +EXTERNAL_DEPENDS_ON := +BINTYPE := static-lib + +# Testing + +CHECK_RESULTS_GOLDEN := test/test_output + +# Install + +MODULES := neu_def.mod neu_lib.mod +INSTALL_INCLUDES := + +include $(MAKE_DIR)/Makefile diff --git a/neu/build_and_test b/neu/build_and_test deleted file mode 100755 index e02a156fe..000000000 --- a/neu/build_and_test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -../utils/build_and_test diff --git a/neu/build_and_test_parallel b/neu/build_and_test_parallel deleted file mode 100755 index 2b3599335..000000000 --- a/neu/build_and_test_parallel +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -../utils/build_and_test_parallel diff --git a/neu/clean b/neu/clean deleted file mode 100755 index 6957bce5c..000000000 --- a/neu/clean +++ /dev/null @@ -1,2 +0,0 @@ -cd make; make clean -cd ../test/make; make clean \ No newline at end of file diff --git a/neu/export b/neu/export deleted file mode 100755 index db3250885..000000000 --- a/neu/export +++ /dev/null @@ -1,2 +0,0 @@ - -../utils/e1 diff --git a/neu/i1 b/neu/i1 deleted file mode 100755 index 8c377979b..000000000 --- a/neu/i1 +++ /dev/null @@ -1 +0,0 @@ -../utils/i1 diff --git a/neu/i1p b/neu/i1p deleted file mode 100755 index 75f0da679..000000000 --- a/neu/i1p +++ /dev/null @@ -1 +0,0 @@ -../utils/i1p diff --git a/neu/make/makefile b/neu/make/makefile deleted file mode 100644 index 2a4718cad..000000000 --- a/neu/make/makefile +++ /dev/null @@ -1,8 +0,0 @@ -# QUIET makes the output from the compilation process much less verbose -- basically, -# show which files are being compiled with which generic compilation command. The -# goal of QUIET is to make it easier to spot warnings and/or circular dependency -# errors. - -QUIET = yes - -include makefile_base diff --git a/neu/make/makefile_base b/neu/make/makefile_base deleted file mode 100644 index 2940763bb..000000000 --- a/neu/make/makefile_base +++ /dev/null @@ -1,111 +0,0 @@ -# This is the makefile for the mesa neutrino losses library - -MESA_DIR = ../.. - -################################################################# -# -# PREAMBLE - -include $(MESA_DIR)/utils/makefile_header - -################################################################# -# -# SOURCES - -SRCS = \ - neu_def.f90 \ - mod_neu.f90 \ - neu_lib.f90 - -################################################################# -# -# LIBRARIES - -ifeq ($(USE_SHARED), YES) - LIBS_OTHER = $(LIBS_MESA_NUMERICS) - DEPS_OTHER = $(patsubst %,$(MESA_LIB_DIR)/lib%.$(LIB_SUFFIX),$(LIBS_OTHER)) - LOAD_OTHER = -L$(MESA_LIB_DIR) $(LOAD_MESA_NUMERICS) -endif - -################################################################# -# -# TARGETS - -LIB = libneu.$(LIB_SUFFIX) - -OBJS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(SRCS))) - -$(LIB) : $(OBJS) $(DEPS_OTHER) -ifneq ($(QUIET),) - @echo LIB_TOOL $(LIB) - @$(LIB_TOOL) $(LIB) $(OBJS) $(LOAD_OTHER) -else - $(LIB_TOOL) $(LIB) $(OBJS) $(LOAD_OTHER) -endif - -clean: - -@rm -f *.o *.mod *genmod.f90 *.so *.a .depend *.smod - -install: - @$(CP_IF_NEWER) neu_lib.mod $(MESA_DIR)/include - @$(CP_IF_NEWER) neu_def.mod $(MESA_DIR)/include - @$(CP_IF_NEWER) $(LIB) $(MESA_DIR)/lib - -nodeps : $(.DEFAULT_GOAL) - -################################################################# -# -# COMPILATION RULES - -COMPILE = $(COMPILE_TO_DEPLOY) $(FCfree) -#COMPILE = $(COMPILE_TO_TEST) $(FCfree) -#COMPILE = $(COMPILE_NO_OPT) $(FCfree) - -COMPILE_CMD = $(COMPILE) - -%.o : %.mod - -%.o : %.f -ifneq ($(QUIET),) - @echo COMPILE_CMD $< - @$(COMPILE_CMD) $< -else - $(COMPILE_CMD) $< -endif - -%.o : %.f90 -ifneq ($(QUIET),) - @echo COMPILE_CMD $< - @$(COMPILE_CMD) $< -else - $(COMPILE_CMD) $< -endif - -%.mod : %.o - @true - -################################################################# -# -# DEPENDENCIES - -SRC_PATH = $(MOD_PUBLIC_DIR):$(MOD_PRIVATE_DIR) - -vpath %.f90 $(SRC_PATH) - -vpath %.mod $(MESA_DIR)/include - -NODEPS = $(or $(filter nodeps,$(MAKECMDGOALS)),$(filter clean,$(MAKECMDGOALS))) - -ifeq ($(NODEPS),) - - .depend : - ifneq ($(QUIET),) - @echo MAKEDEPF90 - @$(MAKEDEPF90) -I$(SRC_PATH) $(SRCS) > .depend - else - $(MAKEDEPF90) -I$(SRC_PATH) $(SRCS) > .depend - endif - - -include .depend - -endif diff --git a/neu/mk b/neu/mk deleted file mode 100755 index f2ac277d6..000000000 --- a/neu/mk +++ /dev/null @@ -1 +0,0 @@ -cd make; make \ No newline at end of file diff --git a/neu/test/ck b/neu/test/ck deleted file mode 100755 index c429ea480..000000000 --- a/neu/test/ck +++ /dev/null @@ -1 +0,0 @@ -./../../utils/test/ck \ No newline at end of file diff --git a/neu/test/clean b/neu/test/clean deleted file mode 100755 index fe8d63c0c..000000000 --- a/neu/test/clean +++ /dev/null @@ -1,2 +0,0 @@ -cd make -make clean diff --git a/neu/test/cleanup b/neu/test/cleanup deleted file mode 100755 index e383ea3f7..000000000 --- a/neu/test/cleanup +++ /dev/null @@ -1,4 +0,0 @@ -cd make -make clean -cd ../../make -make clean diff --git a/neu/test/export b/neu/test/export deleted file mode 100755 index 0f6ebc965..000000000 --- a/neu/test/export +++ /dev/null @@ -1,2 +0,0 @@ -cd .. -./export diff --git a/neu/test/make/makefile b/neu/test/make/makefile deleted file mode 100644 index 2a4718cad..000000000 --- a/neu/test/make/makefile +++ /dev/null @@ -1,8 +0,0 @@ -# QUIET makes the output from the compilation process much less verbose -- basically, -# show which files are being compiled with which generic compilation command. The -# goal of QUIET is to make it easier to spot warnings and/or circular dependency -# errors. - -QUIET = yes - -include makefile_base diff --git a/neu/test/make/makefile_base b/neu/test/make/makefile_base deleted file mode 100644 index 306f71503..000000000 --- a/neu/test/make/makefile_base +++ /dev/null @@ -1,92 +0,0 @@ -# This is the makefile for testing the mesa neutrino losses library - -MESA_DIR = ../../.. - -################################################################# -# -# PREAMBLE - -include $(MESA_DIR)/utils/makefile_header - -################################################################# -# -# SOURCES - -TEST_SRCS = neu_support.f90 test_neu.f90 - -################################################################# -# -# LIBRARIES - -LIBS_LOCAL = neu -DEPS_LOCAL = $(patsubst %,$(LOCAL_LIB_DIR)/lib%.$(LIB_SUFFIX),$(LIBS_LOCAL)) -LOAD_LOCAL = -L$(LOCAL_LIB_DIR) $(addprefix -l,$(LIBS_LOCAL)) - -LIBS_OTHER = $(LIBS_MESA_NUMERICS) -DEPS_OTHER = $(patsubst %,$(MESA_LIB_DIR)/lib%.$(LIB_SUFFIX),$(LIBS_OTHER)) -LOAD_OTHER = -L$(MESA_LIB_DIR) $(LOAD_MESA_NUMERICS) - -################################################################# -# -# TARGETS - -TEST = $(TEST_DIR)/tester - -TEST_OBJS = $(patsubst %.f90,%.o,$(TEST_SRCS)) - -all : $(TEST) - -$(TEST) : $(TEST_OBJS) $(DEPS_LOCAL) $(DEPS_OTHER) - -$(TEST) : OBJS = $(TEST_OBJS) - -$(TEST_DIR)/% : -ifneq ($(QUIET),) - @echo LOADER $@ - @$(LOADER) $(FCopenmp) -o $@ $(OBJS) $(LOAD_LOCAL) $(LOAD_OTHER) $(LD_FLAGS) -else - $(LOADER) $(FCopenmp) -o $@ $(OBJS) $(LOAD_LOCAL) $(LOAD_OTHER) $(LD_FLAGS) -endif - -clean: - -@rm -f *.o *.mod *.smod .depend $(TEST) - -nodeps : $(.DEFAULT_GOAL) - -################################################################# -# -# COMPILATION RULES - -%.o: %.f90 -ifneq ($(QUIET),) - @echo TEST_COMPILE $< - @$(TEST_COMPILE) $(FCfree) $< -else - $(TEST_COMPILE) $(FCfree) $< -endif - -################################################################# -# -# DEPENDENCIES - -SRC_PATH = $(TEST_SRC_DIR) - -vpath %.f90 $(TEST_SRC_DIR) - -vpath %.mod $(LOCAL_LIB_DIR):$(MESA_DIR)/include - -NODEPS = $(or $(filter nodeps,$(MAKECMDGOALS)),$(filter clean,$(MAKECMDGOALS))) - -ifeq ($(NODEPS),) - - .depend : - ifneq ($(QUIET),) - @echo MAKEDEPF90 - @$(MAKEDEPF90) -I$(SRC_PATH) $(SRCS) > .depend - else - $(MAKEDEPF90) -I$(SRC_PATH) $(SRCS) > .depend - endif - - -include .depend - -endif diff --git a/neu/test/mk b/neu/test/mk deleted file mode 100755 index 78c91b0e9..000000000 --- a/neu/test/mk +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -function check_okay { - if [ $? -ne 0 ] - then - echo - echo "FAILED" - echo - exit 1 - fi -} - -cd ../make; make; check_okay -cd ../test/make; make diff --git a/neu/test/mkx b/neu/test/mkx deleted file mode 100755 index 25826f7f3..000000000 --- a/neu/test/mkx +++ /dev/null @@ -1 +0,0 @@ -./mk; ./export diff --git a/neu/test/rn b/neu/test/rn deleted file mode 100755 index e5d7960ab..000000000 --- a/neu/test/rn +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./tester diff --git a/touch b/touch index da0727a90..3cfee997d 100755 --- a/touch +++ b/touch @@ -25,7 +25,6 @@ do_one atm do_one binary do_one ionization do_one net -do_one neu do_one sample do_one star do_one star_data