FORTRAN static library
hi, dear all, could you please tell me how could I use(add) an existed fortran static lib in a main fortran project, thanks very much!
|
Re: FORTRAN static library
Here's a makefile sample:
FC = g77 -g -Wall FLIBS = -lblas -llapack -lslatec PROGRAM = poisson SOURCES = poisson.f linsolve.f iostuff.f utils.f OBJECTS = poisson.o linsolve.o iostuff.o utils.o INCLUDE = poisson.h all: ${PROGRAM} ${PROGRAM}: ${OBJECTS} ${FC} -o ${PROGRAM} ${OBJECTS} ${FLIBS} clean: rm -f ${OBJECTS} ${PROGRAM} core |
Re: FORTRAN static library
p.s. there should be a tab in the start of the following lines:
${FC} -o ${PROGRAM} ${OBJECTS} ${FLIBS} and rm -f ${OBJECTS} ${PROGRAM} core |
Re: FORTRAN static library
If this one is a shell script, you need to add a line as well like
SHELL = /bin/sh Manosh |
Re: FORTRAN static library
Hi,
If I want to use them under the visual fortran project, how to call them? Thanks in advance! Yiling |
Re: FORTRAN static library
hi
Create a file called Makefile in your folder, which will include all things have written by Nashat. In the same folder create directory 'SOURCES' which will contain all your source codes *f .. A header file (*.h) will be in the SOURCE directory. create directory PROGRAM, which will contain the exe file. Hope this helps. Manosh |
Re: FORTRAN static library
hi, dear all, i have known the answer, thanks a lot for all of your help!
If you want to use them under the visual fortran project, two steps as following: first step: add your library file(.lib) directory into the 'projest->setting->link->object/library modules', please note the full directory and the library file name are needed second step: add your library file(.lib) directory into the 'projest->setting->Fortran->category->preprocessor->include and use path' please note only the full directory is needed good luck! |
All times are GMT -4. The time now is 08:59. |