Questions tagged [f2c]

f2c is the name of a program to convert Fortran 77 to C code, developed at Bell Laboratories.

f2c is the name of a program to convert Fortran 77 to C code, developed at Bell Laboratories.

See https://en.wikipedia.org/wiki/F2c

19 questions
7
votes
1 answer

Extern struct in C

I have a C file generated with f2c (Fortran to C translator) that contains the following C structure: struct { real rez, pi, st; } const_; How can I declare this const_ variable as an external in another .c file without modifying the one…
dpq
  • 9,028
  • 10
  • 49
  • 69
3
votes
1 answer

how to call fortran routines from C++?

I wish to call fortran routine cbesj.f from my C++ code and how do I achieve this? Here are steps I have done: Download cbesj.f plus dependencies from netlib amos webpage, http://www.netlib.org/cgi-bin/netlibfiles.pl?filename=/amos/cbesj.f In the…
Franklin Dong
  • 183
  • 1
  • 1
  • 10
2
votes
0 answers

Xcode duplicate symbol '_main'

I have a bunch of .O files that I generated from a makefile.u which compiles some .C files. I put all of the .O files into my Xcode project and I receive the below error when it builds: duplicate symbol '_main' in: …
ez4nick
  • 9,756
  • 12
  • 37
  • 69
2
votes
2 answers

F2C translated code breaks when optimized by C++ compiler

I have a c++ program with a method that looks something like this: int myMethod(int* arr1, int* arr2, int* index) { arr1--; arr2--; int val = arr1[*index]; int val2 = arr2[val]; return doMoreThings(val); } With…
Anders Forsgren
  • 10,827
  • 4
  • 40
  • 77
1
vote
0 answers

CLAPACK f2c vs MKL : Matrix multiplication performance issue

I am looking for a solution to accelerate the performances of my program with a lot of matrix multiplications. So I hace replaced the CLAPACK f2c libraries with the MKL. Unfortunately, the performances results was not the expected ones. After…
seb Lucass
  • 11
  • 1
1
vote
2 answers

libf2c.so.2 - main is undefined

I will try to be very specific and informative. I want to create a Dockerfile with all the packages that are used in geosciences for the good of the geospatial/geoscientific community. The Dockerfile is built on top of the scipy-notebook…
1
vote
1 answer

Unresolved externals with static library in Visual Studio (f2c)

I've used f2c.exe successfully in converting some Fortran *.f files into *.c files. I made sure that #include "f2c.h" exists in each C file, and I added the directory containing that header file in MS VS2008: Properties -> C/C++ -> General ->…
MasterHD
  • 2,264
  • 1
  • 32
  • 41
1
vote
2 answers

Using Do-Loops in Include Files

In my fortran code, I'm attempting to include a DO loop, but I'm ending up with a "DO loop or BLOCK IF not closed." It appears if any other DO loops after the INCLUDE statement are opened it treats them as nested loops, indicating to me the included…
Will S
  • 311
  • 2
  • 9
1
vote
0 answers

Different speed of quantreg lib on win7 and linux mint

I'm using quantreg library on both win7 64bit and linux Mint Maya 64bit and I realised big speed difference. I'm using Frisch-Newton method written in Fortran and I was mesuring speed only of the .Fortran() calling. I'm analyzing vector with length…
user1991825
  • 309
  • 1
  • 5
  • 16
0
votes
0 answers

C Value null when passed into function F2C

I am trying to run C code converted with f2c and am running into an issue. In my MainFile.C I have: static char fmt_4[] = "This is a very long string..."; static cilist io___94 = { 0, 6, 0, fmt_4, 0 }; printf("io___94.cierr:…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
0
votes
0 answers

building for iOS-arm64 but attempting to link with file built for unknown-x86_64

What I am trying to accomplish is to take code generated from f2c and use it in my existing Xcode project. I have all of the .C files in my project directory but I am unable to build the project. I asked a previous question but I think what I am now…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
0
votes
0 answers

Undefined symbols for architecture arm64, Building C files in xcode

What I am trying to do is take a bunch of .C files that I created using f2c.exe on a Windows computer and use them in Xcode in an already existing project consisting primarily of Swift code. On my Windows computer I used f2c to generate the .C files…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
0
votes
2 answers

Same f2c generated C code, built with gcc on 2 platforms gives different results

We have a strange issue with our code, we used a same code since several years on several platforms, but this year we needed to build our software on a 64-bit RHEL 8 system. During build processing, we need to convert some F77 code to C code using…
FMousnier
  • 1
  • 1
0
votes
1 answer

F2C structure and record

I am using F2C (FORTRAN 77 TO C) to convert a huge FORTRAN code to C. One of my source FORTRAN files has an include file that F2C does not like for some reasons. Here is the include file (TAGLINE.INS) with the extension .INS (I doubt if the…
Saeed
  • 35
  • 8
0
votes
1 answer

Can't compile and link library

I try to use a library compiled with gcc called matlisp based on fortran code. After specifyng the f77 compiler, I could performed the autoreconf, configure and make command to obtain the file libmatlisp.so. But when I try to use it i get a: Error…
Xaving
  • 329
  • 1
  • 11
1
2