Skip to content

Commit c8e4fb0

Browse files
committed
Updated Makefile for TileDemagTensor
1 parent 01214cd commit c8e4fb0

File tree

2 files changed

+78
-42
lines changed
  • source
    • NumericalIntegration/NumericalIntegration
    • TileDemagTensor/TileDemagTensor

2 files changed

+78
-42
lines changed

source/NumericalIntegration/NumericalIntegration/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ FC = ifort
66

77
USE_CVODE = 0
88

9+
LIB_NAME = libNumericalIntegration
10+
911
ifeq ($(OS),Windows_NT)
1012
ifeq (${FC}, ifort)
1113
FFLAGS = /nologo /real-size:64 /O3 /assume:nocc_omp /Qopenmp /fpp \
@@ -16,7 +18,7 @@ ifeq ($(OS),Windows_NT)
1618
endif
1719

1820
LIBTOOL = LIB $? /OUT:$@
19-
STATIC_LIB = libNumericalIntegration.lib
21+
STATIC_LIB = ${LIB_NAME}.lib
2022
CLEAN_FILES = -del ${STATIC_LIB} *.o *.mod
2123
else
2224
ifeq (${FC}, ifort)
@@ -32,7 +34,7 @@ else
3234
else
3335
LIBTOOL = ar src $@ $?
3436
endif
35-
STATIC_LIB = libNumInt.a
37+
STATIC_LIB = ${LIB_NAME}.a
3638
CLEAN_FILES = -rm -f ${STATIC_LIB} *.o *.mod
3739
endif
3840

@@ -45,8 +47,8 @@ endif
4547
# List all source files required for the project
4648
#=======================================================================
4749
# names (without suffix), f90 sources
48-
LIBSRC_SOURCES = IntegrationDataTypes quadpack SpecialFunctions NumericalIntegrals \
49-
SpecialFunctions RKSuitef90 ODE_Solvers ODE_MagTense util locate
50+
LIBSRC_SOURCES = IntegrationDataTypes quadpack SpecialFunctions \
51+
NumericalIntegrals RKSuitef90 ODE_Solvers ODE_MagTense util locate
5052

5153
# object files
5254
LIBSRC_OBJECTS = $(addsuffix .o, ${LIBSRC_SOURCES})
Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,81 @@
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+
#=======================================================================
1762
.SUFFIXES: .for .f90 .F90 .f .o
63+
64+
#=======================================================================
65+
# Targets
66+
#=======================================================================
1867
.f.o:
19-
$(FC) -c $(FFLAGS) $<
68+
$(FC) $(FFLAGS) -c $< -o $@
2069
.f90.o:
21-
$(FC) -c $(FFLAGS) $<
70+
$(FC) $(FFLAGS) -c $< -o $@
2271
.F90.o:
23-
$(FC) -c $(FFLAGS) $<
72+
$(FC) $(FFLAGS) -c $< -o $@
2473
.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 $@
3175

76+
${STATIC_LIB}: ${LIBSRC_OBJECTS}
77+
${LIBTOOL}
3278

3379
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}
4781

0 commit comments

Comments
 (0)