File: README

package info (click to toggle)
libcgns 2.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,740 kB
  • ctags: 4,493
  • sloc: ansic: 46,717; fortran: 1,341; sh: 368; makefile: 259
file content (53 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

There are 2 things that need to be correct for the
Fortran to C interface to work properly. The first
is the form of the Fortran name mangling. If you get
unresolved references, then this is not correct. You
can control this by defining one of:

UPPERCASE   : Fortran name is CSUB
UPPERCASE_  : Fortran name is CSUB_
UPPERCASE__ : Fortran name is CSUB__
LOWERCASE   : Fortran name is csub
LOWERCASE_  : Fortran name is csub_
LOWERCASE__ : Fortran name is csub__

The default is LOWERCASE_, except for Cray, VMS and Windows
which use UPPERCASE. See csub.c for these interfaces.

*** NOTE ***
If you are using g77, this will probably not work unless
you use LOWERCASE_ (the default) and add -fno-second-underscore
to the Fortran compile line. The reason is that g77 appends
2 underscores to names that contain an underscore already,
and only 1 to names that don't.
Thus, cg_sub becomes cg_sub__ and adfsub becomes adfsub_
************

The second is the location of the implicit string len
in the argument list, and accessing the character string.
With the exception of Cray, VMS and Windows, the standard
is to put the implicit length at the end of the argument list.
For the Cray and VMS, these are accessed through structures.
For Visual Fortran, the implicit length immediately follows the string.

To figure out what you need, compile csub.c with the appropriate
define, then compile and link fmain.f with you Fortran compiler.

cc -c csub.c
f77 -o fmain fmain.f csub.o [any other libs you need]

If you get an undefined reference to CSUB_ or _CSUB_ (for instance) then
repeat with:

cc -DUPPERCASE_ -c csub.c

After your links succeeds, run fmain.

There is also a Makefile - edit as needed, then run make.

If none of these work for you, please let me know:

Bruce Wedan
bruce.wedan@ansys.com