Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure (unittests) on Solaris #17

Open
PHHargrove opened this issue May 4, 2016 · 10 comments
Open

Build failure (unittests) on Solaris #17

PHHargrove opened this issue May 4, 2016 · 10 comments

Comments

@PHHargrove
Copy link

On Solaris I see the errors an the bottom of the posting.
Clearly this is because something has defined isnan and isinf to their __builtin-prefixed equivalents.
That "something" is the math.h header, and there is nothing I can see to prevent that definition.

So, I think something like the following is needed:

#undef isnan
#undef isinf

but I am totally uncertain where that should be added.

Related:
Since I am using configure (not cmake) on the Solaris systems, I don't see a way to disable building the unit tests.
I do not recall at the moment why I am not using cmake, but I did install cmake-2.8.6 so there must be a reason I chose not to use it.

-Paul

llvm[2]: Compiling APFloatTest.cpp for Release+Asserts build
In file included from /export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/gtest.h:57:0,
                 from /export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:15:
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp: In member function 'virtual void {anonymous}::APFloatTest_roundToIntegral_Test::TestBody()':
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1309:15: error: '__builtin_isnan' is not a member of 'std'
   EXPECT_TRUE(std::isnan(P.convertToDouble()));
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1309:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isnan(P.convertToDouble()));
   ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1309:15: note: suggested alternative:
   EXPECT_TRUE(std::isnan(P.convertToDouble()));
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1309:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isnan(P.convertToDouble()));
   ^
<built-in>:0:0: note:   '__builtin_isnan'
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1312:15: error: '__builtin_isinf' is not a member of 'std'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() > 0.0);
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1312:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() > 0.0);
   ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1312:15: note: suggested alternative:
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() > 0.0);
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1312:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() > 0.0);
   ^
<built-in>:0:0: note:   '__builtin_isinf'
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1315:15: error: '__builtin_isinf' is not a member of 'std'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() < 0.0);
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1315:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() < 0.0);
   ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1315:15: note: suggested alternative:
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() < 0.0);
               ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:1208:34: note: in definition of macro 'GTEST_TEST_BOOLEAN_'
       ::testing::AssertionResult(expression)) \
                                  ^
/export/home/phargrov/upcnightly-32/llvm-upc/src/unittests/ADT/APFloatTest.cpp:1315:3: note: in expansion of macro 'EXPECT_TRUE'
   EXPECT_TRUE(std::isinf(P.convertToDouble()) && P.convertToDouble() < 0.0);
   ^
<built-in>:0:0: note:   '__builtin_isinf'
/usr/gnu/bin/rm: cannot remove '/export/home/phargrov/upcnightly-32/llvm-upc/bld/unittests/ADT/Release+Asserts/APFloatTest.d.tmp': No such file or directory
gmake[2]: *** [/export/home/phargrov/upcnightly-32/llvm-upc/bld/unittests/ADT/Release+Asserts/APFloatTest.o] Error 1
@swatanabe
Copy link

AMDG

On 05/04/2016 10:46 AM, Paul H. Hargrove wrote:

I do not recall at the moment why I am not using cmake, but I did install cmake-2.8.6 so there must be a reason I chose not to use it.

I don't know if this is the reason, but
cmake-2.8.6 is too old. LLVM is currently
requires 2.8.12.2.

cmake_minimum_required(VERSION 2.8.12.2)

In Christ,
Steven Watanabe

@swatanabe
Copy link

AMDG

On 05/04/2016 10:46 AM, Paul H. Hargrove wrote:

On Solaris I see the errors an the bottom of the posting.
Clearly this is because something has defined isnan and isinf to their __builtin-prefixed equivalents.
That "something" is the math.h header, and there is nothing I can see to prevent that definition.

This behavior is definitely non-conforming
in C++11.

So, I think something like the following is needed:

#undef isnan
#undef isinf

but I am totally uncertain where that should be added.

It should probably be added in the source
file. I didn't find any other uses of these
functions. However, I'm not convinced that
it will actually fix the problem. It seems
a bit unlikely for cmath to provide the correct
overloads while leaving the problematic macros
as is.

unittests/ADT/APFloatTest.cpp:1309:15: error: '__builtin_isnan' is not a member of 'std'
EXPECT_TRUE(std::isnan(P.convertToDouble()));

In Christ,
Steven Watanabe

@PHHargrove
Copy link
Author

Re: cmake
I was mistaken in my original posting.
CMake-2.8.6 is the OS default, but I built CMake-2.8.12.2.
For some reason I do not recall, I choose to use configure instead.
I am going to retry with cmake when I have a chance.

@PHHargrove
Copy link
Author

I see now that with configure I use --with-python= to set a full path to python2.7 (sys default is 2.6).
However, I couldn't determine how to do the same with CMake.
Any suggestions?

@swatanabe
Copy link

AMDG

On 05/04/2016 04:12 PM, Paul H. Hargrove wrote:

I see now that with configure I use --with-python= to set a full path to python2.7 (sys default is 2.6).
However, I couldn't determine how to do the same with CMake.
Any suggestions?

It's probably a cache variable.

In Christ,
Steven Watanabe

@swatanabe
Copy link

AMDG

On 05/04/2016 04:12 PM, Paul H. Hargrove wrote:

I see now that with configure I use --with-python= to set a full path to python2.7 (sys default is 2.6).
However, I couldn't determine how to do the same with CMake.
Any suggestions?

cmake -DPYTHON_EXECUTABLE=/path/to/python2.7

(Or you can edit CMakeCache.txt after
running cmake, which is what I usually do,
since I can never remember the variable
names.)

In Christ,
Steven Watanabe

@PHHargrove
Copy link
Author

I tried -DPYTHON_EXECUTABLE=.... on the cmake command line, but it is apparently getting ignored.

I cannot edit CMakeCache.txt after running cmake because cmake fails when it finds python 2.6.

I am trying to mess with my $PATH instead

@PHHargrove
Copy link
Author

NEVERMIND!
I had misspelled "EXECUTABLE" (dropped the "U")!

@PHHargrove
Copy link
Author

I have spent as much time as I can trying to get Solaris builds using CMake.
However both -m32 (the default) and -m64 builds fail with CMake and succeed (other than the unittests) with configure.
So, I am not going to fight that battle any longer.
If somebody else wants to, lets open a distinct issue for that and I can provide the error messages.

As for the reported issue with the failure to compile the unittests, I have not fixed it.
Rather I am currently patching the generate top-level Makefile to prevent building the "unittest" directory.
I get a compiler, but it doesn't quite work (will open a new issue shortly).

This issue remains unresolved, since I am just avoiding it.

@swatanabe
Copy link

AMDG

On 05/05/2016 10:25 AM, Paul H. Hargrove wrote:

I have spent as much time as I can trying to get Solaris builds using CMake.
However both -m32 (the default) and -m64 builds fail with CMake and succeed (other than the unittests) with configure.
So, I am not going to fight that battle any longer.

We'll need to solve it eventually, since
configure is deprecated and will be removed
in the next release.

If somebody else wants to, lets open a distinct issue for that and I can provide the error messages.

I'll look into it later. If you've gotten
configure working, it'll do for now.

In Christ,
Steven Watanabe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants