-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
232 lines (173 loc) · 7.1 KB
/
build.xml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<?xml version="1.0"?>
<project name="PSICS compilation in fortran and java" default="psicsjar" basedir=".">
<description>
utilities for compiling PSICS
</description>
<property name="winip" value="192.168.0.11"/>
<property name="macip" value="x.x.x.x"/>
<property name="macminiip" value="192.168.0.7"/>
<!--
TODO - use macip, put user and pass here too instead of hardcoded below?
-->
<property file="VERSION"/>
<path id="libclasspath">
<fileset dir="out">
<include name="**/*.jar" />
</fileset>
</path>
<path id="javahcp">
<pathelement location="../Native/bin"/>
</path>
<target name="c headers">
<javah destdir="../CPSICS/wrap" class="org.psics.pnative.FileFPSICS">
<classpath refid="javahcp"/>
</javah>
</target>
<target name="sourcezip">
<zip destfile="out/psics-fortran-src.zip">
<zipfileset dir="fPSICS" prefix="src"
includes="main.f90, matrix.f90, mersenne.f90,
output.f90, model.f90, stimrec.f90, passprop.f90,
memchan.f90, cell.f90, fpsics.f90"/>
</zip>
</target>
<target name="versionize">
<replaceregexp>
<regexp pattern="versionname=.*"/>
<substitution expression='versionname="${version.name}"'/>
<fileset dir="fPSICS/">
<include name="main.f90"/>
</fileset>
</replaceregexp>
<replaceregexp>
<regexp pattern="versiondate=.*"/>
<substitution expression='versiondate="${version.date}"'/>
<fileset dir="fPSICS/">
<include name="main.f90"/>
</fileset>
</replaceregexp>
</target>
<target name="execcompile">
<delete dir="tmp/asc"/>
<mkdir dir="tmp/asc"/>
<copy todir="tmp/asc">
<fileset dir="fPSICS/" includes="*.f90"/>
</copy>
<exec executable="${cplr}" dir="tmp/asc">
<!--
<arg value="-g"/>
<arg value="-fbounds-check"/>
-->
<arg value="-O3"/>
<arg value="-o"/>
<arg value="${exe}"/>
<arg value="matrix.f90"/>
<arg value="mersenne.f90"/>
<arg value="output.f90"/>
<arg value="model.f90"/>
<arg value="stimrec.f90"/>
<arg value="passprop.f90"/>
<arg value="memchan.f90"/>
<arg value="activity.f90"/>
<arg value="cell.f90"/>
<arg value="fpsics.f90"/>
<arg value="main.f90"/>
<arg value="${cplrarg}"/>
</exec>
</target>
<target name="executable_linux_absoft" depends="versionize">
<antcall target="execcompile">
<param name="cplr" value="/opt/absoft10.0/bin/af95"/>
<param name="exe" value="fpsics"/>
<param name="cplrarg" value="-lU77"/>
</antcall>
<copy file="tmp/asc/fpsics" tofile="fPSICS/exe/linux/fpsicsabsoft"/>
<copy file="tmp/asc/fpsics" tofile="out/fpsics"/>
<chmod file="out/fpsics" perm="ugo+rx"/>
</target>
<target name="executable_linux_gfortran" depends="versionize">
<antcall target="execcompile">
<param name="cplr" value="/usr/bin/gfortran"/>
<param name="exe" value="fpsics"/>
<param name="cplrarg" value="-Wall"/>
</antcall>
<copy file="tmp/asc/fpsics" tofile="fPSICS/exe/linux/fpsics"/>
<copy file="tmp/asc/fpsics" tofile="out/fpsics"/>
<chmod file="out/fpsics" perm="ugo+rx"/>
</target>
<target name="executable_windows" depends="versionize" >
<echo message="using windows ip ${winip}"/>
<scp todir="robert:laptop@${winip}:">
<fileset dir="fPSICS"
includes="main.f90, matrix.f90, mersenne.f90,
output.f90, model.f90, stimrec.f90, passprop.f90,
memchan.f90, cell.f90, fpsics.f90, activity.f90"/>
</scp>
<sshexec host="${winip}" username="robert" password="laptop"
command="touch tmp.mod; touch tmp.o; rm *.mod *.o; /usr/local/gfortran/bin/gfortran.exe -O3 mersenne.f90 matrix.f90 memchan.f90 activity.f90 stimrec.f90 passprop.f90 model.f90 cell.f90 output.f90 fpsics.f90 main.f90"/>
<scp todir="fPSICS/exe/tmp" file="user:pass@${winip}:a.exe"/>
<copy file="fPSICS/exe/tmp/a.exe" tofile="fPSICS/exe/windows/fpsics-cw.exe"/>
<sshexec host="${winip}" username="user" password="pass"
command="rm *.mod *.o; /cygdrive/c/Program\ Files/gfortran/bin/gfortran -O3 mersenne.f90 matrix.f90 memchan.f90 activity.f90 stimrec.f90 passprop.f90 model.f90 cell.f90 output.f90 fpsics.f90 main.f90"/>
<scp todir="fPSICS/exe/tmp" file="robert:laptop@${winip}:a.exe"/>
<copy file="fPSICS/exe/tmp/a.exe" tofile="fPSICS/exe/windows/fpsics.exe"/>
</target>
<target name="executable_mac" depends="versionize">
<scp todir="user:[email protected]:">
<fileset dir="fPSICS"
includes="main.f90, matrix.f90, mersenne.f90, activity.f90,
output.f90, model.f90, stimrec.f90, passprop.f90,
memchan.f90, cell.f90, fpsics.f90"/>
</scp>
<sshexec host="129.215.83.173" username="user" password="pass"
command="af95 -lU77 -O3 mersenne.f90 matrix.f90 memchan.f90 stimrec.f90 activity.f90 passprop.f90 model.f90 cell.f90 output.f90 fpsics.f90 main.f90"/>
<!-- command could also be /usr/local/bin/gfortran -->
<scp todir="fPSICS/exe/tmp" file="user:[email protected]:a.out"/>
<copy file="fPSICS/exe/tmp/a.out" tofile="fPSICS/exe/mac/fpsics"/>
</target>
<target name="executable_mac_local" depends="versionize">
<scp todir="user:pass@${macminiip}:">
<fileset dir="fPSICS"
includes="main.f90, matrix.f90, mersenne.f90, activity.f90,
output.f90, model.f90, stimrec.f90, passprop.f90,
memchan.f90, cell.f90, fpsics.f90"/>
</scp>
<!-- there is a -static flag, but it is not supported on darwin -->
<sshexec host="${macminiip}" username="user" password="pass"
command="/usr/local/bin/gfortran -O3 -all_load mersenne.f90 matrix.f90 memchan.f90 activity.f90 stimrec.f90 passprop.f90 model.f90 cell.f90 output.f90 fpsics.f90 main.f90"/>
<scp todir="fPSICS/exe/tmp" file="user:pass@${macminiip}:a.out"/>
<copy file="fPSICS/exe/tmp/a.out" tofile="fPSICS/exe/mac/fpsics"/>
</target>
<target name="psicsjar" depends="docjar">
<delete>
<fileset dir="out" includes="psics*.jar"/>
</delete>
<jar jarfile="out/${version.name}.jar">
<fileset dir="bin" includes="org/psics/**"/>
<fileset dir="bin" includes="org/catacomb/**"/>
<fileset dir="." includes="VERSION"/>
<zipfileset prefix="org/psics/exe" dir="fPSICS/exe" includes="l*/*, m*/*, w*/*"/>
<zipfileset prefix="org/psics/exe" dir="out" includes="mkdoc.jar"/>
<zipfileset src="lib/jep-2.4.0.jar"/>
<zipfileset src="lib/janino.jar"/>
<manifest>
<attribute name="Created-By" value="Robert Cannon"/>
<attribute name="Main-Class" value="org.psics.PSICS"/>
</manifest>
</jar>
</target>
<target name="docjar">
<jar jarfile="out/mkdoc.jar">
<fileset dir="bin"/>
<fileset dir="." includes="VERSION"/>
<manifest>
<attribute name="Created-By" value="Robert Cannon"/>
<attribute name="Main-Class" value="org.psics.run.Reporter"/>
</manifest>
</jar>
</target>
<target name="executables" depends="executable_linux_gfortran, executable_mac, executable_windows">
</target>
<target name="fulljar" depends="executables, psicsjar">
</target>
</project>