/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. #./clean
  3. #export FLAGS='-g -O0 -fbounds-check -ffree-form'
  4. #export FLAGS77='-g -O0 -fbounds-check'
  5. export FLAGS='-g -O3 -fbounds-check -ffree-form -fopenmp'
  6. export FLAGS77='-g -O3 -fopenmp'
  7. export MESA='/Users/neil/research/mesa'
  8. echo "Building core Library"
  9. #echo "Compiling Convolve"
  10. #gfortran convolve.f ${FLAGS} -c
  11. echo "Compiling ANEOS"
  12. ## This will create the file aneosequ.o that contains the fortran 77 aneos functions
  13. gfortran ../src/aneosequ.f -c
  14. gfortran ../src/mixeos_def.f -c ${FLAGS}
  15. gfortran ../src/h5table_type.f -c ${FLAGS}
  16. gfortran ../src/h5table_params.f -c ${FLAGS}
  17. gfortran ../src/h5table_register.f -c ${FLAGS}
  18. gfortran ../src/h5table.f -c ${FLAGS} -I${MESA}/include/
  19. ar -cru libh5table.a mixeos_def.o h5table_type.o h5table.o h5table_params.o h5table_register.o
  20. cp mixeos_def.mod ../include/
  21. cp h5table_type.mod ../include/
  22. cp h5table_params.mod ../include/
  23. cp h5table_register.mod ../include/
  24. cp h5table.mod ../include/
  25. cp libh5table.a ../lib/
  26. gfortran ../tools/flat_interpolator.f90 -c ${FLAGS}
  27. gfortran ../tools/flat_table_2D.f90 -c ${FLAGS}
  28. 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
  29. cp compare_luke_h5 ../
  30. ## This creats aneoswater.o and aneoswater.mod - the .mod file contains the module interface information
  31. gfortran ../src/aneos_access.f -c ${FLAGS}
  32. echo "YEA I know there are a bunch of warnings - ignore them"
  33. echo " last time I tried to fix them it broke everything"
  34. gfortran ../src/ideal_water.f -c ${FLAGS}
  35. cp ideal_water.mod ../include/
  36. gfortran ../src/poly_eos.f -c ${FLAGS}
  37. cp poly_eos.mod ../include/
  38. ## Package these together into a library
  39. ar -cru libaneos.a aneos_access.o aneosequ.o ideal_water.o poly_eos.o
  40. ## Copy the .mod file to the include directory
  41. cp aneos_access.mod ../include/
  42. ## Copy the library to the lib directory
  43. cp libaneos.a ../lib/
  44. gfortran ../src/ideal_water.f -c ${FLAGS}
  45. gfortran ../tools/test_aneos.f -o test_aneos ${FLAGS} -L../lib/ -laneos
  46. cp test_aneos ../
  47. gfortran ../tools/test_aneos_free.f -o test_aneos_free ${FLAGS} -L../lib/ -laneos
  48. cp test_aneos_free ../
  49. gfortran ../tools/generate_ideal_table.f -o gen_idealwater_table ${FLAGS} -L../lib/ -laneos
  50. cp gen_idealwater_table ../
  51. gfortran ../tools/generate_poly_table.f -o gen_poly_table ${FLAGS} -L../lib/ -laneos
  52. cp gen_poly_table ../
  53. gfortran ../tools/generate_water_table.f -o gen_water_table ${FLAGS} -L../lib/ -laneos
  54. cp gen_water_table ../
  55. gfortran ../tools/generate_serpentine_table.f -o gen_serpentine_table ${FLAGS} -L../lib/ -laneos
  56. cp gen_serpentine_table ../
  57. gfortran ../tools/generate_iron_table.f -o gen_iron_table ${FLAGS} -L../lib/ -laneos
  58. cp gen_iron_table ../
  59. 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
  60. cp test_h5 ../
  61. 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
  62. cp test_idealh5 ../
  63. 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
  64. cp test_PT ../
  65. 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
  66. cp test_h5_1d ../
  67. #echo "Compiling ideal_water equation of state"
  68. #gfortran ideal_water.f ${FLAGS} -c
  69. #echo "Compiling write_table routine"
  70. #gfortran write_table.f aneosequ.o convolve.o -o write_table ${FLAGS}
  71. #if [ -e "write_table" ]
  72. #then
  73. # echo "[success] Compiled write_table successfully"
  74. #else
  75. # echo "[ERROR] Failed to compile write_table"
  76. #fi
  77. #echo "Compling Tools"
  78. #echo "Compiling h5 table"
  79. #gfortran h5table.f -c ${FLAGS}
  80. #echo "Compiling test h5 routine"
  81. #gfortran test_h5.f aneosequ.o convolve.o h5table.o -o test_h5 ${FLAGS}
  82. #echo "Compiling Ideal Gas law routine"
  83. #gfortran ideal_gas.f -o ideal_gas ${FLAGS}
  84. #echo "Compiling a second ideal gas testing routine"
  85. #gfortran ideal_water.o test_idealwater.f -o test_idealwater2 ${FLAGS}
  86. #echo "Compiling Ideal Gas / ANEOS comparison code"
  87. #gfortran compare_ideal.f aneosequ.o convolve.o ideal_water.o h5table.o -o compare_ideal ${FLAGS}
  88. #echo "Compiling Ideal Gas law test"
  89. #gfortran test_idealh5.f convolve.o ideal_water.o h5table.o -o test_ideal ${FLAGS}
  90. #echo "Compiling numerical derivative testing routine"
  91. #echo " this routine computes the numerical derivatives of the ideal gas law and compares them against"
  92. #echo " the analytic ideal gas law derivatives. "
  93. #gfortran compare_num_ideal.f h5table.o ideal_water.o -o test_nder ${FLAGS}
  94. echo "Done"