[問題] 無法輸出output(已寫好的檔案)
我拿到一份寫好的檔案要試跑
理論上應該執行就好了 不過我怎麼試 make 或 gfortran 都沒有 output file 產生
請問問題可能出在哪裡 還是我該用別的指令?
(資料在 cabbagel.F
主程式會呼叫一個叫做 parfit的資料夾裡面的檔案
結果應該要產生成一個檔案
我在Ubuntu 下打 make 或 make cabbagel 或 改成gfortran ,會跑但都沒有產生)
__下面是主程式的makefile__
# Makefile for PARFITS
# version including handling of implicit switches
MAKE = make
FC = gfortran
TRAJEC = traj.o
BLASM = ./parfits/blasm/blas.o \
./parfits/blasm/mutil.o \
./parfits/blasm/dgesvd1.o
INTEGR1 = ./parfits/integr/metanb.o
# INTEGR2 = ./parfits/integr/difsys.o (not available)
PARFITS = ./parfits/parfits.o \
./parfits/monitn.o \
./parfits/initju.o \
./parfits/hcut.o \
./parfits/inscal.o \
./parfits/rankr.o \
./parfits/evalc.o \
./parfits/ssai.o \
./parfits/chscal.o \
./parfits/calcom.o \
./parfits/ind.o \
./parfits/intj.o \
./parfits/idcon.o \
./parfits/qdiff.o \
./parfits/hdiff.o \
./parfits/update.o \
./parfits/fd.o \
./parfits/yallfunc.o \
./parfits/upmult.o \
./parfits/exit.o
INCREM = ./parfits/increm/increm4.o \
./parfits/increm/inc4_l2.o \
./parfits/increm/inc4_l1.o \
./parfits/increm/inc4_l3.o \
./parfits/increm/dec4_l2.o \
./parfits/increm/sol_l2.o \
./parfits/increm/sol_l1.o \
./parfits/increm/sol_l3.o \
./parfits/increm/dminv_l1.o \
./parfits/increm/qpsol.o \
./parfits/increm/lpckk.o \
./parfits/increm/qpckk.o \
./parfits/increm/qpckk1.o \
./parfits/increm/qpckk2.o \
./parfits/increm/crj.o
COV = ./parfits/cov/cov.o \
./parfits/cov/cov4.o \
./parfits/cov/covtot.o
PRINT = ./parfits/print/print.o \
./parfits/print/prtmain.o \
./parfits/print/prthead.o \
./parfits/print/prtit.o \
./parfits/print/prtmatrix.o \
./parfits/print/prtmatrixlp.o \
./parfits/print/prtmatrixhp.o \
./parfits/print/prtmatrixint.o
PYMETS = pymets.o
PYMET2S = pymet2s.o
CABBAGEL = cabbagel.o
CABBAGEQ = cabbageq.o
CABBAGELLL = cabbagelll.o
CABBAGEQQQ = cabbageqqq.o
PYMETDS = $(PYMETS) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
PYMET2DS = $(PYMET2S) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
CABBAGDL = $(CABBAGEL) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
CABBAGDQ = $(CABBAGEQ) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
CABBAGDLLL = $(CABBAGELLL) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
CABBAGDQQQ = $(CABBAGEQQQ) $(PARFITS) $(INCREM) $(COV) $(INTEGR1) $(BLASM)
$(PRINT) $(TRAJEC)
FFLAGS = -c -g -Wall
CCFLAGS = -c -g -Wall
#LDFLAGS = -Wall
all: pymets pymet2s \
cabbagel cabbageq \
cabbagelll cabbageqqq
pymets: lkmaxdim mkparfits $(PYMETDS)
-@$(FC) $(PYMETDS) $(LDFLAGS) -o $@
pymet2s: lkmaxdim mkparfits $(PYMET2DS)
-@$(FC) $(PYMET2DS) $(LDFLAGS) -o $@
cabbagel: lkmaxdim mkparfits $(CABBAGDL)
-@$(FC) $(CABBAGDL) $(LDFLAGS) -o $@
cabbageq: lkmaxdim mkparfits $(CABBAGDQ)
-@$(FC) $(CABBAGDQ) $(LDFLAGS) -o $@
cabbagelll: lkmaxdim mkparfits $(CABBAGDLLL)
-@$(FC) $(CABBAGDLLL) $(LDFLAGS) -o $@
cabbageqqq: lkmaxdim mkparfits $(CABBAGDQQQ)
-@$(FC) $(CABBAGDQQQ) $(LDFLAGS) -o $@
mkparfits:
-@cd parfits;$(MAKE) parfit
lkmaxdim:
-@echo "Link auf maxdim wird gesetzt."
-@rm maxdim.f -f
ln -s ./parfits/maxdim.f maxdim.f
clean:
$(MAKE) clean -C ./parfits
rm maxdim.f -f
rm *.o -f
rm fort.* -f
rm pymets.f -f
rm pymet2s.f -f
rm cabbagel.f -f
rm cabbageq.f -f
rm cabbagelll.f -f
rm cabbageqqq.f -f
rm delays.f -f
rm traj.f -f
rm pymets -f
rm pymet2s -f
rm cabbagel -f
rm cabbageq -f
rm cabbagelll -f
rm cabbageqqq -f
# Following lines provide automatic invocation of the
# C preprocessor cpp for FORTRAN files with suffix .F
# (Default on most UNIX platforms, but not on IBM's)
# define preprocessor
CPP = /lib/cpp
# compiler option for preprocessor
CPFLAGS = -P
.SUFFIXES: .F
.F.o:
-@$(CPP) $(CPFLAGS) $< $*.f
$(FC) $(FFLAGS) $*.f
-@rm -f $*.f
.f.o:
-@$(FC) $(FFLAGS) $*.f
.c.o:
$(CC) $(CCFLAGS) $*.c
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 78.104.103.87
※ 文章網址: https://www.ptt.cc/bbs/Fortran/M.1524727815.A.0C9.html
→
04/26 17:31,
6年前
, 1F
04/26 17:31, 1F
程式本身有缺嗎?
→
04/27 00:33,
6年前
, 2F
04/27 00:33, 2F
這個程式有點麻煩的是,他是我的指導教授三十年前發表論文寫的
後來他都沒有親手改過,最後一個版本是十年前的學長動的
所以他看不懂 學長也早已畢業
實驗室大家在用的是Matlab, R, Python跟Java
很希望有版大可以告訴我問題在哪邊
目前是看得懂fortran程式想做些甚麼 但沒到可以寫的程度
(有Matlab跟R的經驗,學過初淺的C++)
→
04/27 10:37,
6年前
, 3F
04/27 10:37, 3F
→
04/27 10:43,
6年前
, 4F
04/27 10:43, 4F
抱歉昨天電腦不在身邊 所以用朋友的Window沒注意到
剛剛用我的電腦跑
用了make之後 會正常產生需要的 *.o 的資料
不過我期待他會在某個的地方產生output 但是一直都沒找到
___這是執行make後(獢颤是桌面 在複製 儲存 後的亂碼 執行時沒問題)___
user@user-Aspire-S5-371:~/獢颤/try$ make
ln -s ./parfits/maxdim.f maxdim.f
make[1]: Entering directory '/home/user/獢颤/try/parfits'
make[2]: Entering directory '/home/user/獢颤/try/parfits/print'
Building PRINT Objects
make[2]: Leaving directory '/home/user/獢颤/try/parfits/print'
make[2]: Entering directory '/home/user/獢颤/try/parfits/blasm'
Building BLAS and MUTIL Objects
make[2]: Leaving directory '/home/user/獢颤/try/parfits/blasm'
make[2]: Entering directory '/home/user/獢颤/try/parfits/cov'
Building COV Objects
make[2]: Leaving directory '/home/user/獢颤/try/parfits/cov'
make[2]: Entering directory '/home/user/獢颤/try/parfits/increm'
Building INCREM Objects
make[2]: Leaving directory '/home/user/獢颤/try/parfits/increm'
make[2]: Entering directory '/home/user/獢颤/try/parfits/integr'
Building INTEGR Objects
make[2]: Leaving directory '/home/user/獢颤/try/parfits/integr'
Building PARFITS
make[1]: Leaving directory '/home/user/獢颤/try/parfits'
___make結束後的檔案___
user@user-Aspire-S5-371:~/獢颤/try$ ls
cabbagel cabbagel.o cabbageqqq.F parameters pymets traj.F
cabbagel.F cabbageq cabbageqqq.o parfits pymets.F traj.o
cabbagelll cabbageq.F fort.13 pymet2s pymets.F_orig
cabbagelll.F cabbageq.o makefile pymet2s.F pymets.F-with
cabbagelll.o cabbageqqq maxdim.f pymet2s.o pymets.o
user@user-Aspire-S5-371:~/獢颤/try$
※ 編輯: adu (78.104.103.87), 04/27/2018 15:40:17
→
04/27 20:24,
6年前
, 5F
04/27 20:24, 5F
→
04/27 21:19,
6年前
, 6F
04/27 21:19, 6F
→
04/27 23:43,
6年前
, 7F
04/27 23:43, 7F
→
04/27 23:43,
6年前
, 8F
04/27 23:43, 8F
→
04/27 23:44,
6年前
, 9F
04/27 23:44, 9F
→
04/28 02:07,
6年前
, 10F
04/28 02:07, 10F
自己開啟執行檔是這個意思嗎?
user@user-Aspire-S5-371:~/PARFIT-EKATERINA$ gfortran -o cabbagel cabbagel.F
/tmp/ccylm1aX.o: 於函式 MAIN__:
cabbagel.F:(.text+0x13b): 未定義參考到「dcopy_」
cabbagel.F:(.text+0x2e7): 未定義參考到「metanb_」
cabbagel.F:(.text+0x30b): 未定義參考到「parfit_」
cabbagel.F:(.text+0x36d): 未定義參考到「metanb_」
cabbagel.F:(.text+0x3a8): 未定義參考到「traj_」
collect2: error: ld returned 1 exit status
※ 編輯: adu (78.104.103.87), 04/28/2018 02:40:49
→
04/28 13:31,
6年前
, 11F
04/28 13:31, 11F
對 有output了!
我看看要怎麼把新的資料改進去
謝謝rex0707, blc跟 Cypresslin :D
※ 編輯: adu (78.104.26.192), 04/28/2018 16:41:32
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章