Error building on Mac OS 10.9 (Mavericks)

Help
2014-01-28
2015-04-15
  • Ryan Abernathey

    Ryan Abernathey - 2014-01-28

    Hi,
    I am trying to build NCO 4.4.0 on Mac OS 10.9 (Mavericks) and am getting the following build error during make. I would sincerely appreciate any suggestions you have about how to overcome this problem.

    nco_sng_utl.c:29:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free(sng_1_c);
    

    I don't know what this error means or how to fix it. I have a feeling it is a deep compiler issue. My compiler gcc version is the following:

    $ gcc -v
    Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
    Target: x86_64-apple-darwin13.0.3
    Thread model: posixl: posix
    

    I manually built and installed HDF5 1.8.11 and NetCDF 4.3.0 in /usr/local.
    I configured NCO with ./configure --prefix=/usr/local. Here are my some of my configuration parameters:

    Configuration Parameters:
    AR_FLAGS............. cru
    CC................... gcc
    CFLAGS............... -fno-common -g -O2 -std=c99 -D_BSD_SOURCE 
    CPP.................. gcc -E
    CPPFLAGS............. -I/Users/rpa/anaconda/include 
    CXX.................. g++
    CXXFLAGS............. -g -O2
    OPENMP_CFLAGS.........
    ENABLE_DAP_NETCDF.... no
    ENABLE_DAP........... no
    ENABLE_GSL........... no
    HAVE_NETCDF4_H....... yes
    ENABLE_NETCDF4....... yes
    NETCDF4_ROOT......... 
    ENABLE_UDUNITS....... no
    ENABLE_UDUNITS2...... no
    GSL_ROOT............. 
    HAVE_ANTLR........... no
    HOST................. 
    host................. x86_64-apple-darwin13.0.3
    HOSTNAME............. 
    LDFLAGS.............. -L/Users/rpa/anaconda/lib -lnetcdf 
    LIBS................. -lnetcdf 
    install prefix ...... /usr/local
    
     
  • Charlie Zender

    Charlie Zender - 2014-01-28

    Well that's a new one :) Please try the latest CVS snapshot, where the lines that
    look like the one that caused the compiling error have all been changed to look like free((void *)sng_1_c) instead of free(sng_1_c). Let us know how this works.
    Thanks,
    cz

     
  • Ryan Abernathey

    Ryan Abernathey - 2014-01-28

    No luck. I tried to build from the latest CVS snapshot and got this error (same as the last time, but I've included the full output from the compiler):

    nco_sng_utl.c:29:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free((void *)sng_1_c);
                      ^~~~~~~~~~~~~~~~~~~~~
    nco_sng_utl.c:30:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_2_c=(char *)free((void *)sng_2_c);
                      ^~~~~~~~~~~~~~~~~~~~~
    nco_sng_utl.c:36:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free((void *)sng_1_c);
                      ^~~~~~~~~~~~~~~~~~~~~
    nco_sng_utl.c:37:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_2_c=(char *)free((void *)sng_2_c);
                      ^~~~~~~~~~~~~~~~~~~~~
    nco_sng_utl.c:43:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free((void *)sng_1_c);
                      ^~~~~~~~~~~~~~~~~~~~~
    nco_sng_utl.c:44:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_2_c=(char *)free((void *)sng_2_c);
    
     
  • Charlie Zender

    Charlie Zender - 2014-01-28

    OK, well, while this still has both our attentions, please try the latest CVS
    snapshot in which I attempt a different fix having to do with the initialization
    of sng_1_c and sng_2_c. Please report back. If this does not work I will be stuck.
    Thanks,
    cz

     
  • Ryan Abernathey

    Ryan Abernathey - 2014-01-28

    Charie, thank you so much for your quick and helpful replies. Unfortunately, using the latest CVS (updated 1 minute ago), I am still getting the errors.

    nco_sng_utl.c:32:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free(sng_1_c);
                      ^~~~~~~~~~~~~
    nco_sng_utl.c:33:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_2_c=(char *)free(sng_2_c);
                      ^~~~~~~~~~~~~
    nco_sng_utl.c:39:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free(sng_1_c);
                      ^~~~~~~~~~~~~
    nco_sng_utl.c:40:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_2_c=(char *)free(sng_2_c);
                      ^~~~~~~~~~~~~
    nco_sng_utl.c:46:23: error: operand of type 'void' where arithmetic or pointer type is required
      sng_1_c=(char *)free(sng_1_c);
                      ^~~~~~~~~~~~~
    

    Is there anyone else on the list who is successfully using NCO on Mac OS 10.9? How did you manage to get it working?
    nco_sng_utl.c:47:23: error: operand of type 'void' where arithmetic or pointer type is required
    sng_2_c=(char *)free(sng_2_c);

     
    • Pedro Vicente

      Pedro Vicente - 2014-01-29

      please give a try with the latest snapshot code, obtained with

      cvs -z3 -d:pserver:anonymous@nco.cvs.sf.net:/cvsroot/nco co -kk nco

      Pedro

       
  • Ryan Abernathey

    Ryan Abernathey - 2014-01-30

    Pedro, thanks a lot for your help! That lastest snapshop seemed to fix the pointer issue issue.

    But unfortunately now I am getting a new error. Although it is only related to the documentation, I can figure out how to overcome it. Very frustrating since I am so close!

    Making all in doc
    restore=: && backupdir=".am$$" && \
    rm -rf $backupdir && mkdir $backupdir && \
    if (/bin/sh /Users/rpa/Sources/nco/autobld/missing makeinfo --version) >/dev/null 2>&1; then \
      for f in nco.info nco.info-[0-9] nco.info-[0-9][0-9] nco.i[0-9] nco.i[0-9][0-9]; do \
        if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
      done; \
    else :; fi && \
    if /bin/sh /Users/rpa/Sources/nco/autobld/missing makeinfo   -I . \
     -o nco.info `test -f 'nco.texi' || echo './'`nco.texi; \
    then \
      rc=0; \
    else \
      rc=$?; \
      $restore $backupdir/* `echo "./nco.info" | sed 's|[^/]*$||'`; \
    fi; \
    rm -rf $backupdir; exit $rc   
    nco.texi:16885: Unknown command `textdegree'.
    nco.texi:16885: Misplaced {.
    nco.texi:16885: Misplaced }.
    nco.texi:16886: Unknown command `textdegree'.
    nco.texi:16886: Misplaced {.
    nco.texi:16886: Misplaced }.
    nco.texi:16886: Unknown command `textdegree'.
    nco.texi:16886: Misplaced {.
    nco.texi:16886: Misplaced }.
    nco.texi:16887: Unknown command `textdegree'.
    nco.texi:16887: Misplaced {.
    nco.texi:16887: Misplaced }.
    nco.texi:16888: Unknown command `textdegree'.
    nco.texi:16888: Misplaced {.
    nco.texi:16888: Misplaced }.
    nco.texi:16889: Unknown command `textdegree'.
    nco.texi:16889: Misplaced {.
    nco.texi:16889: Misplaced }.
    nco.texi:16889: Unknown command `textdegree'.
    nco.texi:16889: Misplaced {.
    nco.texi:16889: Misplaced }.
    nco.texi:16890: Unknown command `textdegree'.
    nco.texi:16890: Misplaced {.
    nco.texi:16890: Misplaced }.
    makeinfo: Removing output file `nco.info' due to errors; use --force to        preserve.
    make[2]: *** [nco.info] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    
     
  • Charlie Zender

    Charlie Zender - 2014-01-30

    you need a newer texinfo/makeinfo
    does this help

    sudo port install texinfo

     
  • Ryan Abernathey

    Ryan Abernathey - 2014-01-30

    p.s. I was able to get over this by just commenting out the doc subdir in the top-level makefile, i.e.
    #SUBDIRS = data src man doc
    SUBDIRS = data src man
    This is a hack of course, but it worked.

     
  • Jason Bacon

    Jason Bacon - 2015-04-15

    For posterity, I resolved this issue while working on a FreeBSD port. It turned out to be the version of /usr/bin/nm. This nm probably won't get newer, because the GCC license was changed in a way that impedes BSD-licensed systems from bundling anything after GCC 4.2. I'm assuming binutils went through the same license update.

    Installing the devel/binutils FreeBSD port places a newer version of nm in /usr/local/bin, which allows doc to build properly. I also had to put /usr/local/bin at the front of PATH during configure and build stages, so that it would be found and used in place of /usr/bin/nm.

    OS X also has an older version on nm in /usr/bin. I'm sure you can install a newer binutils via MacPorts, pkgsrc, or any other package manager available on Darwin.

    You might want to check the configure script to see if it's making some incorrect assumptions for older nm versions. Maybe this could be fixed so that installing a newer binutils is unnecessary.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks