[nmag-users] Nmag compile error with recent versions of gcc, and solution

844 views
Skip to first unread message

Fangohr H.

unread,
Aug 2, 2014, 4:22:00 PM8/2/14
to nmag-users, Fangohr H.
Dear all,

when using recent versions of gcc, for example, 4.8.2, the compile reports an error when processing the h5diff.c file from the hdf5-1.8.7 sources that come with the nmag all-in-one installation tar ball.

The error looks like the output attached at the end of this message.

The fix for this is to edit nmag-0.2.1/hdf5/tools/lib/h5diff.c and to change line 638 from

//int i1, i2;

to

/*int i1, i2;*/

The compilation should then proceed without errors (just type ‘make’ again).

This is required, for example, to compile nmag-0.2.1 on Ubuntu 14.04.

Best wishes,

Hans



——————————

Here are beginning and end of the error message relating to the problem described above:

$nmag-0.2.1> make
Checking dependencies...
Debian-like system: checking multiarch settings...
Checking required executables...
Preliminary checks were successfully completed.
cd ocaml && make world.opt && cd ..
make[1]: Entering directory `/tmp/nmag-0.2.1/ocaml'
make coldstart
make[2]: Entering directory `/tmp/nmag-0.2.1/ocaml'
cd byterun; make all
make[3]: Entering directory `/tmp/nmag-0.2.1/ocaml/byterun'
gcc -DCAML_NAME_SPACE -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o interp.o interp.c
ar rc libcamlrun.a interp.o misc.o stacks.o fix_code.o startup.o freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o globroots.o fail.o signals.o signals_byt.o printexc.o backtrace.o compare.o ints.o floats.o str.o array.o io.o extern.o intern.o hash.o sys.o meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o lexing.o callback.o debugger.o weak.o compact.o finalise.o custom.o dynlink.o unix.o main.o
ranlib libcamlrun.a

<snip>

tar xjvf pkgs/hdf5-1.8.7.tar.bz2
hdf5-1.8.7/Makefile
hdf5-1.8.7/ACKNOWLEDGMENTS
hdf5-1.8.7/COPYING
hdf5-1.8.7/MANIFEST
hdf5-1.8.7/Makefile.dist
hdf5-1.8.7/Makefile.am
hdf5-1.8.7/Makefile.in
hdf5-1.8.7/README.txt
hdf5-1.8.7/aclocal.m4
hdf5-1.8.7/acsite.m4
hdf5-1.8.7/configure
hdf5-1.8.7/configure.in
hdf5-1.8.7/bin/COPYING
hdf5-1.8.7/bin/buildhdf5
hdf5-1.8.7/bin/chkmanifest
hdf5-1.8.7/bin/compile
hdf5-1.8.7/bin/config.guess
hdf5-1.8.7/bin/config.sub
hdf5-1.8.7/bin/dependencies
hdf5-1.8.7/bin/depcomp
hdf5-1.8.7/bin/deploy
hdf5-1.8.7/bin/distdep
hdf5-1.8.7/bin/h5vers
hdf5-1.8.7/bin/install-sh
hdf5-1.8.7/bin/iostats
hdf5-1.8.7/bin/locate_sw
hdf5-1.8.7/bin/ltmain.sh
hdf5-1.8.7/bin/make_err
hdf5-1.8.7/bin/make_overflow
hdf5-1.8.7/bin/make_vers
hdf5-1.8.7/bin/makehelp
hdf5-1.8.7/bin/missing
hdf5-1.8.7/bin/mkdirs
hdf5-1.8.7/bin/mkinstalldirs
hdf5-1.8.7/bin/newer
hdf5-1.8.7/bin/release
hdf5-1.8.7/bin/snapshot
hdf5-1.8.7/bin/trace
hdf5-1.8.7/bin/yodconfigure
hdf5-1.8.7/config/COPYING
hdf5-1.8.7/config/BlankForm
hdf5-1.8.7/config/apple
hdf5-1.8.7/config/commence.am
hdf5-1.8.7/config/conclude.am
hdf5-1.8.7/config/craynv
hdf5-1.8.7/config/dec-flags
hdf5-1.8.7/config/examples.am
hdf5-1.8.7/config/freebsd
hdf5-1.8.7/config/gnu-fflags
hdf5-1.8.7/config/gnu-flags
hdf5-1.8.7/config/hpux11.23
hdf5-1.8.7/config/i386-pc-cygwin32
hdf5-1.8.7/config/i686-pc-cygwin
hdf5-1.8.7/config/ia64-linux-gnu
hdf5-1.8.7/config/ibm-aix
hdf5-1.8.7/config/ibm-flags
hdf5-1.8.7/config/intel-fflags
hdf5-1.8.7/config/intel-flags
hdf5-1.8.7/config/irix6.x
hdf5-1.8.7/config/linux-gnu
hdf5-1.8.7/config/linux-gnuaout
hdf5-1.8.7/config/linux-gnulibc1
hdf5-1.8.7/config/linux-gnulibc2
hdf5-1.8.7/config/lt_vers.am
hdf5-1.8.7/config/mpich
hdf5-1.8.7/config/nec-superux14.1
hdf5-1.8.7/config/Makefile.am.blank
hdf5-1.8.7/config/pgi-fflags
hdf5-1.8.7/config/pgi-flags
hdf5-1.8.7/config/powerpc-ibm-aix5.x
hdf5-1.8.7/config/solaris2.x
hdf5-1.8.7/config/sv1-cray
hdf5-1.8.7/config/x86_64-redstorm-linux-gnu
hdf5-1.8.7/config/site-specific/BlankForm
hdf5-1.8.7/examples/Attributes.txt

<snip>

h5diff.c:2062:9: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
HDfree(linkinfo2.trg_path);
^
In file included from h5diff.c:16:0:
/usr/include/stdlib.h:483:13: note: expected 'void *' but argument is of type 'const char *'
extern void free (void *__ptr) __THROW;
^
h5diff.c:2103:9: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
HDfree(linkinfo1.trg_path);
^
In file included from h5diff.c:16:0:
/usr/include/stdlib.h:483:13: note: expected 'void *' but argument is of type 'const char *'
extern void free (void *__ptr) __THROW;
^
h5diff.c:2105:9: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
HDfree(linkinfo2.trg_path);
^
In file included from h5diff.c:16:0:
/usr/include/stdlib.h:483:13: note: expected 'void *' but argument is of type 'const char *'
extern void free (void *__ptr) __THROW;
^
make[3]: *** [h5diff.lo] Error 1
make[3]: Leaving directory `/tmp/nmag-0.2.1/hdf5/tools/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/nmag-0.2.1/hdf5/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nmag-0.2.1/hdf5'
make: *** [.deps_hdf5_build] Error 2




Reply all
Reply to author
Forward
0 new messages