Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Fortran and C Mix language program
New Posts  All Forums:Forum Nav:

Fortran and C Mix language program

post #1 of 4
Thread Starter 
I been trying to compile a mix language in fortran and c. The type of program I'm trying to run is similar to the follow link:

http://molsim.chem.uva.nl/frenkel_smit/Exercise_8/index.html

Up to this point I been using Fortran PowerStation version 4.0 on my coding, but when I compile the above code the c files gives me several errors.
error LNK2001: unreesolved external symbol_RAN_UNIFORM@0

The problem is the C files. When I tell the compile where to find the c files it tries to compile them as fortran code and gives error.

After some research I found that your supposed to run this program on a Linux system. The author states, "All programs are pre-compiled for Redhat Linux 6.1 (Cartman) on an i386."

I'm trying to run the Monte Carlo simulation, which I need to modify and integrate into another program in fortran for research purpose. My question is there any way I can compile this program on a Window 7 using my current compiler, Fortran PowerStation version 4.0?

The last couple of days I been trying to make the "make" command work on my pc with MinGW, but it appears the latest version doesn't have g77 compiler. I'm not even sure if the "make" command is doing what it's supposed to do. The ugly way to make the code work is to run the code using the exact compiler under Linux to run the program, but that will require dual booting, which I would like to avoid if possible.

This is first time I have come across a mix language program.

The author of said program has a small section with regards to non unix operating system, which I believe is the main problem with compiling this program on my Windos 7 operating system.
Here is the link:

http://molsim.chem.uva.nl/frenkel_smit/non_unix.html
Edited by Bekster - 3/9/13 at 1:13pm
post #2 of 4
The make command uses a makefile that you create in the program directory, did you do this? If so, can you post the source code?
    
CPUMotherboardGraphicsRAM
Intel Core i7 5820K EVGA X99 Micro2 EVGA GTX 980 32GB DDR4-2400 
Hard DriveOSMonitorPower
Samsung 850 Pro Windows 10 x64 Pro Qnix 1440p EVGA 850W Gold 
Case
CaseLabs Mercury S5 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i7 5820K EVGA X99 Micro2 EVGA GTX 980 32GB DDR4-2400 
Hard DriveOSMonitorPower
Samsung 850 Pro Windows 10 x64 Pro Qnix 1440p EVGA 850W Gold 
Case
CaseLabs Mercury S5 
  hide details  
Reply
post #3 of 4
Thread Starter 
Here are two pics of the file that contains the makefile and what happens when I compile the program using the main program code.



Here is pic of compiling

post #4 of 4
Try using gfortran instead of g77. GCC(which MinGW uses) replaced g77 with gfortran some time ago. Assuming you installed all of the compilers, it should be there...

Or, you could just use a Unix-like system(Many GNU/Linux and BSD based systems are free(gratis) and play nicely inside virtual machines if you don't want to do a full install).
Meh
(14 items)
 
   
CPUMotherboardGraphicsRAM
i5 760 @ 3.8 Ghz GA-P55-USB3 Gigabyte GTX 460 16GB(4x4) Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Samsung Spinpoint F3 1TB Asus Cheapo Corsair H70 Arch Linux 
MonitorKeyboardPowerCase
LG 26LH20 HDTV Das Model S Ultimate Silent Corsair HX850 Lian Li(Lancool) PC-K62 
MouseMouse Pad
Logitech MX 518 My desk. 
CPUMotherboardGraphicsRAM
Intel Core i5-4200U Toshiba Intel HD Graphics 4400 6 GB DDR3L @1600 Mhz 
Hard DriveOptical DriveCoolingOS
750 GB 5400RPM SATA HDD DVD SuperMulti drive Stock fans Arch Linux 
MonitorKeyboardPowerCase
15.6" 1920x1080 Screen Toshiba Toshiba battery and A/C adapter Toshiba 
MouseAudio
Touchpad Intel HD Audio 
  hide details  
Reply
Meh
(14 items)
 
   
CPUMotherboardGraphicsRAM
i5 760 @ 3.8 Ghz GA-P55-USB3 Gigabyte GTX 460 16GB(4x4) Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Samsung Spinpoint F3 1TB Asus Cheapo Corsair H70 Arch Linux 
MonitorKeyboardPowerCase
LG 26LH20 HDTV Das Model S Ultimate Silent Corsair HX850 Lian Li(Lancool) PC-K62 
MouseMouse Pad
Logitech MX 518 My desk. 
CPUMotherboardGraphicsRAM
Intel Core i5-4200U Toshiba Intel HD Graphics 4400 6 GB DDR3L @1600 Mhz 
Hard DriveOptical DriveCoolingOS
750 GB 5400RPM SATA HDD DVD SuperMulti drive Stock fans Arch Linux 
MonitorKeyboardPowerCase
15.6" 1920x1080 Screen Toshiba Toshiba battery and A/C adapter Toshiba 
MouseAudio
Touchpad Intel HD Audio 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Fortran and C Mix language program