PageRenderTime 31ms CodeModel.GetById 23ms app.highlight 6ms RepoModel.GetById 0ms app.codeStats 1ms

/make/mk

https://bitbucket.org/NeilMiller/h5tbuilder
#! | 126 lines | 94 code | 32 blank | 0 comment | 0 complexity | a36767054052b338579dde8e7557ca39 MD5 | raw file
  1#!/bin/bash
  2
  3#./clean
  4
  5#export FLAGS='-g -O0 -fbounds-check -ffree-form'
  6#export FLAGS77='-g -O0  -fbounds-check'
  7
  8export FLAGS='-g -O3 -fbounds-check -ffree-form -fopenmp'
  9export FLAGS77='-g -O3 -fopenmp'
 10export MESA='/Users/neil/research/mesa'
 11
 12echo "Building core Library"
 13
 14#echo "Compiling Convolve"
 15#gfortran convolve.f ${FLAGS} -c 
 16
 17echo "Compiling ANEOS"
 18## This will create the file aneosequ.o that contains the fortran 77 aneos functions
 19gfortran ../src/aneosequ.f -c 
 20
 21gfortran ../src/mixeos_def.f -c ${FLAGS}
 22gfortran ../src/h5table_type.f -c ${FLAGS}
 23gfortran ../src/h5table_params.f -c ${FLAGS}
 24gfortran ../src/h5table_register.f -c ${FLAGS}
 25gfortran ../src/h5table.f -c ${FLAGS} -I${MESA}/include/
 26
 27
 28ar -cru libh5table.a mixeos_def.o h5table_type.o h5table.o h5table_params.o h5table_register.o
 29cp mixeos_def.mod ../include/
 30cp h5table_type.mod ../include/
 31cp h5table_params.mod ../include/
 32cp h5table_register.mod ../include/
 33cp h5table.mod ../include/
 34cp libh5table.a ../lib/
 35
 36gfortran ../tools/flat_interpolator.f90 -c ${FLAGS} 
 37gfortran ../tools/flat_table_2D.f90 -c ${FLAGS} 
 38gfortran ../tools/compare_luke_h5.f -o compare_luke_h5 ${FLAGS} -L../lib/ -I${MESA}/include/ -L${MESA}/lib/ flat_interpolator.o flat_table_2D.o -lh5table -lnum -lutils -lmtx -lmesaklu -lmesalapack -lmesablas -lalert -lconst
 39cp compare_luke_h5 ../
 40
 41## This creats aneoswater.o and aneoswater.mod - the .mod file contains the module interface information
 42gfortran ../src/aneos_access.f -c ${FLAGS}
 43echo "YEA I know there are a bunch of warnings - ignore them"
 44echo " last time I tried to fix them it broke everything"
 45
 46gfortran ../src/ideal_water.f -c ${FLAGS} 
 47cp ideal_water.mod ../include/
 48
 49gfortran ../src/poly_eos.f -c ${FLAGS}
 50cp poly_eos.mod ../include/
 51
 52## Package these together into a library
 53ar -cru libaneos.a aneos_access.o aneosequ.o ideal_water.o poly_eos.o
 54
 55## Copy the .mod file to the include directory
 56cp aneos_access.mod ../include/
 57
 58## Copy the library to the lib directory
 59cp libaneos.a ../lib/
 60
 61gfortran ../src/ideal_water.f -c ${FLAGS}
 62
 63
 64gfortran ../tools/test_aneos.f -o test_aneos ${FLAGS} -L../lib/ -laneos
 65cp test_aneos ../
 66
 67gfortran ../tools/test_aneos_free.f -o test_aneos_free ${FLAGS} -L../lib/ -laneos
 68cp test_aneos_free ../
 69
 70gfortran ../tools/generate_ideal_table.f -o gen_idealwater_table ${FLAGS} -L../lib/ -laneos
 71cp gen_idealwater_table ../
 72
 73gfortran ../tools/generate_poly_table.f -o gen_poly_table ${FLAGS} -L../lib/ -laneos
 74cp gen_poly_table ../
 75
 76gfortran ../tools/generate_water_table.f -o gen_water_table ${FLAGS} -L../lib/ -laneos
 77cp gen_water_table ../
 78
 79gfortran ../tools/generate_serpentine_table.f -o gen_serpentine_table ${FLAGS} -L../lib/ -laneos
 80cp gen_serpentine_table ../
 81
 82gfortran ../tools/generate_iron_table.f -o gen_iron_table ${FLAGS} -L../lib/ -laneos
 83cp gen_iron_table ../
 84
 85gfortran ../tools/test_h5.f -o test_h5 -L../lib/ -lh5table -laneos -I../include/ ${FLAGS} -I${MESA}/include/ -L${MESA}/lib/ -lnum -lutils -lmtx -lmesaklu -lmesalapack -lmesablas -lalert -lconst -fopenmp -g -O2 -fbounds-check
 86cp test_h5 ../
 87
 88gfortran ../tools/test_idealh5.f -o test_idealh5 -L../lib/ -lh5table -laneos -I../include/ ${FLAGS} -I${MESA}/include/ -L${MESA}/lib/ -lnum -lutils -lmtx -lmesaklu -lmesalapack -lmesablas -lalert -lconst -fopenmp -g -O2 -fbounds-check
 89cp test_idealh5 ../
 90
 91gfortran ../tools/test_PT.f -o test_PT -L../lib/ -lh5table -laneos -I../include/ ${FLAGS} -I${MESA}/include/ -L${MESA}/lib/ -lnum -lutils -lmtx -lmesaklu -lmesalapack -lmesablas -lalert -lconst -fopenmp -g -O2 -fbounds-check
 92cp test_PT ../
 93
 94gfortran ../tools/test_h5_1d.f -o test_h5_1d -L../lib/ -lh5table -laneos -I../include/ ${FLAGS} -I${MESA}/include/ -L${MESA}/lib/ -lnum -lutils -lmtx -lmesaklu -lmesalapack -lmesablas -lalert -lconst -fopenmp -g -O2 -fbounds-check
 95cp test_h5_1d ../
 96#echo "Compiling ideal_water equation of state"
 97#gfortran ideal_water.f ${FLAGS} -c
 98
 99#echo "Compiling write_table routine"
100#gfortran write_table.f aneosequ.o convolve.o -o write_table ${FLAGS}
101#if [ -e "write_table" ]
102#then
103#    echo "[success] Compiled write_table successfully"
104#else
105#    echo "[ERROR] Failed to compile write_table"
106#fi
107
108#echo "Compling Tools"
109#echo "Compiling h5 table"
110#gfortran h5table.f -c ${FLAGS}
111#echo "Compiling test h5 routine"
112#gfortran test_h5.f aneosequ.o convolve.o h5table.o -o test_h5 ${FLAGS}
113#echo "Compiling Ideal Gas law routine"
114#gfortran ideal_gas.f -o ideal_gas ${FLAGS}
115#echo "Compiling a second ideal gas testing routine"
116#gfortran ideal_water.o test_idealwater.f -o test_idealwater2 ${FLAGS}
117#echo "Compiling Ideal Gas / ANEOS comparison code"
118#gfortran compare_ideal.f aneosequ.o convolve.o ideal_water.o h5table.o -o compare_ideal ${FLAGS}
119#echo "Compiling Ideal Gas law test"
120#gfortran test_idealh5.f convolve.o ideal_water.o h5table.o -o test_ideal ${FLAGS}
121#echo "Compiling numerical derivative testing routine"
122#echo " this routine computes the numerical derivatives of the ideal gas law and compares them against"
123#echo " the analytic ideal gas law derivatives. "
124#gfortran compare_num_ideal.f h5table.o ideal_water.o -o test_nder ${FLAGS}
125echo "Done"
126