|
[Sponsors] |
March 24, 2003, 15:02 |
FORTRAN static library
|
#1 |
Guest
Posts: n/a
|
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!
|
|
March 25, 2003, 16:40 |
Re: FORTRAN static library
|
#2 |
Guest
Posts: n/a
|
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 |
|
March 25, 2003, 16:47 |
Re: FORTRAN static library
|
#3 |
Guest
Posts: n/a
|
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 |
|
March 26, 2003, 05:11 |
Re: FORTRAN static library
|
#4 |
Guest
Posts: n/a
|
If this one is a shell script, you need to add a line as well like
SHELL = /bin/sh Manosh |
|
March 27, 2003, 05:44 |
Re: FORTRAN static library
|
#5 |
Guest
Posts: n/a
|
Hi,
If I want to use them under the visual fortran project, how to call them? Thanks in advance! Yiling |
|
March 27, 2003, 07:45 |
Re: FORTRAN static library
|
#6 |
Guest
Posts: n/a
|
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 |
|
April 1, 2003, 08:35 |
Re: FORTRAN static library
|
#7 |
Guest
Posts: n/a
|
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! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error: uninitialized local variable 't' used | MASOUD | Fluent UDF and Scheme Programming | 5 | October 17, 2016 05:24 |
fprint problem | MASOUD | Fluent UDF and Scheme Programming | 5 | October 30, 2011 17:08 |
Using PetsC library in compaq visual fortran | salman189 | Main CFD Forum | 0 | May 22, 2011 02:58 |
defining a term for a domain using DEFINE_ADJUST | MASOUD | Fluent UDF and Scheme Programming | 1 | September 24, 2010 06:08 |
enum | MASOUD | Fluent UDF and Scheme Programming | 0 | June 5, 2010 01:49 |