Any ideas, anyone ??
Thanks
Michel
Type: Posts; User: mimi1981
Any ideas, anyone ??
Thanks
Michel
Something more occured !
I run the code everything is fine until a message segmentation fault occured (I run with gdb)
Program received signal SIGSEGV, Segmentation fault.
gsl_fit_wlinear...
You're a genious !!
I type
gcc -c -I/data/mtsamado/KANT_8-8-2007/gsl/include/ KANT.c
gcc -static -L/data/mtsamado/KANT_8-8-2007/gsl/lib KANT.o -lgsl -lgslcblas -lm
As you suggested and...
Thanks I am not expert with linux and all these path things
I found on the net that I should do something like
export LD_LIBRARY_PATH=/data/mtsamado/KANT_8-8-2007/gsl/lib
but when I do that...
In the working directory I have the directory gsl/ that contains
include/
lib/
where lib/ contains the following
libgsl.a libgslcblas.la libgslcblas.so.0 libgsl.la libgsl.so.0 ...
Hi everyone!
I am using a code on a machine, and it works fine.
I compile with
gcc -c -g KANT.c
g77 -c -g tn.f
g77 -c -g blas.f
gcc -g KANT.o tn.o blas.o -lgsl -lgslcblas -lg2c
Great this forum is really fantastic and Matsp in particular !!! Thanks, your advices are always spot on.
I did as you suggested
gcc -c test1_KANT.c
g77 -c tn.f
g77 -c blas.f
gcc ...
Hi all!
The problem is now a little bit different.
I am compiling with
gcc -m32 -g -c test1.c
ifort -c tn.f
ifort -c blas.f
gcc -g -m32 test1.o tn.o blas.o -L/opt/intel/fc/9.0/lib/...
Thanks to all of you. You helped me a lot with these very annoying programming problems.
Now it is working. To summarize I compile with
ifort -c tn.f
ifort -c blas.f
gcc -m32 -g -c test1.c...
Hi again
We did one little step but there are still quite a few I suspect.
Now I pass to the actual code and I do
gcc -c -m32 test1.c
ifort -c tn.f
ifort -c blas.f
gcc -m32 test1.o...
WHAOOU
It compiled, I see what you mean I put everywhere pseudolmqn in the c code and it works !!!
Thanks, what a relief. Let's not get carried away though.
somefile.txt contains :
0000000000000000 T pseudolmqn_
??
Hi again, I added what you suggested
Now I type
gcc -c -m32 test2.c
ifort -c pseudoLMQN.f
gcc -m32 test2.c pseudoLMQN.o
and I get
In pseudoLMQN read
SUBROUTINE pseudoLMQN(N, X, F, G, SFUN)
IMPLICIT NONE
INTEGER N
DOUBLE PRECISION X(N), G(N), F, FNEW
EXTERNAL SFUN
Hi everyone.
Salem I followed your advice and tested my problem on very simple programs.
First the c code test2.c that calls a fortran function
#include <stdio.h>
#include <stdlib.h>
Thanks, but the problem is that when I do
g++ minim.o tn.o sfun.o blas.o -L/opt/intel/fc/9.0/lib -Bstatic -lifport -lifc
I get
/usr/bin/ld: escamotage incompatible...
So I have tested what they recommend and here it is. I use two simple test programs called test.f and test.c
1) ifort
ifort -v test.f gives:
Version 9.0...
file blas.o gives
blas.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (GNU/Linux), not stripped
Can you answer to my last question concerning how to pass the function as an argument...
So that is one stupid mistake sorted. Thanks and sorry about that.
One question you haven't answered is how to pass SFUN as an argument to the function LMPQ when I call it through
...
Here is the code (with my question in red).
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "f77.h"
ANY SPECIALIST ON HOW TO MIX THE LANGUAGES FORTRAN AND C see threads above???
Thanks I am stuck there for 5 days and I suspect it is trivial.
Thanks everyone and Mats especially.
This makes more sence.
Here is what I get now.
g++ -c minim.c -m32
minim.c: In function `int main()':
minim.c:45: erreur: ne peut convertir « double » à « void (*)(int*, double*,...
Hi I really appreciate your help.
I use this syntax
extern "C"{
void SFUN_(int *N, double X[], double *F, double G[]);
}
Hi,
I will try and clarify.
What I want to do is to include an optimization code from netlib called TN/TNBC in a c code.
The fortran code is working well, the main code is the following.
Hi all again, thanks for the answer but has anyone a bit more information to give me on this topic ??