Skip to content
Draft
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
15 changes: 3 additions & 12 deletions adipls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ SRCS := adipack.c/adipls/adipls.c.d.f \
adipack.c/gensr/notwni.f \
adipack.c/gensr/nrk.d.f \
adipack.c/gensr/ofiles.c.f \
adipack.c/gensr/ofiles.f \
adipack.c/gensr/rdilst.f \
adipack.c/gensr/rnmean.d.f \
adipack.c/gensr/skpcom.f \
Expand All @@ -93,22 +92,14 @@ SRCS := adipack.c/adipls/adipls.c.d.f \
adipack.c/gensr/vinta.d.f \
adipack.c/gensr/vintk.new.d.f \
adipack.c/gensr/zero.d.f \
adipack.c/adiajobs/sr/inrnge.f \
adipack.c/adiajobs/sr/intmdl.d.f \
adipack.c/adiajobs/sr/rdamdl.n.d.f \
adipack.c/adiajobs/sr/rdfreq.d.f \
adipack.c/adiajobs/sr/rdfrqe.d.f \
adipack.c/adiajobs/sr/rdfrqm.d.f \
adipack.c/adiajobs/sr/rseta4.c.d.f \
adipack.c/adiajobs/sr/setssm.d.f \
adipack.c/adiajobs/sr/srdist.c.d.f \
adipack.c/adiajobs/sr/wrfreq.d.f \
adipack.c/adiajobs/sr/rseta4.c.d.f \
src/callbacks.f90

SRCS_CHECK :=
INTERNAL_DEPENDS_ON := const
INTERNAL_DEPENDS_ON := const utils
EXTERNAL_DEPENDS_ON :=
BINTYPE = static-lib
BINTYPE = lib
INCLUDE_DIRS := -Iadipack.c/adipls
MODULES := adipls_callbacks.mod
# adipls has too much UB, plaster over it by disabling optimizations. If you
Expand Down
4 changes: 2 additions & 2 deletions adipls/adipack.c/adiajobs/mer-sum.d.f
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ program main
else if(icasin.eq.2) then
xl1=cs1(1)
else
xl1=dfloat(l1)
xl1=dble(l1)
end if
c
c test for the same mode
Expand Down Expand Up @@ -176,7 +176,7 @@ program main
else if(icasin.eq.2) then
xl2=cs2(1)
else
xl2=dfloat(l2)
xl2=dble(l2)
end if
c
c test for the same mode
Expand Down
6 changes: 3 additions & 3 deletions adipls/adipack.c/adiajobs/set-dnl.d.f
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ program main
if(isetdf.eq.1) then
c
if(iscale.eq.1) then
dfreq=3.d0*dfreq/dfloat(2*ls(n1)+3)
dfreq=3.d0*dfreq/dble(2*ls(n1)+3)
else if(iscale.eq.2) then
dfreq=2.d0*dfreq/dfloat(ls(n1)+2)
dfreq=2.d0*dfreq/dble(ls(n1)+2)
end if
c
c test for setting error
Expand All @@ -172,7 +172,7 @@ program main
write(6,140) ls(n1),ns(n1), freqs(n1), dfreq
else
errdnl=sqrt(errfrs(n1)*errfrs(n1)+errfrs(n2)*errfrs(n2))
if(iscale.eq.1) errdnl=errdnl*3.d0/dfloat(2*ls(n1)+3)
if(iscale.eq.1) errdnl=errdnl*3.d0/dble(2*ls(n1)+3)
write(10,140) ls(n1),ns(n1), freqs(n1), dfreq, errdnl
write(6,140) ls(n1),ns(n1), freqs(n1), dfreq, errdnl
end if
Expand Down
2 changes: 1 addition & 1 deletion adipls/adipack.c/adiajobs/setexec.d.f
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ program main
c.. write(6,100)
c
interp=l2.gt.0
if(interp) nsel=max(0.5d0+dfloat(l2-l1-1)/dels,1.d0)
if(interp) nsel=max(0.5d0+dble(l2-l1-1)/dels,1.d0)
c
c.. write(6,exec)
c
Expand Down
2 changes: 1 addition & 1 deletion adipls/adipack.c/gensr/sort.d.f
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine sort(a,b,nn)
sum=0.d0
do 12 i=n1,n2
12 sum=sum+a(i)
amean=sum/dfloat(n2-n1+1)
amean=sum/dble(n2-n1+1)
ii=n1-1
jj=n2+1
go to 16
Expand Down
1 change: 1 addition & 0 deletions adipls/adipack.c/gensr/spline.d.f
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ subroutine spline(x,y,n,yp1,ypn,y2)
return
end
subroutine splint(xa,ya,y2a,n,x,y)
use utils_lib, only: mesa_error
implicit double precision(a-h,o-z)
dimension xa(n),ya(n),y2a(n)
klo=1
Expand Down
4 changes: 2 additions & 2 deletions astero/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ else
SRCS += private/adipls_support_stub.f90
endif

SRCS_CHECK = test/src/test_astero.f90
BINTYPE := static-lib
SRCS_CHECK = test/src/test_astero.f90 test/src/run_star_extras.f90
BINTYPE := lib
INCLUDE_DIRS := -Iprivate -Ipublic -Idefaults

# Testing
Expand Down
37 changes: 37 additions & 0 deletions astero/test/src/run_star_extras.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! ***********************************************************************
!
! Copyright (C) 2010 Bill Paxton & The MESA Team
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU Lesser General Public License
! as published by the Free Software Foundation,
! either version 3 of the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! See the GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with this program. If not, see <https://www.gnu.org/licenses/>.
!
! ***********************************************************************

! While not in use, this is to satisfy dynamic linking

module run_star_extras

use star_lib
use star_def
use const_def
use math_lib

implicit none

! these routines are called by the standard run_star
contains

include 'standard_run_star_extras.inc'

end module run_star_extras

2 changes: 1 addition & 1 deletion atm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SRCS := public/atm_def.f90 \
SRCS_CHECK = test/src/test_atm.f90 test/src/test_atm_setup.f90 test/src/test_atm_support.f90
INTERNAL_DEPENDS_ON := const math utils chem num auto_diff interp_1d interp_2d eos kap
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion auto_diff/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SRCS := public/auto_diff.f90 \
SRCS_CHECK := test/src/test_auto_diff.f90
INTERNAL_DEPENDS_ON := const utils math
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
4 changes: 2 additions & 2 deletions binary/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ SRCS += private/pgbinary_stub.f90
EXTERNAL_DEPENDS_ON :=
endif

SRCS_CHECK = test/src/test_binary.f90
SRCS_CHECK = test/src/test_binary.f90 test/src/run_star_extras.f90
INTERNAL_DEPENDS_ON := const utils math net interp_1d interp_2d auto_diff chem rates num star_data star
BINTYPE := static-lib
BINTYPE := lib
INCLUDE_DIRS := -Iprivate -Ipublic -Idefaults

# Testing
Expand Down
37 changes: 37 additions & 0 deletions binary/test/src/run_star_extras.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! ***********************************************************************
!
! Copyright (C) 2010 Bill Paxton & The MESA Team
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU Lesser General Public License
! as published by the Free Software Foundation,
! either version 3 of the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! See the GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with this program. If not, see <https://www.gnu.org/licenses/>.
!
! ***********************************************************************

! While not in use, this is to satisfy dynamic linking

module run_star_extras

use star_lib
use star_def
use const_def
use math_lib

implicit none

! these routines are called by the standard run_star
contains

include 'standard_run_star_extras.inc'

end module run_star_extras

2 changes: 1 addition & 1 deletion chem/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SRCS := public/chem_def.f90 \
SRCS_CHECK := test/src/test_chem.f90
INTERNAL_DEPENDS_ON := const utils math
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion colors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SRCS_CHECK := test/src/test_colors.f90
INTERNAL_DEPENDS_ON := const utils math
EXTERNAL_DEPENDS_ON :=
INCLUDE_DIRS := -Idefaults -Ipublic -Iprivate
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion const/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SRCS := public/const_def.f90 public/const_lib.f90
SRCS_CHECK := test/src/test_const.f90
INTERNAL_DEPENDS_ON :=
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
3 changes: 2 additions & 1 deletion docs/source/developing/build-system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The build system exposes several options to control the build process. If you wa
* **BUILD_DIR**: Where all compiled files will end up, default is ``build``. The output from each module's build will be in a subfolder with the module's name.
* **COMPILER**: Which compiler to use. Supported options are ``gfortran`` (default).
* **PROFILE**: Which set of compiler flags to use, mostly to control optimizations. Supported options are ``release`` (enable optimizations), ``release-with-dbg-info`` (enable optimizations, but keep debug info, default), and ``debug`` (disable most optimizations, keep debug info).
* **DYNAMIC**: Whether to generate dynamic or static libraries for each of the modules. Defaults to ``no`` (set to ``yes`` to enable).
* **WITH_OPENMP**: Whether to use openmp. Defaults to ``yes`` (any other value will disable openmp).
* **WITH_CRLIBM**: Whether to use crlibm for certain math operations. Defaults to ``yes`` (any other value will disable crlibm).
* **WITH_FPE_CHECKS**: Whether to enable FPE checks for NaNs, overflows, and division by zero. Defaults to ``no`` (set to ``yes`` to enable).
Expand All @@ -34,7 +35,7 @@ The following properties control the main compilation of the module:
* **SRCS**: Source files (.f, .f90) that are part of this module. Include files (.inc, .dek) should not be included in this list.
* **INTERNAL_DEPENDS_ON**: Which MESA modules this module directly depends on. Transitive dependencies do not need to be filled in here.
* **EXTERNAL_DEPENDS_ON**: Which external packages (e.g. lapack) this module depends on.
* **BINTYPE**: What the eventual output of the build should be, can be ``static-lib``, ``dynamic-lib``, ``executable`` or ``manual``. The ``manual`` option skips the generation of the final binary object. This is used in the gyre module, as more than one library is created.
* **BINTYPE**: What the eventual output of the build should be, can be ``lib``, ``executable`` or ``manual``. The ``manual`` option skips the generation of the final binary object. This is used in the gyre module, as more than one library is created.
* **LIB_NAMES**: Which output libraries are produced in case ``BINTYPE`` is set to ``manual``.
* **INCLUDE_DIRS**: In which directories are the source files found, prefixed by ``-I``. By default, this is ``-Ipublic -Iprivate``.

Expand Down
2 changes: 1 addition & 1 deletion eos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SRCS_CHECK = test/src/test_eos.f90 \
test/src/test_eos_support.f90
INTERNAL_DEPENDS_ON := const math utils chem num auto_diff interp_1d interp_2d
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib
INCLUDE_DIRS := -Iprivate -Ipublic -Idefaults

# Testing
Expand Down
6 changes: 4 additions & 2 deletions forum/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SRCS :=
SRCS_CHECK :=
INTERNAL_DEPENDS_ON :=
EXTERNAL_DEPENDS_ON := hdf5_fortran
BINTYPE := static-lib
BINTYPE := lib
INCLUDE_DIRS :=

# Testing
Expand Down Expand Up @@ -41,7 +41,7 @@ $(BUILD_DIR_FORUM_BUILD): forum-1.0.4.tar.gz | $(BUILD_DIR_FORUM_BUILD)/. $(BUIL
cp $(BUILD_DIR_FORUM_BUILD)/src/include/forum.inc $(BUILD_DIR_MODULE)/include/forum.inc

$(BUILD_DIR_FORUM_BUILD)/build-complete: $(BUILD_DIR_FORUM_BUILD)
$(MAKE) -C $(BUILD_DIR_FORUM_BUILD) SHARED=no DEBUG=$(FORUM_DEBUG) OMP=$(WITH_OPENMP) FPE=yes VERSION_CHECK=passed FPP="$(FPP)" LDFLAGS="$(LIB_DEP_ARGS)" FFLAGS="$(FLAGS_DEPS)"
$(MAKE) -C $(BUILD_DIR_FORUM_BUILD) SHARED=$(DYNAMIC) DEBUG=$(FORUM_DEBUG) OMP=$(WITH_OPENMP) FPE=no VERSION_CHECK=passed FPP="$(FPP)" LDFLAGS="$(LIB_DEP_ARGS)" FFLAGS="$(_FFLAGS) -std=f2018"
touch $@

$(OBJ_OUT): $(BUILD_DIR_FORUM_BUILD)/build-complete | $(BUILD_DIR_MODULE)/lib/.
Expand All @@ -50,6 +50,8 @@ $(OBJ_OUT): $(BUILD_DIR_FORUM_BUILD)/build-complete | $(BUILD_DIR_MODULE)/lib/.
$(BUILD_DIR_MODULE)/modules/forum_m.mod: $(BUILD_DIR_FORUM_BUILD)/build-complete | $(BUILD_DIR_MODULE)/modules/.
cp $(BUILD_DIR_FORUM_BUILD)/build/$(notdir $@) $@

all: $(PKG_CONFIG) $(OBJ_OUT)

check:
cd test; ../$(BUILD_DIR_FORUM_BUILD)/build/test_order > ../$(CHECK_RESULTS)
diff -b $(CHECK_RESULTS) $(CHECK_RESULTS_GOLDEN)
14 changes: 5 additions & 9 deletions gyre/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ INTERNAL_DEPENDS_ON := forum const
EXTERNAL_DEPENDS_ON := hdf5_fortran lapack95 lapack
CHECK_RESULTS_GOLDEN := test/test_output
CHECK_DIFF_PROG := ndiff -quiet -relerr 1.0e-6
BINTYPE := manual
BINTYPE := lib
LIB_NAMES = gyre_mesa gyre
INSTALL_COMMANDS := install-lib

ifeq ($(WITH_CRLIBM),yes)
EXTERNAL_DEPENDS_ON += crmath
Expand All @@ -26,7 +25,7 @@ SRCS_CHECK :=
INTERNAL_DEPENDS_ON := forum
EXTERNAL_DEPENDS_ON :=
CHECK_RESULTS_GOLDEN :=
BINTYPE := static-lib
BINTYPE := lib

endif

Expand All @@ -38,8 +37,6 @@ include $(MAKE_DIR)/Makefile

ifeq ($(WITH_GYRE),yes)

include $(MAKE_DIR)/pkg-config.mk

ifeq ($(PROFILE),debug)
GYRE_DEBUG = yes
else
Expand All @@ -53,23 +50,22 @@ else
endif

BUILD_DIR_GYRE_BUILD := $(BUILD_DIR_MODULE)/src
OBJ_OUT := $(BUILD_DIR_MODULE)/lib/libgyre.a $(BUILD_DIR_MODULE)/lib/libgyre_mesa.a

$(BUILD_DIR_GYRE_BUILD): gyre-8.1.tar.gz | $(BUILD_DIR_GYRE_BUILD)/. $(BUILD_DIR_MODULE)/include/.
tar --strip-components=1 -xf $< -C $(BUILD_DIR_GYRE_BUILD)

$(BUILD_DIR_GYRE_BUILD)/build-complete: $(BUILD_DIR_GYRE_BUILD)
$(MAKE) -C $(BUILD_DIR_GYRE_BUILD) SHARED=no DEBUG=$(GYRE_DEBUG) OMP=$(WITH_OPENMP) CRMATH=$(WITH_CRLIBM) FPE=yes VERSION_CHECK=passed FPP="$(FPP)" LDFLAGS="$(LIB_DEP_ARGS)" FFLAGS="$(FLAGS_DEPS)" FRONTENDS=no TOOLS=no FORUM=no IFACES=yes
$(MAKE) -C $(BUILD_DIR_GYRE_BUILD) SHARED=$(DYNAMIC) DEBUG=$(GYRE_DEBUG) OMP=$(WITH_OPENMP) CRMATH=$(WITH_CRLIBM) VERSION_CHECK=passed FPP="$(FPP)" LDFLAGS="$(LIB_DEP_ARGS)" FFLAGS="$(_FFLAGS) -std=f2018" FRONTENDS=no TOOLS=no FORUM=no IFACES=yes
touch $@


$(BUILD_DIR_MODULE)/lib/libgyre.a $(BUILD_DIR_MODULE)/lib/libgyre_mesa.a: $(BUILD_DIR_GYRE_BUILD)/build-complete | $(BUILD_DIR_MODULE)/lib/.
$(OBJ_OUT): $(BUILD_DIR_GYRE_BUILD)/build-complete | $(BUILD_DIR_MODULE)/lib/.
cp $(BUILD_DIR_GYRE_BUILD)/build/$(notdir $@) $@

$(BUILD_DIR_MODULE)/modules/gyre_mesa_m.mod: $(BUILD_DIR_GYRE_BUILD)/build-complete | $(BUILD_DIR_MODULE)/modules/.
cp $(BUILD_DIR_GYRE_BUILD)/build/$(notdir $@) $@

all: $(PKG_CONFIG) $(BUILD_DIR_MODULE)/lib/libgyre_mesa.a $(BUILD_DIR_MODULE)/lib/libgyre.a
all: $(PKG_CONFIG) $(OBJ_OUT)

else

Expand Down
2 changes: 1 addition & 1 deletion interp_1d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SRCS_CHECK = test/src/interp_1d_support.f90 \
test/src/test_interp_1d.f90
INTERNAL_DEPENDS_ON := const math utils auto_diff
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion interp_2d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SRCS_CHECK = test/src/interp_2d_support.f90 \
test/src/test_renka790_sg.f
INTERNAL_DEPENDS_ON := const utils math num interp_1d
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion ionization/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SRCS := public/ionization_def.f90 \
SRCS_CHECK := test/src/test_ionization.f90 test/src/test_ionization_support.f90
INTERNAL_DEPENDS_ON := const utils math interp_2d chem
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib

# Testing

Expand Down
2 changes: 1 addition & 1 deletion kap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SRCS_CHECK = \
test/src/test_kap_support.f90
INTERNAL_DEPENDS_ON := const utils math auto_diff num chem interp_1d interp_2d forum eos
EXTERNAL_DEPENDS_ON :=
BINTYPE := static-lib
BINTYPE := lib
INCLUDE_DIRS := -Iprivate -Ipublic -Idefaults

# Testing
Expand Down
Loading