| 5 | 1/1 | 返回列表 |
| 查看: 2006 | 回復(fù): 18 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
[交流]
【求助】f77的ifdef語句
|
|||
|
在看一個(gè)老的f77程序,其中inc文件有這么幾句: #ifdef BL real dd(nbig) #else real dd(1) #endif 好像是為了省點(diǎn)內(nèi)存。 但我用g95編譯不過去,說第2個(gè)dd已經(jīng)被定義了。 該怎么處理呀? 謝謝 |
» 搶金幣啦!回帖就可以得到:
+1/282
+1/187
+5/85
+1/83
+1/80
+1/74
+2/48
+2/46
+1/40
+1/39
+1/22
+1/11
+1/8
+1/8
+1/7
+1/7
+1/6
+1/6
+1/5
+1/3
|
回的真快。 不好意思貼一大段。 這是其中要插入的一個(gè)文件。原來是給linux的,我正試著改成win的。這個(gè)是流體程序duns,http://duns.sourceforge.net/home.html 我用的win下的gcc4.5.1是這里的 http://www.equation.com/servlet/equation.cmd?call=fortran 預(yù)處理怎么沒執(zhí)行到? .f和.F兩個(gè)目標(biāo),在win下我必須注釋掉一個(gè)。 謝謝 # # This makesystem was constructed on a PII machine running Linux. # We found we had to use fort77 (front-end to f2c) # instead of g77/f77 that comes with most distributions, although # we still link with the g2c directory. Enjoy. # .SUFFIXES: .Inc .inc .o .F .C .f .cpp .c F77 = gfortran CPP = gcc -C -x c -P -E -traditional-cpp CPLUS = g++ CC = gcc LINKER = gcc LIBMAKER= ar vr MKDIR =mkdir RM = del CP = copy #CHMOD = /bin/chmod CPPFLAGS = -DFUNDER -DISNAN #CFLAGS = -DRANGECHECK CFLAGS = -O2 F77FLAGS = -O2 -w #CPLUSFLAGS= -DRANGECHECK CPLUSFLAGS= -O2 LFLAGS = -Xlinker -Bstatic SYSLIBS = -L/usr/lib/gcc-lib/i486-suse-linux/2.95.2 -lg2c -lm GRAFLIBS = -lmbgrafic -lgrafic -L/usr/X11R6/lib -lX11 MACH = pcmach.o XGROBJ = Xunderscore.o #CPREC = double #FPREC = "double precision" CPREC = float FPREC = real VERSN = `2.7` .Inc.incw: @if [ -f $*.incw ]; then mv -f $*.incw $*.incw.bak; fi $(CPP) -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.incw .for.f: @if [ -f $*.f ]; then mv -f $*.f $*.f.bak; fi $(CPP) -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.f .cpp.c: @if [ -f $*.c ]; then mv -f $*.c $*.c.bak; fi $(CPP) -D"Include"="#include" -D"Define"="#define" -Dreal=$(CPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.c #.F.o: # $(CPP) -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.f $(F77) $(F77FLAGS) -c $*.f #.C.o: # $(CPLUS) $(INCLUDE) -Dreal=$(CPREC) $(CPLUSFLAGS) -c $< .f.o: $(F77) $(F77FLAGS) -c $< .c.o: $(CC) $(CFLAGS) -DVERSION=\"$(VERSN)\" -c $< [ Last edited by cean on 2010-12-6 at 11:03 ] |
至尊木蟲 (職業(yè)作家)
|
makefile里有這么一句: .Inc.inc: @if [ -f $*.inc ]; then mv -f $*.inc $*.inc.bak; fi $(CPP) -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.inc 我現(xiàn)在所有的F文件都編譯過去了,只剩下幾個(gè)cpp文件編不過去。 原來的makefile是linux下的,我在xp下用gcc4.5, 肯定makefile改的還沒對(duì)。 [ Last edited by cean on 2010-12-4 at 21:18 ] |
至尊木蟲 (職業(yè)作家)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 310求調(diào)劑 +5 | 爭(zhēng)取九點(diǎn)睡 2026-03-30 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 283求調(diào)劑(080500) +7 | A child 2026-03-27 | 7/350 |
|
|
[考研] 294分080500材料科學(xué)與工程求調(diào)劑 +8 | 柳溪邊 2026-03-26 | 8/400 |
|
|
[考研] 一志愿鄭州大學(xué),080500學(xué)碩,總分317分求調(diào)劑 +8 | 舉個(gè)栗子oi 2026-03-24 | 9/450 |
|
|
[考研] 求調(diào)劑一志愿武漢理工大學(xué)材料工程(085601) +7 | WW.' 2026-03-23 | 9/450 |
|
|
[考研] 298求調(diào)劑 +3 | 種圣賜 2026-03-29 | 3/150 |
|
|
[考研] 356求調(diào)劑 +3 | gysy?s?a 2026-03-28 | 3/150 |
|
|
[考研] 0703化學(xué)調(diào)劑,求導(dǎo)師收 +9 | 天天好運(yùn)來上岸?/a> 2026-03-24 | 10/500 |
|
|
[考研] 332求調(diào)劑 +4 | @MZB382400 2026-03-28 | 4/200 |
|
|
[考研] 本科新能源科學(xué)與工程,一志愿華理能動(dòng)285求調(diào)劑 +3 | AZMK 2026-03-27 | 5/250 |
|
|
[考研] 一志愿華北電力大學(xué)能動(dòng)專碩,293,求調(diào)劑 +3 | 15537177284 2026-03-23 | 5/250 |
|
|
[考研] 266分,求材料冶金能源化工等調(diào)劑 +7 | 哇呼哼呼哼 2026-03-27 | 9/450 |
|
|
[考研] 285求調(diào)劑 +4 | AZMK 2026-03-27 | 7/350 |
|
|
[考研] 求調(diào)劑 +4 | 零八# 2026-03-27 | 4/200 |
|
|
[考研] 0856調(diào)劑 +5 | 求求讓我有書讀?/a> 2026-03-26 | 6/300 |
|
|
[考研] 324求調(diào)劑 +5 | hanamiko 2026-03-26 | 5/250 |
|
|
[考研] 一志愿陜師大生物學(xué)071000,298分,求調(diào)劑 +5 | SYA! 2026-03-23 | 5/250 |
|
|
[考研] 一志愿河工大 081700 276求調(diào)劑 +4 | 地球繞著太陽轉(zhuǎn) 2026-03-23 | 4/200 |
|
|
[考研] 一志愿哈工大,085400,320,求調(diào)劑 +4 | gdlf9999 2026-03-24 | 4/200 |
|
|
[考研] 0854人工智能方向招收調(diào)劑 +4 | 章小魚567 2026-03-24 | 4/200 |
|