From 44a27ce0791580955c1b18cd04e7645eb2cb886a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 4 Jun 2012 17:10:23 +0200 Subject: [PATCH 1/3] Makefile with/without cython Version:1.2.13 --- example/irp_example1.irp.f | 18 +++++++++-------- example/uvwt.irp.f | 2 +- src/Makefile | 9 +++++++++ src/irpf90_python.exe | 40 ++++++++++++++++++++++++++++++++++++++ src/version.py | 2 +- 5 files changed, 61 insertions(+), 10 deletions(-) create mode 100755 src/irpf90_python.exe diff --git a/example/irp_example1.irp.f b/example/irp_example1.irp.f index 02f5493..5c4bf47 100644 --- a/example/irp_example1.irp.f +++ b/example/irp_example1.irp.f @@ -1,10 +1,12 @@ program irp_example1 - integer :: x(W) - BEGIN_SHELL [ /bin/bash ] - echo print *, \'Compiled by `whoami` on `date`\' - echo print *, \'$FC $FCFLAGS\' - echo print *, \'$IRPF90\' - END_SHELL -! print *, 't = ', t - print *, u2 +! integer :: x(W) +! BEGIN_SHELL [ /bin/bash ] +! echo print *, \'Compiled by `whoami` on `date`\' +! echo print *, \'$FC $FCFLAGS\' +! echo print *, \'$IRPF90\' +! END_SHELL + print *, 't = ', t + + print *, 'v=', v +! print *, u2 end diff --git a/example/uvwt.irp.f b/example/uvwt.irp.f index 63655a1..a2198a2 100644 --- a/example/uvwt.irp.f +++ b/example/uvwt.irp.f @@ -22,7 +22,7 @@ BEGIN_PROVIDER [ integer, u1 ] do i=1,m print *, i enddo - PROVIDE u2 +! PROVIDE u2 END_PROVIDER BEGIN_PROVIDER [ integer, u2 ] diff --git a/src/Makefile b/src/Makefile index a6bf542..27d59dc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,12 @@ PYTHON=python PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") +HAS_CYTHON=$(shell which cython &> /dev/null && echo 1 || echo 0) +ifeq ($(HAS_CYTHON),0) + +irpf90.exe: + cp irpf90_python.exe irpf90.exe + +else irpf90.exe: irpf90.so gcc build/*/irpf90.o -L/usr/lib64 -lpython$(PYVERSION) -o irpf90.exe @@ -10,5 +17,7 @@ irpf90.so : $(wildcard *.py) irpf90.c irpf90.c: irpf90.py cython --embed irpf90.py +endif + clean: rm *.c *.so *.pyc 2>/dev/null diff --git a/src/irpf90_python.exe b/src/irpf90_python.exe new file mode 100755 index 0000000..85de59e --- /dev/null +++ b/src/irpf90_python.exe @@ -0,0 +1,40 @@ +#!/usr/bin/python +# IRPF90 is a Fortran90 preprocessor written in Python for programming using +# the Implicit Reference to Parameters (IRP) method. +# Copyright (C) 2009 Anthony SCEMAMA +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Anthony Scemama +# LCPQ - IRSAMC - CNRS +# Universite Paul Sabatier +# 118, route de Narbonne +# 31062 Toulouse Cedex 4 +# scemama@irsamc.ups-tlse.fr + + +import os +import sys + +wd = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0,(wd+"/../src/")) +sys.path.insert(0,(wd+"/../share/irpf90/src/")) + +def main(): + import irpf90 + irpf90.main() + +main() + diff --git a/src/version.py b/src/version.py index f888239..b6af4fc 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.2.12" +version = "1.2.13" From 1a32c9d8112b0e92c5b4f19bed91f5c2ad643ead Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 4 Jun 2012 17:11:10 +0200 Subject: [PATCH 2/3] Makefile Version:1.2.14 --- src/Makefile | 4 ++-- src/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 27d59dc..42686bb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,7 @@ HAS_CYTHON=$(shell which cython &> /dev/null && echo 1 || echo 0) ifeq ($(HAS_CYTHON),0) irpf90.exe: - cp irpf90_python.exe irpf90.exe + cp -f irpf90_python.exe irpf90.exe else @@ -20,4 +20,4 @@ irpf90.c: irpf90.py endif clean: - rm *.c *.so *.pyc 2>/dev/null + rm -f *.c *.so *.pyc *.pyo 2>/dev/null diff --git a/src/version.py b/src/version.py index b6af4fc..626dbdb 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.2.13" +version = "1.2.14" From 8479ee0e38ffa3827c6401105667fb0fd751e18f Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 31 Jul 2012 14:24:52 +0200 Subject: [PATCH 3/3] Broken link Version:1.2.17 Version:1.2.18 --- bin/irpf90 | 2 +- example/irp_example1.irp.f | 10 +++++----- packages/Makefile | 1 + src/Makefile | 11 ++++++----- src/version.py | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bin/irpf90 b/bin/irpf90 index 09358c1..e537e26 120000 --- a/bin/irpf90 +++ b/bin/irpf90 @@ -1 +1 @@ -/home/scemama/irpf90/src/irpf90.exe \ No newline at end of file +../src/irpf90.exe \ No newline at end of file diff --git a/example/irp_example1.irp.f b/example/irp_example1.irp.f index 5c4bf47..9569645 100644 --- a/example/irp_example1.irp.f +++ b/example/irp_example1.irp.f @@ -1,10 +1,10 @@ program irp_example1 ! integer :: x(W) -! BEGIN_SHELL [ /bin/bash ] -! echo print *, \'Compiled by `whoami` on `date`\' -! echo print *, \'$FC $FCFLAGS\' -! echo print *, \'$IRPF90\' -! END_SHELL + BEGIN_SHELL [ /bin/bash ] + echo print *, \'Compiled by `whoami` on `date`\' + echo print *, \'$FC $FCFLAGS\' + echo print *, \'$IRPF90\' + END_SHELL print *, 't = ', t print *, 'v=', v diff --git a/packages/Makefile b/packages/Makefile index b523cb8..07d5d8e 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -1,5 +1,6 @@ include version default: + set -x rm *.rpm *.tar.gz *.exe.gz 2> /dev/null ;\ VERSION=$(VERSION) epm -f portable -a noarch -m noarch irpf90 irpf90.list ;\ cd noarch ;\ diff --git a/src/Makefile b/src/Makefile index 42686bb..74430d5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,12 +1,10 @@ PYTHON=python PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])") HAS_CYTHON=$(shell which cython &> /dev/null && echo 1 || echo 0) -ifeq ($(HAS_CYTHON),0) +ifneq ($(HAS_CYTHON),0) -irpf90.exe: - cp -f irpf90_python.exe irpf90.exe - -else +../bin/irpf90: irpf90.exe + rm ../bin/irpf90 ; cd ../bin ; ln -s ../src/irpf90.exe irpf90 irpf90.exe: irpf90.so gcc build/*/irpf90.o -L/usr/lib64 -lpython$(PYVERSION) -o irpf90.exe @@ -17,6 +15,9 @@ irpf90.so : $(wildcard *.py) irpf90.c irpf90.c: irpf90.py cython --embed irpf90.py +else +../bin/irpf90: irpf90_python.exe + rm ../bin/irpf90 ; cd ../bin ; ln -s ../src/irpf90_python.exe irpf90 endif clean: diff --git a/src/version.py b/src/version.py index 626dbdb..a7c3fc0 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.2.14" +version = "1.2.18"