Skip to content

Compiler Error: target specific option mismatch #31

@Dabendorf

Description

@Dabendorf

When compiling on Linux, I get the following errors:

In file included from /usr/lib64/gcc/x86_64-suse-linux/7/include/immintrin.h:79:0,
                 from /usr/lib64/gcc/x86_64-suse-linux/7/include/x86intrin.h:48,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex_base.h:28,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex.h:38,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_alex.h:6,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_main.cpp:7:
/usr/lib64/gcc/x86_64-suse-linux/7/include/lzcntintrin.h:64:1: error: inlining failed in call to always_inline ‘long long unsigned int _lzcnt_u64(long long unsigned int)’: target specific option mismatch
 _lzcnt_u64 (unsigned long long __X)
 ^~~~~~~~~~
In file included from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex_fanout_tree.h:13:0,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex.h:39,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_alex.h:6,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_main.cpp:7:
/vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex_nodes.h:2062:56: note: called from here
             bit_pos - (63 - static_cast<int>(_lzcnt_u64(bitmap_left_gaps)));
                                              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/lib64/gcc/x86_64-suse-linux/7/include/immintrin.h:79:0,
                 from /usr/lib64/gcc/x86_64-suse-linux/7/include/x86intrin.h:48,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex_base.h:28,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/src/core/alex.h:38,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_alex.h:6,
                 from /vol/fob-vol4/nebenf17/schraluk/Masterarbeit/ALEX/test/unittest_main.cpp:7:
/usr/lib64/gcc/x86_64-suse-linux/7/include/lzcntintrin.h:64:1: error: inlining failed in call to always_inline ‘long long unsigned int _lzcnt_u64(long long unsigned int)’: target specific option mismatch
 _lzcnt_u64 (unsigned long long __X)

This is in fact the same as stated in that issue here: #13

The problem is, the flags named in the solution are already in the CMakeLists.txt file, so I cant add them to solve the issue?
Or am I doing something wrong?

cmake_minimum_required(VERSION 3.12)
project(alex)

set(CMAKE_CXX_STANDARD 14)

# Define the macro ‘DEBUG' in the debug mode
if(CMAKE_BUILD_TYPE STREQUAL Debug)        
    ADD_DEFINITIONS(-DDEBUG)               
endif()

if(MSVC)
    set(CMAKE_CXX_FLAGS "/O2 /arch:AVX2 /W1 /EHsc")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
    set(CMAKE_CXX_FLAGS "-O3 -xHost")
else()
    # clang and gcc
    set(CMAKE_CXX_FLAGS "-O3 -march=native -Wall -Wextra")
endif()

include_directories(src/core)

add_executable(example src/examples/main.cpp)
add_executable(benchmark src/benchmark/main.cpp)

set(DOCTEST_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/doctest)
file(DOWNLOAD
    https://raw.githubusercontent.com/onqtam/doctest/2.4.6/doctest/doctest.h
    ${DOCTEST_DOWNLOAD_DIR}/doctest.h
    EXPECTED_HASH SHA1=40728d2bed7f074e80cb095844820114e7d16ce0
)

add_executable(test_alex test/unittest_main.cpp)
target_include_directories(test_alex PRIVATE ${DOCTEST_DOWNLOAD_DIR})

enable_testing()
add_test(test_alex test_alex)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions