|
1 | | - |
2 | | -FC = /apps/external/intel/2019/compilers_and_libraries_2019.4.243/linux/bin/intel64/ifort |
3 | | - |
4 | | - |
5 | | -FFLAGS = -r8 -O3 -fpe0 -fp-model source -fpic -static-intel -libs:static -I../../NumericalIntegration/NumericalIntegration/ \ |
6 | | - |
7 | | - |
8 | | -#FC = /usr/bin/gfortran |
9 | | - |
10 | | -#FFLAGS = -O3 -fopenmp -fdefault-real-8 -ffixed-line-length-none -fPIC |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | -.KEEP_STATE: |
16 | | -.SUFFIXES: |
| 1 | +#======================================================================= |
| 2 | +# compiler names and flags |
| 3 | +#======================================================================= |
| 4 | +# FC = ifort |
| 5 | +FC = gfortran |
| 6 | + |
| 7 | +USE_CVODE = 0 |
| 8 | + |
| 9 | +LIB_NAME = libTileDemagTensor |
| 10 | + |
| 11 | +VPATH = ../../NumericalIntegration/NumericalIntegration |
| 12 | + |
| 13 | +ifeq ($(OS),Windows_NT) |
| 14 | + ifeq (${FC}, ifort) |
| 15 | + FFLAGS = /nologo /real-size:64 /O3 /assume:nocc_omp /Qopenmp /fpp \ |
| 16 | + /fpe:0 /fp:source /fp:precise /libs:static /DUSE_CVODE=${USE_CVODE} |
| 17 | + else ifeq (${FC}, gfortran) |
| 18 | + FFLAGS = -fPIC -O3 -fopenmp -fdefault-real-8 -ffree-line-length-512 \ |
| 19 | + -cpp -DUSE_CVODE=${USE_CVODE} |
| 20 | + endif |
| 21 | + |
| 22 | + LIBTOOL = LIB $? /OUT:$@ |
| 23 | + STATIC_LIB = ${LIB_NAME}.lib |
| 24 | + CLEAN_FILES = -del ${STATIC_LIB} *.o *.mod |
| 25 | +else |
| 26 | + ifeq (${FC}, ifort) |
| 27 | + FFLAGS = -r8 -O3 -assume nocc_omp -qopenmp -fpp -fpe0 -fp-model source \ |
| 28 | + -fp-model precise -fpic -libs:static -DUSE_CVODE=${USE_CVODE} |
| 29 | + else ifeq (${FC}, gfortran) |
| 30 | + FFLAGS = -fPIC -O3 -fopenmp -fdefault-real-8 -ffree-line-length-512 \ |
| 31 | + -cpp -DUSE_CVODE=${USE_CVODE} |
| 32 | + endif |
| 33 | + |
| 34 | + ifeq (${UNAME}, Darwin) |
| 35 | + LIBTOOL = libtool -static -o $@ $? |
| 36 | + else |
| 37 | + LIBTOOL = ar src $@ $? |
| 38 | + endif |
| 39 | + STATIC_LIB = ${LIB_NAME}.a |
| 40 | + CLEAN_FILES = -rm -f ${STATIC_LIB} *.o *.mod |
| 41 | +endif |
| 42 | + |
| 43 | +#======================================================================= |
| 44 | +# Intel's libtool |
| 45 | +#======================================================================= |
| 46 | +# LIBTOOL = xiar rc $@ $? |
| 47 | + |
| 48 | +#======================================================================= |
| 49 | +# List all source files required for the project |
| 50 | +#======================================================================= |
| 51 | +# names (without suffix), f90 sources |
| 52 | +LIBSRC_SOURCES = IntegrationDataTypes quadpack SpecialFunctions TileTensorHelperFunctions \ |
| 53 | +TileCylPieceTensor TileRectangularPrismTensor TilePlanarCoilTensor TileTriangle \ |
| 54 | +TileCircPieceTensor TileNComponents |
| 55 | + |
| 56 | +# object files |
| 57 | +LIBSRC_OBJECTS = $(addsuffix .o, ${LIBSRC_SOURCES}) |
| 58 | + |
| 59 | +#======================================================================= |
| 60 | +# Relevant suffixes |
| 61 | +#======================================================================= |
17 | 62 | .SUFFIXES: .for .f90 .F90 .f .o |
| 63 | + |
| 64 | +#======================================================================= |
| 65 | +# Targets |
| 66 | +#======================================================================= |
18 | 67 | .f.o: |
19 | | - $(FC) -c $(FFLAGS) $< |
| 68 | + $(FC) $(FFLAGS) -c $< -o $@ |
20 | 69 | .f90.o: |
21 | | - $(FC) -c $(FFLAGS) $< |
| 70 | + $(FC) $(FFLAGS) -c $< -o $@ |
22 | 71 | .F90.o: |
23 | | - $(FC) -c $(FFLAGS) $< |
| 72 | + $(FC) $(FFLAGS) -c $< -o $@ |
24 | 73 | .for.o: |
25 | | - $(FC) -c $(FFLAGS) $< |
26 | | - |
27 | | -TileDemagTensorLib = $(FC) SpecialFunctions.o TileTensorHelperFunctions.o TileTriangle.o TileCircPieceTensor.o TileCylPieceTensor.o TileRectangularPrismTensor.o TilePlanarCoilTensor.o TileNComponents.o |
28 | | - |
29 | | -libTileDemagTensor.a: $(TileDemagTensorLib) |
30 | | - /apps/external/intel/2019/compilers_and_libraries_2019.4.243/linux/bin/intel64/xiar rc libTileDemagTensor.a SpecialFunctions.o TileTensorHelperFunctions.o TileTriangle.o TileCircPieceTensor.o TileCylPieceTensor.o TileRectangularPrismTensor.o TilePlanarCoilTensor.o TileNComponents.o |
| 74 | + $(FC) $(FFLAGS) -c $< -o $@ |
31 | 75 |
|
| 76 | +${STATIC_LIB}: ${LIBSRC_OBJECTS} |
| 77 | + ${LIBTOOL} |
32 | 78 |
|
33 | 79 | clean: |
34 | | - rm -f *.o *.x *.mod *.a |
35 | | - |
36 | | -SpecialFunctions.o :SpecialFunctions.f90 |
37 | | -TileTensorHelperFunctions.o :TileTensorHelperFunctions.f90 |
38 | | -TileCircPieceTensor.o :TileCircPieceTensor.f90 TileTensorHelperFunctions.o |
39 | | -TileCylPieceTensor.o :TileCylPieceTensor.f90 TileTensorHelperFunctions.o |
40 | | -TileRectangularPrismTensor.o :TileRectangularPrismTensor.f90 TileTensorHelperFunctions.o |
41 | | -TilePlanarCoilTensor.o :TilePlanarCoilTensor.f90 TileTensorHelperFunctions.o |
42 | | -TileTriangle.o :TileTriangle.f90 TileTensorHelperFunctions.o |
43 | | -TileNComponents.o :TileNComponents.f90 TileTensorHelperFunctions.o TileTriangle.o TileCircPieceTensor.o TileCylPieceTensor.o TileRectangularPrismTensor.o TilePlanarCoilTensor.o |
44 | | - |
45 | | - |
46 | | - |
| 80 | + ${CLEAN_FILES} |
47 | 81 |
|
0 commit comments