/make/mk
https://bitbucket.org/NeilMiller/h5tbuilder · #! · 126 lines · 94 code · 32 blank · 0 comment · 0 complexity · a36767054052b338579dde8e7557ca39 MD5 · raw file
- #!/bin/bash
- #./clean
- #export FLAGS='-g -O0 -fbounds-check -ffree-form'
- #export FLAGS77='-g -O0 -fbounds-check'
- export FLAGS='-g -O3 -fbounds-check -ffree-form -fopenmp'
- export FLAGS77='-g -O3 -fopenmp'
- export MESA='/Users/neil/research/mesa'
- echo "Building core Library"
- #echo "Compiling Convolve"
- #gfortran convolve.f ${FLAGS} -c
- echo "Compiling ANEOS"
- ## This will create the file aneosequ.o that contains the fortran 77 aneos functions
- gfortran ../src/aneosequ.f -c
- gfortran ../src/mixeos_def.f -c ${FLAGS}
- gfortran ../src/h5table_type.f -c ${FLAGS}
- gfortran ../src/h5table_params.f -c ${FLAGS}
- gfortran ../src/h5table_register.f -c ${FLAGS}
- gfortran ../src/h5table.f -c ${FLAGS} -I${MESA}/include/
- ar -cru libh5table.a mixeos_def.o h5table_type.o h5table.o h5table_params.o h5table_register.o
- cp mixeos_def.mod ../include/
- cp h5table_type.mod ../include/
- cp h5table_params.mod ../include/
- cp h5table_register.mod ../include/
- cp h5table.mod ../include/
- cp libh5table.a ../lib/
- gfortran ../tools/flat_interpolator.f90 -c ${FLAGS}
- gfortran ../tools/flat_table_2D.f90 -c ${FLAGS}
- gfortran ../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
- cp compare_luke_h5 ../
- ## This creats aneoswater.o and aneoswater.mod - the .mod file contains the module interface information
- gfortran ../src/aneos_access.f -c ${FLAGS}
- echo "YEA I know there are a bunch of warnings - ignore them"
- echo " last time I tried to fix them it broke everything"
- gfortran ../src/ideal_water.f -c ${FLAGS}
- cp ideal_water.mod ../include/
- gfortran ../src/poly_eos.f -c ${FLAGS}
- cp poly_eos.mod ../include/
- ## Package these together into a library
- ar -cru libaneos.a aneos_access.o aneosequ.o ideal_water.o poly_eos.o
- ## Copy the .mod file to the include directory
- cp aneos_access.mod ../include/
- ## Copy the library to the lib directory
- cp libaneos.a ../lib/
- gfortran ../src/ideal_water.f -c ${FLAGS}
- gfortran ../tools/test_aneos.f -o test_aneos ${FLAGS} -L../lib/ -laneos
- cp test_aneos ../
- gfortran ../tools/test_aneos_free.f -o test_aneos_free ${FLAGS} -L../lib/ -laneos
- cp test_aneos_free ../
- gfortran ../tools/generate_ideal_table.f -o gen_idealwater_table ${FLAGS} -L../lib/ -laneos
- cp gen_idealwater_table ../
- gfortran ../tools/generate_poly_table.f -o gen_poly_table ${FLAGS} -L../lib/ -laneos
- cp gen_poly_table ../
- gfortran ../tools/generate_water_table.f -o gen_water_table ${FLAGS} -L../lib/ -laneos
- cp gen_water_table ../
- gfortran ../tools/generate_serpentine_table.f -o gen_serpentine_table ${FLAGS} -L../lib/ -laneos
- cp gen_serpentine_table ../
- gfortran ../tools/generate_iron_table.f -o gen_iron_table ${FLAGS} -L../lib/ -laneos
- cp gen_iron_table ../
- gfortran ../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
- cp test_h5 ../
- gfortran ../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
- cp test_idealh5 ../
- gfortran ../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
- cp test_PT ../
- gfortran ../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
- cp test_h5_1d ../
- #echo "Compiling ideal_water equation of state"
- #gfortran ideal_water.f ${FLAGS} -c
- #echo "Compiling write_table routine"
- #gfortran write_table.f aneosequ.o convolve.o -o write_table ${FLAGS}
- #if [ -e "write_table" ]
- #then
- # echo "[success] Compiled write_table successfully"
- #else
- # echo "[ERROR] Failed to compile write_table"
- #fi
- #echo "Compling Tools"
- #echo "Compiling h5 table"
- #gfortran h5table.f -c ${FLAGS}
- #echo "Compiling test h5 routine"
- #gfortran test_h5.f aneosequ.o convolve.o h5table.o -o test_h5 ${FLAGS}
- #echo "Compiling Ideal Gas law routine"
- #gfortran ideal_gas.f -o ideal_gas ${FLAGS}
- #echo "Compiling a second ideal gas testing routine"
- #gfortran ideal_water.o test_idealwater.f -o test_idealwater2 ${FLAGS}
- #echo "Compiling Ideal Gas / ANEOS comparison code"
- #gfortran compare_ideal.f aneosequ.o convolve.o ideal_water.o h5table.o -o compare_ideal ${FLAGS}
- #echo "Compiling Ideal Gas law test"
- #gfortran test_idealh5.f convolve.o ideal_water.o h5table.o -o test_ideal ${FLAGS}
- #echo "Compiling numerical derivative testing routine"
- #echo " this routine computes the numerical derivatives of the ideal gas law and compares them against"
- #echo " the analytic ideal gas law derivatives. "
- #gfortran compare_num_ideal.f h5table.o ideal_water.o -o test_nder ${FLAGS}
- echo "Done"