ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

Fix clang build #177

Closed sethrj closed 6 years ago

sethrj commented 6 years ago

The ADIOS master fails to compile on Apple Clang systems.

$ mpicc --version
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
jychoi-hpc commented 6 years ago

Just tried to test this on my mac but got the following error:

src/mxml/mxml-2.9/mxml-string.c:94:3: error: use of undeclared identifier 'va_list'
  va_list       ap;                     /* Pointer to additional arguments */

I am wondering if you had any similar experience.

pnorbert commented 6 years ago

I get the same error on linux with gcc, using the cmake build. The autoconf build completes fine.

sethrj commented 6 years ago

Whoops, my bad: I didn't commit my local changes to mxml-string.c because later I'd copied those includes to mxml.h. It turns out that mxml.h is not included by mxml-string.c. Pushed a fix.

sethrj commented 6 years ago

OK, I rebased on master and removed the PROJECT_BINARY_DIR include. Should be good to go.

jychoi-hpc commented 6 years ago

I got another error:

make
[  2%] Built target zfp
[  6%] Built target adiosreadf_nompi_v1
[ 11%] Built target adiosread
[ 15%] Built target adiosreadf_v1
[ 16%] Built target mxml
[ 16%] Building C object src/CMakeFiles/adios_nompi.dir/write/adios_posix.c.o
/Users/jyc/project/adios-pr177/src/write/adios_posix.c:739:34: error: no member named 'rank' in
      'struct adios_POSIX_data_struct'
                    fd->name, p->rank, strerror(errno));
                              ~  ^
/Users/jyc/project/adios-pr177/src/write/adios_posix.c:746:34: error: no member named 'rank' in
      'struct adios_POSIX_data_struct'
                    fd->name, p->rank, to_write, wrote);
                              ~  ^

Not sure if this is related. I usually do as out-of-source build:

mkdir build
cd build
cmake /dir/to/source
sethrj commented 6 years ago

@jychoi-hpc That looks like another configuration-dependent error and nothing to do with this merge: the rank member of the struct is only present if HAVE_MPI is defined, but the section of the code that's erroring lacks the #ifdef HAVE_MPI guards that the rest of that file has.

pnorbert commented 6 years ago

Thank you for the fix. It actually was not a problem with clang 8.0. It started to show up with the new version.