Programming :: Fortran 90 Code - Makefile Insensitive To Change
Mar 10, 2011
I am dealing with one FORTRAN 90 code, have made small changes.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ ifort -c MT2DDIB1.FOR
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
I go for make command but it does not see that the source code has been modified.Than I do compilation from command line,try make again but no use.
F95=ifort
FFLAFGS= -O1
mt3: driver_mt2ddi.o constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -o $(FFLAGS) mt3 constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o driver_mt2ddi.o
driver_mt2ddi.o: driver_mt2ddi.for constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -c $(FFLAGS) driver_mt2ddi.for
View 2 Replies
ADVERTISEMENT
Apr 15, 2009
I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86. Here are the files I've got:
foo.c:
Code:
#include <stdio.h>
extern int qux_();
main() {
[code]....
View 2 Replies
View Related
Jun 10, 2009
I'm not a Fortran coder but I need to call the sub-routine ADAPT.f from a c code.This subroutine calculates a multiple integral of a given function.My problem is that the c code works with no problem in a 32 bit machine but it does not in a 64 bit machine, and the problem seems to be related to adapt, which calculations gives a NA rather than the result of integration.Since fortran is quite obscure for me, I don't know why is this happening. Maybe I should change some data type (from real to double), but I'm not sure. Does anyone have a clue?
View 3 Replies
View Related
Jun 19, 2010
I'd like to write a Makefile for my CUDA/C++ code but I didn't know how things work with CUDA, I mean there is a nvcc compiler but I don't know what I've got to do with this.
Do I have to firstly run nvcc and then g++ or only nvcc to compile my CUDA/C++ code ? I found nothing on the web explaining such basic things .
View 1 Replies
View Related
Mar 4, 2010
I've been trying to work out a way to stop chunks of code being compiled using a variable in my makefile but can't work it out. What I mean is for example in my code I might have.
/****output comms portdata********/
printf("
debug comms port %d",ReadPort("ttys1);
I only wish this code to be compiled when I'm debugging. What I've tried is using #ifdef with
#ifdef COMM_PORT_DEBUG
printf("
debug comms port %d",ReadPort("ttys1);
#endif
Then in my make file I set COMM_PORT_DEBUG to 1 so
DEBUG_DEFS = COMM_PORT_DEBUG=1
I then thought I could put it into my in my link line
all: $(CC) $(CPFLAGS) $(DEBUG_DEFS) $(INC_PATHS) $(SOURCE) -o $(PROGRAM) $(LIB_DIRS) $(GAME_LIBS)
but this gives a
gcc: COMM_PORT_DEBUG=1: No such file or directory
is there a way to do this sort of thing? Or am I barking up the wrong tree?
View 1 Replies
View Related
Apr 17, 2011
I want to build an object code for ARM at91rm9200 board from a Makefile using a crosscompiler.
View 4 Replies
View Related
Nov 12, 2010
I'd like to create a target named "debug" or something similar which will use some special optimization flags useful when debugging (for example -ggdb). At the moment my makefile is neat (which I like) and looks like
Code:
SRC = $(wildcard *.cxx)
OBJ = $(SRC:.cxx=.o)
INCDIR = -I.
LIB = -lm
[Code]....
View 2 Replies
View Related
Aug 19, 2011
I have a big fortran code for FE analysis. I want to change the code to python. I am curious to know, whether I will get any advantage over speed, If not at least the speed should not be less than what fortran gives. Should I go for it.
View 2 Replies
View Related
May 18, 2011
I can compile an old fortran program on my macbook using the Absoft fortran compiler and the command:f90 'W132 C SOURCECODE.flU77lV77
Unfortunately I cannot find f90 for linux. I can, however, find gfortran. However, gfortran does not recognize the flag -W132 and when I remove -W132 the compiler thinks all lines end after a certain number of characters. Does anyone know what flags call the equivalent type of compilation using gfortran? Is it possible I need to use f90? If so, is there a free version of f90 for linux?
View 8 Replies
View Related
Jul 27, 2011
I am looking for a text editor that does 1) syntax highlighting2) code folding3) it would be a bonus if I could set which macros were defined and it would show me the source I have tried geany, and codeblocks. Both incorrectly code fold around preprocessor #ifdef and #endif. The gedit plugin doesn't seem to work at all
View 7 Replies
View Related
Apr 12, 2010
I need a way to change the machine MAC address via a C code in linux. Ive find a way to retrieve it but not to change it.
View 4 Replies
View Related
Jul 11, 2010
I am working with a third party that use windows to compile. When we port that code I am running into a lot of case issues where the includes are not case sensitive. Is there any option in GCC to make it case insensitive. I know its a long shot, as I have done reading and does not seem so.
View 1 Replies
View Related
Feb 9, 2010
I want to modify the source of cd (the 'change directory' command) to do a little extra for me, but I can't seem to find the source code anywhere.. maybe I didn't look for it well enough, and googling "source code cd" and variants of that doesn't exactly help... I was wondering if anyone knew where I could find the src?
View 14 Replies
View Related
Apr 18, 2011
I am trying to write a script (especially C-shell) to execute a fortran code that reads in parameters from keyboard typing. I will have to process this .F code for many times with the parameters the same for all my data files, therefore, I don't have to type in everytime I execute the .F code. But I don't know what is the command in c shell to read in a text files that contains all the parameters I want and can make the shell read in appropriately to feed the .F code.
View 3 Replies
View Related
Dec 2, 2008
I synthesized a seismogram by using Fortran codes, I need plot the synthesized seismogram and the data together, so I can verify the accuracy of code. Now I encounter a question: how to read the SAC data by Fortran code, I have searched some codes on Internet, the details as follow:the velr12a.sac is my data file.
Code:
c read sac file
PROGRAM RSAC
PARAMETER (MAX=1000)
DIMENSION YARRAY(MAX)
CHARACTER*10 KNAME
[Code]....
View 2 Replies
View Related
Jan 19, 2010
I am trying to do a search for the certain books, and I am trying to make it case insensitive. what I have come up with so far is this :
Code:
Database.txt
RETARDED MONKEY:RACHEAL ABRAHAML:30:30:20
GOLD:FATIN:23.20:12:3
StUPiD:JERLYN:20:40:3
Code:
echo -n "Title: "
read Title
echo -n "Author:"
read Author
echo ""
valuecheck='grep -i "$Title" Database.txt | grep -i "$Author" | awk -F":" '{ print $1}''
echo $valuecheck
if [ $Title = $valuecheck ] ; then
echo "HOHOHO"
else
echo "too bad"
fi
The issue which I am having is that, when it does the search for the correct row to be inputted into valuecheck, it will input the value as written in the database, which is in Uppercase. For this case, if I type in stupid for $Title and jerlyn for $Author, it searches the correct row, but the awk will print "STUPID" into the variable as that is what is written in the database. So how can I make my if statement case insensitive? Currently it reads like this:
Code:
if [ $Title = $valuecheck ] ; then
which means
if [stupid = StUPiD ] ; then
How can I make the if statement it case insensitive to allow it to display "HOHOHO"
View 5 Replies
View Related
Mar 23, 2011
I have a question about choice of library to be used on low-end systems. I've so far been using SDL to create a user interface for a media system, and it's been working fantastically on my development machine, a dual core 2GHz machine with 2Gb RAM and an Intel graphics card. I get a frame rate of up to 100fps, and there is no slowdown at all. However when I run the exact same program on an embedded motherboard, the VIA EPIA EN15000G, which has a 1.5GHz processor, and a VIA P4M800 graphics chip (possibly the worst graphics chip ever invented as far as Linux support goes), I get a frame rate of less than 5fps. This makes the entire program totally unusable, and I've been left in a bit of a pickle. I've looked into alternatives like SFML, but that looks like it won't help at all on an unaccelerated system. I've also tried using OpenChrome drivers on it, and that made a negligible or nonexistent difference.
Can anybody suggest anything I could look into re: optimising my code or changing libraries goes? I already use SDL_DisplayFormatAlpha to convert my surfaces to the correct format. I haven't looked into Dirty Rectangles yet massively, as there's not much movement at all on the GUI, just the changing of button states.
Would use of OpenGL help at all if using the OpenChrome driver, which apparently has 2D acceleration? I'm more than willing to totally overhaul the code if needs be.
View 7 Replies
View Related
Jan 26, 2011
I'm having issue when trying to change a line in a file
[Code]....
View 1 Replies
View Related
Jan 15, 2010
I have the simple fortran codes as:
Code:
integer :: i1=2455121, i2=2455121
real :: s1=0.19123840, s2=0.20749992
real*8 :: a1, a2
a1=i1+s1; a2=i2+s2
[Code]....
When s1 and s2 are stated with 'real*8', the 64bit and 32bit systems get the same results.
View 6 Replies
View Related
Sep 29, 2010
There are examples everywhere about calling f77 subroutine from IDL, but I have not found any material about IDL calling fortran written in f90 way(free style). I tried the following example, but write the subroutines in free style. When I run the makefile, it gives an error 'undefined reference to main_'.
Code:
SUBROUTINE SUM_ARRAY(argc, argv) !Called by IDL
INTEGER*4 argc, argv(*) !Argc and Argv are integers
j = LOC(argc) !Obtains the number of arguments (argc)
[code]....
View 1 Replies
View Related
Jan 21, 2011
I want to call a subroutine in Fortran 90 from a c++ code. I can do it, when the fortran code have no module. But i need to call the subroutine in a fortran code that have an module. I have a simple program that shows my problem. The Fortran code is:
Code: !add2.f90
Module add2
Implicit none
Contains
[code]....
collect2: ld returned 1 exit status I Dont know where is the problem. Maybe it is in the call of the function. I found that the syntax have this form: extern void __namemodule__NMOD_namesubrutine(arg)
View 6 Replies
View Related
May 16, 2010
I have two arrays of data, called data1.dat and data2.dat. each contains 60 data. What I want to do is to compare the data in each file and write the counting into bins. It goes like this. First, take the first data in data1.dat file and compare with the 60 data in data2.dat file. If there is any data which is same with the data in data1.dat then it count in bin. The total bins are also 60. Next it goes to the second data in data1.dat and compare with all the 60 data in data2.dat. If there is any data same then it add in second bin. And it repeats to all the data in data1.dat
View 3 Replies
View Related
Jun 29, 2011
I have a 50 file name NSSAVE0001.vtk to NSSAVE0050.vtk.Do I have to manually type individually command to open each file or can I have a loop to open file?
View 3 Replies
View Related
Aug 26, 2010
I have a program which reads some parameters in from an input file before solving a differential equation. This program compiles fine, I'm using Numerical Algorithms Group (NAG) libraries to solve the differential equation so I'm also the NAG compiler called nagfor.
The namelist I have is declared as follows:
And the input file is:
When I run the code I get the following error message:
I really can't see what's wrong with this code.
Also, I'm using Fedora 11, and running the code in tcsh if this is relevant.
View 1 Replies
View Related
May 31, 2010
I just downloaded slackware 13.1(x86) and i'm trying to compile ndiswrapper-1.56 using the slackbuild from slackbuils.org and i'm getting this error:
Code:
Makefile:535: /usr/src/linux-2.6.33.4/arch/i486/Makefile: No such file or directory
make[2]: *** No rule to make target `/usr/src/linux-2.6.33.4/arch/i486/Makefile'. Stop.
make[1]: *** [modules] Error 2
make: *** [all] Error 2
looks like the folder i486 doesn't exist
View 2 Replies
View Related
Nov 7, 2010
I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:
maximum_dist_001_064.dat
maximum_dist_065_128.dat
maximum_dist_129_192.dat
maximum_dist_193_256.dat
View 1 Replies
View Related
May 19, 2011
i am graduate student and my X colleague gave me this Fortran 77 program to run my result files with. She is no longer reachable. I compiled the following program with gfortran, it compiled well but, when i run it, gave me end of file error. My output file (which is the input file for this program (DFILE1) ) has about 78,000 lines of velocities of atoms (Vx, Vy, Vz with 1000 steps.. an example of some of the atom's velocities in the 1st step is given at the end of this program). I will be highly obliged if any one can help me with this.I run this program on opensuse linux 11.3 version /32 bit/i586
error message:
Code:
At line 124 of file v.autocorrelation.f (unit = 10, file = 'DFILE1')
Fortran runtime error: End of file
Code:
PROGRAM TCORR
COMMON / BLOCK1 / STORX, STORY, STORZ
COMMON / BLOCK2 / VX, VY, VZ
COMMON / BLOCK3 / VACF, ANORM
C *******************************************************************
code....
View 6 Replies
View Related
Oct 19, 2009
I (my friend) have a fortran program with the code along the following lines:
Code:
SUBROUTINE NY
REAL, DIMENSION(4000,4000) :: a, b, c
...
RETURN
END SUBROUTINE PARAMETERS
The problem is that the huge matrices are retained in memory even after the subroutine ends. Is there an easy way to declare the arrays in a sort of dynamic way, like they were in the following C example?
Code:
void ny(void) {
double a[4000,4000];
...
}
I mean in the C example the memory is released as soon ny() exits.
View 5 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Mar 9, 2011
I have a new problem; i want to call a subroutine's fortran which have a function in the argument and the compilation ran properly, but when i execute the program this shows me an "Segmentation fault". This is my c++ program:
Code: //Main.cpp
#include <stdio.h>
#include <iostream>
[code]....
View 2 Replies
View Related