CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

FORTRAN static library

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2003, 14:02
Default FORTRAN static library
  #1
littlelz
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!
  Reply With Quote

Old   March 25, 2003, 15:40
Default Re: FORTRAN static library
  #2
Nashat
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
  Reply With Quote

Old   March 25, 2003, 15:47
Default Re: FORTRAN static library
  #3
Nashat
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

  Reply With Quote

Old   March 26, 2003, 04:11
Default Re: FORTRAN static library
  #4
Manosh
Guest
 
Posts: n/a
If this one is a shell script, you need to add a line as well like

SHELL = /bin/sh

Manosh
  Reply With Quote

Old   March 27, 2003, 04:44
Default Re: FORTRAN static library
  #5
Yiling
Guest
 
Posts: n/a
Hi,

If I want to use them under the visual fortran project, how to call them? Thanks in advance!

Yiling
  Reply With Quote

Old   March 27, 2003, 06:45
Default Re: FORTRAN static library
  #6
Manosh
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
  Reply With Quote

Old   April 1, 2003, 07:35
Default Re: FORTRAN static library
  #7
littlelz
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!
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 04:24
fprint problem MASOUD Fluent UDF and Scheme Programming 5 October 30, 2011 16:08
Using PetsC library in compaq visual fortran salman189 Main CFD Forum 0 May 22, 2011 01:58
defining a term for a domain using DEFINE_ADJUST MASOUD Fluent UDF and Scheme Programming 1 September 24, 2010 05:08
enum MASOUD Fluent UDF and Scheme Programming 0 June 5, 2010 00:49


All times are GMT -4. The time now is 09:01.