Compilation error when including Blaze

Issue #125 wontfix
Adel Ahmadyan created an issue

I'm very new to blaze. I installed and then tried to compile one of blaze's tests but I got a compilation error:

$ g++ DenseTest.cpp -std=c++14 -I/usr/local/include/blaze/ In file included from DenseTest.cpp:42: In file included from /usr/local/include/blaze/math/DiagonalMatrix.h:44: In file included from /usr/local/include/blaze/math/adaptors/DiagonalMatrix.h:45: In file included from /usr/local/include/blaze/math/adaptors/diagonalmatrix/Dense.h:46: In file included from /usr/local/include/blaze/math/adaptors/diagonalmatrix/DiagonalProxy.h:52: In file included from /usr/local/include/blaze/math/proxy/Proxy.h:46: In file included from /usr/local/include/blaze/math/proxy/ComplexProxy.h:47: In file included from /usr/local/include/blaze/util/constraints/Complex.h:43: In file included from /usr/local/include/blaze/util/typetraits/IsComplex.h:43: In file included from /usr/local/include/blaze/util/Complex.h:43: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:246: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:301: In file included from ../../../../blaze/math.h:46: In file included from /usr/local/include/blaze/math/BLAS.h:43: In file included from /usr/local/include/blaze/math/blas/axpy.h:44: In file included from /usr/local/include/blaze/math/constraints/BLASCompatible.h:43: In file included from /usr/local/include/blaze/math/typetraits/IsBLASCompatible.h:45: /usr/local/include/blaze/util/typetraits/IsComplexDouble.h:86:25: error: use of undeclared identifier 'complex' struct IsComplexDouble< complex<double> > ^ /usr/local/include/blaze/util/typetraits/IsComplexDouble.h:86:39: error: expected '(' for function-style cast or type construction struct IsComplexDouble< complex<double> > ~~^ /usr/local/include/blaze/util/typetraits/IsComplexDouble.h:97:31: error: unknown type name 'complex' struct IsComplexDouble< const complex<double> > ^ /usr/local/include/blaze/util/typetraits/IsComplexDouble.h:108:34: error: unknown type name 'complex' struct IsComplexDouble< volatile complex<double> > ^ /usr/local/include/blaze/util/typetraits/IsComplexDouble.h:119:40: error: unknown type name 'complex'

... tons of similar errors, including INFINITY, NAN, etc ...

file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:246: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:301: In file included from ../../../../blaze/math.h:43: /usr/local/include/blaze/math/Accuracy.h:845:29: error: no member named 'accuracy' in 'blaze::Limits<long>' return lhs <= Limits<T>::accuracy(); ~~~^ fatal error: too many errors emitted, stopping now [-ferror-limit=] clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg: Error generating preprocessed source(s).

Blaze was configured and installed with cmake/sudo make install.

Here is my g++ version: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I used blaze-3.2.

Comments (5)

  1. Klaus Iglberger

    Hi Adel!

    This seems to be a configuration problem, not a bug. Let's try to find the problem.

    In order to compile the Blaze tests in the blaze/blazetest directory, you should use the configure script in the same directory. Just fill in the Configfile and use

    ./configure
    

    This will generate a Makefile. You can use it by calling

    make
    

    which will trigger the build of all tests. If this doesn't work, something in your configuration is unfortunately broken.

    As a second test you can create a new file (let's call it Test.cpp) containing only the following lines of code:

    #include <blaze/Blaze.h>
    
    int main()
    {}
    

    This should compile cleanly with the following command line:

    g++ -std=c++14 Test.cpp -o Test -I/usr/local/include/blaze/
    

    If this doesn't work, it's another indication that your configuration is not working properly.

    In case you get errors, try to install a different compiler or a fresh install of Xcode.

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Hi Adel!

    We have tried to reproduce the problem and tried to built all available DenseTest.cpp with Apple LLVM version 8.1.0 (clang-802.0.42) (the same compiler as you have). We are using the following command line (note that we have to provide both the directory for the library headers and the directory for the tests as include directories and additionally link the OpenBLAS library for BLAS and LAPACK functionality):

    g++ DenseTest.cpp -std=c++14 -I/usr/local/include/blaze -I/usr/local/include/blaze/blazetest -L/opt/local/lib -lopenblas
    

    With this all tests compile cleanly, i.e. we cannot reproduce the problem.

    From your error message we see that the complex class from the C++ standard library seems to be unavailable (e.g. error: use of undeclared identifier 'complex' struct IsComplexDouble< complex<double> >). We suspect that this really is a configuration problem. Could you please try to install and use a different compiler (clang++, g++ or Intel icpc)?

    Best regards,

    Klaus!

  3. Adel Ahmadyan reporter

    Hi Klaus, Thank you for the quick and thorough reply.

    I can't change the compiler on my work machine, however, I will try to reproduce the problem on my personal computer tonight.

    Best regards, Adel

  4. Adel Ahmadyan reporter

    Hi Klaus, I tested blaze on my personal computer with the same setup and it is working as expected. Apple LLVM version 8.1.0 (clang-802.0.42). Is there any thing I can do to help debug blaze on the my first (production) machine? Thanks Adel

  5. Klaus Iglberger

    Hi Adel!

    Thanks a lot for the feedback and thanks for your offer to debug Blaze.

    As the error message indicates Xcode doesn't find some symbols from the C++ standard library (std::complex). The only time we experienced this kind of problem was with an Intel compiler, which was using an out-of-date standard library from the GNU compiler. We expect that you have a similar issue on your production machine. We recommend to reinstall Xcode or to try another compiler.

    As this doesn't seem to be a problem of the Blaze library there is nothing to debug in this case. Therefore we close this issue as "won't fix". However, we of course appreciate all kinds of constructive feedback.

    Thanks for raising this issue and welcome to Blaze,

    Best regards,

    Klaus!

  6. Log in to comment