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

Mac OS X - build error #111

Closed tmarrinan closed 7 years ago

tmarrinan commented 7 years ago

Hello. I am getting an error attempting to build ADIOS on Mac OS X. I have CMake, MPI, and Python installed. After cloning the repo, I can use CMake to generate a Makefile, but when I type 'make', I get the following error:

In file included from <path>/ADIOS/src/core/adios_clock.c:12:
<path>/ADIOS/src/core/adios_clock.h:16:17: error: typedef redefinition with
      different types ('int' vs 'enum clockid_t')
    typedef int clockid_t;
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:171:3: note: 
      previous definition is here
} clockid_t;
  ^
1 error generated.
pnorbert commented 7 years ago

Hi, What compiler did you set to CC before running cmake? I have CC=mpicc and it will use the /usr/include/time.h, which does not have this type defined in it. Your compiler is accessing the header in Xcode. Nevertheless this is a bug since the cmake configuration does not check for the existence of this type as the autoconf build does.

On Wed, Jan 18, 2017 at 11:50 AM, Thomas Marrinan notifications@github.com wrote:

Hello. I am getting an error attempting to build ADIOS on Mac OS X. I have CMake, MPI, and Python installed. After cloning the repo, I can use CMake to generate a Makefile, but when I type 'make', I get the following error:

In file included from /ADIOS/src/core/adios_clock.c:12:

/ADIOS/src/core/adios_clock.h:16:17: error: typedef redefinition with different types ('int' vs 'enum clockid_t') typedef int clockid_t; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:171:3: note: previous definition is here } clockid_t; ^ 1 error generated. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
tmarrinan commented 7 years ago

I changed CMAKE_CXX_COMPILER to /usr/local/bin/mpic++ and CMAKE_C_COMPILER to /usr/local/bin/mpicc in the CMake GUI before generating the Makefile. Is there anything else needed to set CC to mpicc or CXX to mpic++?

pnorbert commented 7 years ago

I pushed a fix. Please try it again.

On Wed, Jan 18, 2017 at 1:21 PM, Thomas Marrinan notifications@github.com wrote:

I changed CMAKE_CXX_COMPILER to /usr/local/bin/mpic++ and CMAKE_C_COMPILER to /usr/local/bin/mpicc in the CMake GUI before generating the Makefile. Is there anything else needed to set CC to mpicc or CXX to mpic++?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273557045, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLeOj43kN8JwStOvggE_pTrkyCVRyks5rTlgigaJpZM4LnHtv .

tmarrinan commented 7 years ago

I am still getting the same error. If it matters, there is no file /usr/include/time.h on my machine. I am using MPICH version 3.2, installed via homebrew.

pnorbert commented 7 years ago

What is the value in config.h after running cmake for

/ Define to 1 if the system has the type `clockid_t'. /

define HAVE_CLOCKID_T 1

On Wed, Jan 18, 2017 at 3:27 PM, Thomas Marrinan notifications@github.com wrote:

I am still getting the same error. If it matters, there is no file /usr/include/time.h on my machine. I am using MPICH version 3.2, installed via homebrew.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273591879, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLbKC8md-sJQpcVcsoZ1oxfcPP25Bks5rTnXFgaJpZM4LnHtv .

tmarrinan commented 7 years ago

It is commented out: / Define to 1 if the system has the type `clockid_t'. / / #undef HAVE_CLOCKID_T /

pnorbert commented 7 years ago

So cmake does not find this type when looking for it, but the compiler will complain when we define it in ADIOS. I cannot replicate your problem and don't know what is wrong with my fix that works both on my Mac (I have /usr/include/time.h without this type) and Linux (which has this type). Can you build ADIOS with its autoconf build?

On Wed, Jan 18, 2017 at 3:34 PM, Thomas Marrinan notifications@github.com wrote:

It is commented out: / Define to 1 if the system has the type `clockid_t'. / / #undef HAVE_CLOCKID_T /

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273593582, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLfaZBZdTDARR64iW_moEU8J4sJeVks5rTndegaJpZM4LnHtv .

tmarrinan commented 7 years ago

Looking at the User Manual, I should be able to do: ../configure -prefix=<install-dir>

However, there is no configure file, so that command fails.

If I try to execute runconf, I get the following:

Could not determine what machine is this.
This script is for configuring adios on the authors' machines.
You can study it to figure out how to configure adios on your system.

Looking at the script, I'm not sure how to edit it.

pnorbert commented 7 years ago

./autogen.sh first, then configure. runconf is a collection of setups for many machines. you can add a section for your own machine if you don't want to manually configure it.

On Wed, Jan 18, 2017 at 3:59 PM, Thomas Marrinan notifications@github.com wrote:

Looking at the User Manual, I should be able to do: ../configure -prefix=

However, there is no configure file, so that command fails.

If I try to execute runconf, I get the following:

Could not determine what machine is this. This script is for configuring adios on the authors' machines. You can study it to figure out how to configure adios on your system.

Looking at the script, I'm not sure how to edit it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273600004, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLUcPG43oAIbTmO5IzOxFAXm4sk-pks5rTn04gaJpZM4LnHtv .

tmarrinan commented 7 years ago

When running ./autogen.sh, I get the following:

./autogen.sh: line 2: aclocal: command not found
./autogen.sh: line 3: libtoolize: command not found
./autogen.sh: line 4: autoconf: command not found
./autogen.sh: line 5: autoheader: command not found
./autogen.sh: line 6: automake: command not found
pnorbert commented 7 years ago

homebrew install automake autoconf

On Wed, Jan 18, 2017 at 4:08 PM, Thomas Marrinan notifications@github.com wrote:

When running ./autogen.sh, I get the following:

./autogen.sh: line 2: aclocal: command not found ./autogen.sh: line 3: libtoolize: command not found ./autogen.sh: line 4: autoconf: command not found ./autogen.sh: line 5: autoheader: command not found ./autogen.sh: line 6: automake: command not found

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273602305, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLdpEJN-oeB9PnGfHTlkWapQdrqQ5ks5rTn9YgaJpZM4LnHtv .

tmarrinan commented 7 years ago

libtoolize does not work on Mac OS X - it is glibtoolize instead (libtool conflicts with native utility). I modified the autogen.sh, then it ran successfully (configure, build, and install).

pnorbert commented 7 years ago

sorry I forgot about that piece of detail

On Wed, Jan 18, 2017 at 4:21 PM, Thomas Marrinan notifications@github.com wrote:

libtoolize does not work on Mac OS X - it is glibtoolize instead (libtool conflicts with native utility). I modified the autogen.sh, then it ran successfully (configure, build, and install).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273605467, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLYidySxY5gaZ1OVf853kcQ8l-wYCks5rToJngaJpZM4LnHtv .

tmarrinan commented 7 years ago

No problem - thanks for the help with the install!

pnorbert commented 7 years ago

Welcome. I did not find a mac around here that has no /usr/include/time.h so I don't know how to proceed testing the cmake build.

On Wed, Jan 18, 2017 at 4:30 PM, Thomas Marrinan notifications@github.com wrote:

No problem - thanks for the help with the install!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/111#issuecomment-273607790, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLW-pl3hR1bz0wwc9PqCQr05XRAEKks5rToSGgaJpZM4LnHtv .