Menu

#256 Unable to build with g++ 7.3.0

release_4.3.x
open
nobody
None
7
2018-11-18
2018-06-21
No

With the following g++:

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.3.0-5' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Debian 7.3.0-5) 

I get the following error when compiling a file:

In file included from /usr/include/itpp/base/random_dsfmt.h:40:0,
                 from /usr/include/itpp/base/random.h:32,
                 from /usr/include/itpp/itbase.h:121,
                 from /usr/include/itpp/itsignal.h:63,
                 from /usr/include/itpp/itcomm.h:48,
                 from ofdm_test.cpp:1:
/usr/include/itpp/base/random_dsfmt.h: In static member function static void itpp::random_details::DSFMT<MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V>::do_recursion(typename itpp::random_details::DSFMT<MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V>::Context::w128_t*, typename itpp::random_details::DSFMT<MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V>::Context::w128_t*, typename itpp::random_details::DSFMT<MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V>::Context::w128_t*, typename itpp::random_details::DSFMT<MEXP, POS1, SL1, MSK1, MSK2, FIX1_V, FIX2_V, PCV1_V, PCV2_V>::Context::w128_t*) [with int MEXP = 19937; int POS1 = 117; int SL1 = 19; long unsigned int MSK1 = 4498102069230399; long unsigned int MSK2 = 4501400546508797; long unsigned int FIX1_V = 10376655713290109737; long unsigned int FIX2_V = 4291106551315987578; long unsigned int PCV1_V = 4432916062321256576; long unsigned int PCV2_V = 1]:
/usr/include/itpp/base/random_dsfmt.h:306:17: error: the last argument must be an 8-bit immediate
     __m128i y = _mm_shuffle_epi32(lung->si, SSE2_SHUFF);
                 ^

I think this may have to do with the SSE2_SHUFF being unsigned in random_dsfmt.h. Let me see if I can do some debugging.

Discussion

  • Kumar Appaiah

    Kumar Appaiah - 2018-06-21

    Replacing SSE_SHUFF with 27 solves the problem, though I don't know if that is right. This may also be connected: https://stackoverflow.com/questions/48726032/using-a-variable-to-index-a-simd-vector-with-mm256-extract-epi32-intrinsic

     

    Last edit: Kumar Appaiah 2018-06-21
    • Kumar Appaiah

      Kumar Appaiah - 2018-06-21

      Ok, so removing SSE2_SHUFF and replacing the entry with 0x1bU directly works. I will use this fix in Debian.

       
  • Ahmed Shahein

    Ahmed Shahein - 2018-11-18

    After downloading this revesion it managed to build, however, when I am not able to do the testing.

    cmake .. -DGTEST_DIR=/home/shahein/Downloads/itpp-git/gtests
    -- A library with BLAS API found.
    -- A library with BLAS API found.
    -- A library with LAPACK API found.
    -- A library with FFT API found.
    CMake Warning (dev) at cmake/Modules/CheckCXXFunctionExists.cmake:32 (IF):
      Policy CMP0054 is not set: Only interpret if() arguments as variables or
      keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    
      Quoted variables like "HAVE_STD_ISFINITE" will no longer be dereferenced
      when the policy is set to NEW.  Since the policy is not set the OLD
      behavior will be used.
    Call Stack (most recent call first):
      CMakeLists.txt:148 (CHECK_CXX_FUNCTION_EXISTS)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- BLAS vendor: All
    -- Configuring done
    CMake Error at gtests/CMakeLists.txt:32 (add_executable):
      Cannot find source file:
    
        /home/shahein/Downloads/itpp-git/gtests/src/gtest-all.cc
    
      Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
      .hxx .in .txx
    
    
    CMake Error: CMake can not determine linker language for target: itpp_gtests
    CMake Error: Cannot determine link language for target "itpp_gtests".
    -- Generating done
    -- Build files have been written to: /home/shahein/Downloads/itpp-git/build
    

    This is the message when I executed make command:

    Generating example index...
    finalizing index lists...
    writing tag file...
    Generating search index
    lookup cache used 10740/65536 hits=245414 misses=11736
    finished...
    [100%] Built target itpp_doc
    make[2]: *** No rule to make target 'gtests/CMakeFiles/itpp_gtests.dir/build'.  Stop.
    CMakeFiles/Makefile2:179: recipe for target 'gtests/CMakeFiles/itpp_gtests.dir/all' failed
    make[1]: *** [gtests/CMakeFiles/itpp_gtests.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: *** [all] Error 2
    
     
  • Bogdan Cristea

    Bogdan Cristea - 2018-11-18

    Hi
    gtest sources need to be downloaded separately in your gtests folder before you start the actual compilation.
    regards
    Bogdan

     
  • Ahmed Shahein

    Ahmed Shahein - 2018-11-18

    Could you please send me the link? I downloaded it from github but I am still getting the same error message.
    Many thanks.
    Regards.

     
  • Bogdan Cristea

    Bogdan Cristea - 2018-11-18

    Hi
    Here are the steps I have used:

    git clone ssh://<user>@git.code.sf.net/p/itpp/git itpp-git
    git clone https://github.com/google/googletest.git
    cmake .. -DGTEST_DIR=$HOME/projects/googletest/googletest
    

    Note that GTEST_DIR does not point to the sources root folder (when googletest is cloned with git) but goes one level lower where only googletest sources are.

    In order to run the tests use (from build folder)

    ./gtests/itpp_gtests
    
     
  • Ahmed Shahein

    Ahmed Shahein - 2018-11-18

    Worked smoothly.
    Thanks a lot.
    Have a great evening.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.