[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #LMQ-446031]: netcdf-4.0: cross-compilation



> Hi Ed,
>
> > I would very much welcome some help from a user skilled in
> > cross-compilation for their platform. Anyone who would like to try a
> > cross-compile should send me any problems within the next week or so,
> > so that fixes can get into the upcoming 4.0.1 release. I will be
> > happy to work with you to get it working.
>
> now I'll take you at your words... ;-)

Wonderful!

BTW I just sent an empty reply by accident, so please ignore it.


>
> Is there an alternative way method to provide the test results
> so that proper configuration files are generated?

Yes, use the --disable-fortran-type-check. (You also want to use
--disable-fortran-compiler-check.) Then adjust the values in config.h. The
defaults are set in configure.ac:

      AC_DEFINE(NCBYTE_T, byte)
      AC_DEFINE(NCSHORT_T, integer*2)
      AC_DEFINE(NF_INT1_T, byte)
      AC_DEFINE(NF_INT2_T, integer*2)
      AC_DEFINE(NF_INT1_IS_C_SIGNED_CHAR, 1, [default])
      AC_DEFINE(NF_INT2_IS_C_SHORT, 1, [default])
      AC_DEFINE(NF_INT_IS_C_INT, 1, [default])
      AC_DEFINE(NF_REAL_IS_C_FLOAT, 1, [default])
      AC_DEFINE(NF_DOUBLEPRECISION_IS_C_DOUBLE, 1, [default])


>
> Running configure on the target machine works, but then one
> should also compile on the target machine, since some settings
> might not be compatible on both machines.
> (Although paths can be faked via symlinks, which I did for [ng]awk).
>
> Even after these tricks, the cross-compile stops here:
>
> make[2]: Entering directory
> `/e/uhome/hanlauf/src/packages/netcdf-4/netcdf-4.0-snapshot2008100802/ncdump'
> ../ncgen/ncgen -c -o ctest0.nc ./../ncgen/c0.cdl > ./ctest.c
> /bin/ksh: ../ncgen/ncgen: cannot execute [Exec format error]
> make[2]: *** [ctest.c] Error 126
>
> Regenerating the file ctest.c is not possible during cross-compile.
> Maybe one should keep a reference of ctest.c for these cases,
> and just compare the result of the above ncgen command with
> the reference during a "native build".
>

If there is a way in the configure file to detect that a cross-compile is
taking place I can turn off that test in those cases.

Do you know of such a way?

Does "make all" work for you?

Thanks,

Ed

Ticket Details
===================
Ticket ID: LMQ-446031
Department: Support netCDF
Priority: Normal
Status: Closed