Re: using dot_product from c++
- From: kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Steven G. Kargl)
- Date: Wed, 13 Feb 2008 23:39:27 +0000 (UTC)
In article <1202944737_13505@xxxxxxxxxxxxxxxxxxxxx>,
"Gerry Ford" <invalid@xxxxxxxxxxx> writes:
"Craig Powers" <enigma@xxxxxxxxxx> wrote in message
news:47b34bd4$0$29924$a726171b@xxxxxxxxxxxxxxxxxx
utab wrote:
+ Second question(just curious about to give a try to file processing)
is that if I would like to write the result inside the fortran
subroutine, I am uncommenting the 3 lines related to file operation,
and compiling and linking fine but there is still a problem with the
IO differences between two programming languages I guess(not sure
though)
vecpro.o: In function `vectorproduct_':
vecpro.f90:(.text+0xcb): undefined reference to `_gfortran_st_open'
vecpro.f90:(.text+0x101): undefined reference to `_gfortran_st_write'
vecpro.f90:(.text+0x11e): undefined reference to
`_gfortran_transfer_real'
vecpro.f90:(.text+0x12c): undefined reference to
`_gfortran_st_write_done'
vecpro.f90:(.text+0x162): undefined reference to `_gfortran_st_close'
collect2: ld returned 1 exit status
I should still link some fortran related library I guess, but not so
sure, could you please direct me to right locations for the above
questions?
You need to either link using gfortran (instead of g++), or link against
the appropriate libraries; at a minimum, I think you'd need -lgfortran,
but there might be another one necessary to do initialization.
I think what you're suggesting is that the third line look different.
gfortran -c vecpro.f90
g++ -c vecprod.cc
g++ -o test vecpro.o vecprod.o -lg2c
Steve already mentioned that -lg2c was suspect.
It's not suspect. It is wrong. At a minimum you
need -lgfortran. But that may not be sufficient
because g++ may not (more likely does not) properly
set up the gfortran runtime environment.
Apparently, the gcc linker is unconcerned with filetypes. How does one know
what libraries one needs in a simple handoff of two vectors in a calculation
that either syntax could pull off by itself?
gcc -v
gfortran -v
g++ -v
These commands will show the gory details.
--
Steve
.
- References:
- using dot_product from c++
- From: utab
- Re: using dot_product from c++
- From: Craig Powers
- Re: using dot_product from c++
- From: utab
- Re: using dot_product from c++
- From: Craig Powers
- Re: using dot_product from c++
- From: Gerry Ford
- using dot_product from c++
- Prev by Date: Re: using dot_product from c++
- Next by Date: Difference between Intel Visual Fortran and Compaq VF
- Previous by thread: Re: using dot_product from c++
- Next by thread: Re: using dot_product from c++
- Index(es):
Relevant Pages
|
|