-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile_Forthon.in
63 lines (54 loc) · 1.77 KB
/
Makefile_Forthon.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ______________________________________________________________________________
#
# PICSAR FORTHON Makefile
#
# This makefile is for the Python version
#
# ______________________________________________________________________________
# Source directory
SRCDIR= src
# Binary directory (.so) after compilation
BINDIR = python_module/picsar_python
# Application name
APPNAME=picsar
# Python binary name
PYTHON_NAME=picsarpy
# Path where the parser is located
UTIL=utils/forthon_parser
# We use Forthon to interface Fortran and Python
FC=Forthon
FCARGS=-v --no2underscores --nowritemodules
# Fortran compiler
FCOMP=gfortran
FCOMPEXEC=
# Fortan compilation arguments
FARGS="-O3 -fopenmp -ffree-line-length-none -ftree-vectorize -ftree-vectorizer-verbose=0"
# Library directory
LIBDIR=
# Library names
LIBS=
# Location of the test scripts
TESTDIR=examples/example_scripts_python
PARSERFILE=
all: clean parse build
test: test1 test2
build: $(SRCDIR)/$(APPNAME).F90 $(SRCDIR)/$(APPNAME).v
cd $(SRCDIR) &&\
$(FC) $(VERBOSE) $(FCARGS) --fcomp=$(FCOMP) --fcompexec=$(FCOMPEXEC) --fargs=$(FARGS) $(LIBDIR) $(LIBS) $(APPNAME)
mkdir -p $(BINDIR)
cp $(SRCDIR)/build/*/*/$(PYTHON_NAME).so $(BINDIR)
parse:
python $(UTIL)/$(PARSERFILE)
clean:
rm -rf $(SRCDIR)/build
rm -rf $(BINDIR)/picsarpy.so
test1:
cp -p examples/example_scripts_python/test_drifted_plasmas_3d.py Acceptance_testing/Python_tests/test_drifted_plasmas/
export OMP_NUM_THREADS=2
cd Acceptance_testing/Python_tests/test_drifted_plasmas && \
mpirun -np 4 python test_drifted_plasmas_3d.py
test2:
cp -p examples/example_scripts_python/test_Langmuir_wave_3d.py Acceptance_testing/Python_tests/test_Langmuir_wave/
export OMP_NUM_THREADS=2
cd Acceptance_testing/Python_tests/test_Langmuir_wave && \
mpirun -np 4 python test_Langmuir_wave_3d.py