Dear Alvaro,
did you test that?
The problem I had is that the second underscore needs to be added only
if the name contains an underscore, not generically to all the calls. I
don't know how that can be put into mangle_names.h, but if you know how
to do that, this would likely fix the problem indeed.
Best wishes,
Alexander
Alvaro Caceres wrote:
> I think all of FLASH's c routines use mangle_names.h, so to fix the
> linker problem it should look something like:
>
> #ifndef MANGLE_NAMES_H
> #define MANGLE_NAMES_H
>
> #ifdef IBM
> #define FTOC(x) x
>
> #else
> #ifdef G95
> #define FTOC(x) x##__
>
> #else /* default * /
> #define FTOC(x) x##_
> #endif /* G95 */
>
> #endif /* IBM */
>
> #endif /* MANGLE_NAMES_H */
>
> Alvaro
> Tomasz Plewa wrote:
>> Thanks, Georgi. I reckon the same may work for hdf5.
>>
>> Still the permanent solution is to fix the FLASH source code. It is
>> certainly doable.
>>
>> Tomek
>> --
>> On Tue, Oct 04, 2005 at 05:32:56PM +0100, Georgi Pavlovski wrote:
>>
>>> hi,
>>>
>>> I'm not sure if this is the cure, but it worth a try. While compiling
>>> mpich set the environment variable,
>>>
>>> setenv pac_cv_prog_f77_name_mangle 'lower underscore'
>>>
>>> I remember having similar problems it the past, but I used intel fortran
>>> compiler.
>>>
>>> - Georgi
>>>
>>> On Tue, 2005-10-04 at 10:06 -0500, Tomasz Plewa wrote:
>>>
>>>> Steve -
>>>>
>>>> You can disregard warnings. However, compilation process fails during
>>>> linking. Apparently, gcc/g95 combination produces object symbols with
>>>> inconsistent number of underscores. There are some folks who are
>>>> working on the workaround for this problem. (If someone has a working
>>>> solution, please let us know!)
>>>>
>>>> Tomek
>>>> --
>>>> On Tue, Oct 04, 2005 at 03:48:54PM +0100, Steve Spreckley wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am new to flash, but I have been trying to install and run the
>>>>> software
>>>>> for some time with little success. I have used g95 compilers to
>>>>> compile
>>>>> and install mpich 1.2.7 and hdf5 1.6.4, and the example code for these
>>>>> compiled and ran fine. However, when trying to compile flash 2.3 I
>>>>> get a
>>>>> number of warnings as follows:
>>>>>
>>>>> In file logfile.F90:625
>>>>>
>>>>> write (log_lun, "(X, A30, ' : ', A20)") trim(adjustl(str_array(i,
>>>>> 1
>>>>> Warning (100): X descriptor requires leading space count in format
>>>>> string
>>>>> at (1)
>>>>> In file logfile.F90:628
>>>>>
>>>>> write (log_lun, "(X, A15, 22X, A8, 2X, A9, 4X, A8, 2X, A8)") trim
>>>>> 1
>>>>> Warning (100): X descriptor requires leading space count in format
>>>>> string
>>>>> at (1)
>>>>>
>>>>>
>>>>> and then a number of lines like this for several functions:
>>>>>
>>>>>
>>>>> dBaseAPI.c: In function write_logfile:
>>>>> dBaseAPI.c:11: warning: incompatible implicit declaration of built-in
>>>>> function strlen
>>>>> dBaseAPI.c: In function stamp_logfile:
>>>>> dBaseAPI.c:16: warning: incompatible implicit declaration of built-in
>>>>> function strlen.
>>>>>
>>>>>
>>>>> The code gets past these though and kicks out more F90 warnings:
>>>>>
>>>>>
>>>>> In file checkpoint_re.F90:542
>>>>>
>>>>> write (num_to_str, '(I)') tot_blocks
>>>>> 1
>>>>> Warning (100): Nonnegative width required in format string at (1)
>>>>>
>>>>> In file checkpoint_re.F90:547
>>>>>
>>>>> write (num_to_str, '(I)') ReNumParts
>>>>> 1
>>>>> Warning (100): Nonnegative width required in format string at (1)
>>>>>
>>>>> mpif90 -c -r8 -i4 -I/home/sas/mpich-1.2.7/include -DN_DIM=2
>>>>> -DMAXBLOCKS=1000 -DNXB=8 -DNYB=8 -DNZB=1 checkpoint_wr.F90
>>>>> In file checkpoint_wr.F90:221
>>>>>
>>>>> write (num_to_str, '(I)') MAX_BLK_MSGS
>>>>> 1
>>>>> Warning (100): Nonnegative width required in format string at (1).
>>>>>
>>>>>
>>>>> I then get a number of warnings associated with hdf5:
>>>>>
>>>>>
>>>>> h5_write.c: In function h5_write_tree_info_:
>>>>> h5_write.c:943: warning: pointer targets in passing argument 3 of
>>>>> H5Sselect_hyperslab differ in signedness
>>>>> h5_write.c:1030: warning: pointer targets in passing argument 3 of
>>>>> H5Sselect_hyperslab differ in signedness
>>>>> h5_write.c:1117: warning: pointer targets in passing argument 3 of
>>>>> H5Sselect_hyperslab differ in signedness
>>>>> h5_write.c:1204: warning: pointer targets in passing argument 3 of
>>>>> H5Sselect_hyperslab differ in signedness
>>>>> h5_write.c:1230: warning: pointer targets in passing argument 3 of
>>>>> H5Sselect_hyperslab differ in signednes
>>>>>
>>>>>
>>>>> and these continue for more h5_ funtions.
>>>>>
>>>>> The code finally crashes though when linking:
>>>>>
>>>>>
>>>>> aseAPI.o(.text+0x1c): In function `write_logfile':
>>>>> dBaseAPI.c: undefined reference to `xwrite_logfile_'
>>>>> dBaseAPI.o(.text+0x44): In function `stamp_logfile':
>>>>> dBaseAPI.c: undefined reference to `xstamp_logfile_'
>>>>> dBaseAPI.o(.text+0x6f): In function `get_real_parm_from_glob_context':
>>>>> dBaseAPI.c: undefined reference to `xget_real_parm_from_glob_contex_'
>>>>> dBaseAPI.o(.text+0x9b): In function `get_int_parm_from_glob_context':
>>>>> dBaseAPI.c: undefined reference to `xget_int_parm_from_glob_context_'
>>>>> dBaseAPI.o(.text+0xd6): In function `get_str_parm_from_glob_context':
>>>>> dBaseAPI.c: undefined reference to `xget_str_parm_from_glob_context_'
>>>>> init_flash.o(.text+0x11): In function `init_flash__':
>>>>> init_flash.F90: undefined reference to `init_signal_handler__'
>>>>> driverAPI.o(.text+0x1c): In function `abort_flash':
>>>>> driverAPI.c: undefined reference to `xabort_flash_'
>>>>> checkpoint_re.o(.text+0x8fa): In function `checkpoint_filename_re__':
>>>>> checkpoint_re.F90: undefined reference to `h5_open_file_for_read__'
>>>>> checkpoint_re.o(.text+0x97e):checkpoint_re.F90: undefined reference to
>>>>> `h5_read_timers__'
>>>>> checkpoint_re.o(.text+0x9d3):checkpoint_re.F90: undefined reference to
>>>>> `h5_read_header_info__'
>>>>> checkpoint_re.o(.text+0x19e3):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `get_numparticles__'
>>>>> checkpoint_re.o(.text+0x1cf5):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `h5_read_particles__'
>>>>> checkpoint_re.o(.text+0x22a9):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `h5_read_tree_info__'
>>>>> checkpoint_re.o(.text+0x24bc):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `h5_read_grid_info__'
>>>>> checkpoint_re.o(.text+0x25fd):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `h5_read_unknowns__'
>>>>> checkpoint_re.o(.text+0x3ab3):checkpoint_re.F90: undefined
>>>>> reference to
>>>>> `h5_close_file__'
>>>>> checkpoint_wr.o(.text+0xd77): In function `checkpoint_wr__':
>>>>> checkpoint_wr.F90: undefined reference to `h5_initialize_file__'
>>>>> checkpoint_wr.o(.text+0x14f1):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_header_info__'
>>>>> checkpoint_wr.o(.text+0x1730):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_runtime_parameters__'
>>>>> checkpoint_wr.o(.text+0x299e):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_particles__'
>>>>> checkpoint_wr.o(.text+0x2a16):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_tree_info__'
>>>>> checkpoint_wr.o(.text+0x2a60):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_grid_info__'
>>>>> checkpoint_wr.o(.text+0x2b97):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_unknowns__'
>>>>> checkpoint_wr.o(.text+0x3e38):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_write_timers__'
>>>>> checkpoint_wr.o(.text+0x4022):checkpoint_wr.F90: undefined
>>>>> reference to
>>>>> `h5_close_file__'
>>>>> plotfile.o(.text+0xc6a): In function `plotfile_':
>>>>> plotfile.F90: undefined reference to `h5_initialize_file__'
>>>>> plotfile.o(.text+0x12ce):plotfile.F90: undefined reference to
>>>>> `h5_write_header_info_sp__'
>>>>> plotfile.o(.text+0x1504):plotfile.F90: undefined reference to
>>>>> `h5_write_runtime_parameters__'
>>>>> plotfile.o(.text+0x1e8f):plotfile.F90: undefined reference to
>>>>> `h5_write_tree_info_sp__'
>>>>> plotfile.o(.text+0x220c):plotfile.F90: undefined reference to
>>>>> `h5_write_grid_info_sp__'
>>>>> plotfile.o(.text+0x2be4):plotfile.F90: undefined reference to
>>>>> `h5_write_unknowns_sp__'
>>>>> plotfile.o(.text+0x2cca):plotfile.F90: undefined reference to
>>>>> `h5_write_unknowns_sp__'
>>>>> plotfile.o(.text+0x2da3):plotfile.F90: undefined reference to
>>>>> `h5_write_unknowns_sp__'
>>>>> plotfile.o(.text+0x3a78):plotfile.F90: undefined reference to
>>>>> `h5_close_file__'
>>>>> init_global_parms_checkpoint.o(.text+0x2cd): In function
>>>>> `init_global_parms_checkpoint__':
>>>>> init_global_parms_checkpoint.F90: undefined reference to
>>>>> `h5_open_file_for_read__'
>>>>> init_global_parms_checkpoint.o(.text+0x3ac):init_global_parms_checkpoint.F90:
>>>>>
>>>>> undefined reference to `h5_read_runtime_parameters__'
>>>>> init_global_parms_checkpoint.o(.text+0x3b8):init_global_parms_checkpoint.F90:
>>>>>
>>>>> undefined reference to `h5_close_file__'
>>>>> multifluidAPI.o(.text+0x1f): In function `find_fluid_index':
>>>>> multifluidAPI.c: undefined reference to `xfind_fluid_index_'
>>>>> memory_report.o(.text+0x61): In function `memory_report__':
>>>>> memory_report.F90: undefined reference to `memory_usage__'
>>>>> gmake[1]: *** [flash2] Error 1
>>>>> gmake[1]: Leaving directory
>>>>> `/home/sas/work/exoplanets/MHD/FLASH2.5/object'
>>>>> gmake: *** [default] Error 2
>>>>>
>>>>> As can be seen the majority of the problms are with the c code, and
>>>>> there
>>>>> is a correlation between the functions that cause warnings early on
>>>>> and
>>>>> the undefined reference problems later. I thought that maybe the
>>>>> problem
>>>>> could be to do with name mangling but I am not sure, and if it is I
>>>>> am not
>>>>> entirely sure how to fix the problem.
>>>>>
>>>>> Any help is greatly appreciated.
>>>>>
>>>>> Steve Spreckley
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------------
>>>>>
>>>>> Steve
>>>>> Spreckley
>>>>> Astrophysics and Space Research Group School
>>>>> of Physics and Astronomy The University
>>>>> of Birmingham Edgbaston,
>>>>> Birmingham, UK Tel: +44 (0)1214158410 B15
>>>>> 2TT E-mail: sas@star.sr.bham.ac.uk
>>>>> -----------------------------------------------------------------------
>>>>>
>>>>
>>> --
>>> ===================================================================
>>> Dr Georgi B. Pavlovski School of Physics and Astronomy
>>> Tel: +44-(0)-23-8059-2446 University of Southampton
>>> Fax: +44-(0)-23-8059-3910 Southampton SO17 1BJ, U.K.
>>> Email: gbp@phys.soton.ac.uk Web: www.astro.soton.ac.uk/~gbp
>>> ===================================================================
>>>
>>
>>
>
> !DSPAM:4342bb04210382220925225!
>
>
Received on Tue Oct 4 12:45:24 2005
This archive was generated by hypermail 2.1.8 : Thu Aug 31 2006 - 21:20:48 CDT