Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt at python f2py wrapping #627

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
successfully building egsnrc.so
  • Loading branch information
SimonBiggs committed Aug 25, 2020
commit b41c11eb30630bfcad18628b3f9c3172ea6b35a3
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
###############################################################################
#
# Copyright (C) 2020 Simon Biggs
# Copyright (C) 2015 National Research Council Canada
#
# This file is part of EGSnrc.
Expand Down Expand Up @@ -27,7 +28,9 @@

include $(EGS_CONFIG)

all: egsnrc.f
export PYTHON_BUILD = cpython-37m-x86_64-linux-gnu

all: pyegsnrc/egsnrc.$(PYTHON_BUILD).so

SOURCES = \
$(EGS_SOURCEDIR)egsnrc.macros \
Expand All @@ -36,7 +39,10 @@ SOURCES = \
$(RANDOM).mortran \
$(EGS_SOURCEDIR)nrcaux.mortran \
$(MACHINE_MORTRAN) \
$(EGS_SOURCEDIR)egs_utilities.mortran \
$(EGS_SOURCEDIR)egsnrc.mortran

egsnrc.f :
$(MORTRAN_EXE) -s -d $(MORTRAN_DATA) -f $(SOURCES) $< -o7 $@ -o8 egsnrc.mortlst
pyegsnrc/egsnrc.%.so :
$(MORTRAN_EXE) -s -d $(MORTRAN_DATA) -f $(SOURCES) $< -o7 ./pyegsnrc/egsnrc.f -o8 egsnrc.mortlst
poetry run python -m numpy.f2py -c ./pyegsnrc/egsnrc.f -m egsnrc
mv egsnrc.$(PYTHON_BUILD).so $@