Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://www.sphinxsys.org/
Apache License 2.0
259 stars 199 forks source link

List out detected SIMD flags on Linux systems instead of `-march=native` #176

Closed FabienPean-Virtonomy closed 1 year ago

FabienPean-Virtonomy commented 1 year ago

Let's see if "Illegal" instructions during tests disappear

FabienPean-Virtonomy commented 1 year ago

The CI passes for Linux, but since the problem does not occur every time, we can only see over time.

Xiangyu-Hu commented 1 year ago

We can let the action job rerun several time to have a look.

Xiangyu-Hu commented 1 year ago

The CI passes for Linux, but since the problem does not occur every time, we can only see over time.

Then, which one is chosen for compiling?

FabienPean-Virtonomy commented 1 year ago

We can let the action job rerun several time to have a look.

At best, this solves the problem, at worst it does not change anything. I will run it one or two more times today to fulfill your request.

Then, which one is chosen for compiling?

The block that is deleted in this PR was overriding a variable that contained individual SIMD feature flags (-mavx2 -mfma -mavx, etc) by a simpler -march=native.

Xiangyu-Hu commented 1 year ago

We can let the action job rerun several time to have a look.

At best, this solves the problem, at worst it does not change anything. I will run it one or two more times today to fulfill your request.

Then, which one is chosen for compiling?

The block that is deleted in this PR was overriding a variable that contained individual SIMD feature flags (-mavx2 -mfma -mavx, etc) by a simpler -march=native.

As a CPU may fit several flags, which is chosen finally then?

FabienPean-Virtonomy commented 1 year ago

As a CPU may fit several flags, which is chosen finally then?

The CMake file tests for SIMD features and adds flags depending on availability. The compiler uses all instructions set provided. I edited the title to reflect more accurately what is now happening.

Though listing each individual flags is not exactly equivalent to -march=native. I will add it to the todo list.

DrChiZhang commented 1 year ago

@FabienPean-Virtonomy Without VCPKG installed gtest, I have to remove the "CONFIG" in find_package(GTest CONFIG REQUIRED) in cmake, Its OK?

FabienPean-Virtonomy commented 1 year ago

@FabienPean-Virtonomy Without VCPKG installed gtest, I have to remove the "CONFIG" in find_package(GTest CONFIG REQUIRED) in cmake, Its OK?

The goal of vcpkg is to uniformize consuming dependencies across OSs and different versions, all of this in user-space. Please do not modify the CMakeLists and use vcpkg instead. If users face problems with vcpkg, then we can look further to find a solution and adapt then. Otherwise fitting the CMakeLists for all individual possibilities/needs will end up creating the monster that existed before

DrChiZhang commented 1 year ago

@FabienPean-Virtonomy Without VCPKG installed gtest, I have to remove the "CONFIG" in find_package(GTest CONFIG REQUIRED) in cmake, Its OK?

The goal of vcpkg is to uniformize consuming dependencies across OSs and different versions, all of this in user-space. Please do not modify the CMakeLists and use vcpkg instead. If users face problems with vcpkg, then we can look further to find a solution and adapt then. Otherwise fitting the CMakeLists for all individual possibilities/needs will end up creating the monster that existed before

To be honest, I do not like the way of relying very thing on a specific package manager, resulting the total installation procedure to be a black-box. Anyway, if you all think that this is more convenient, I'm going to reserve my opinion.