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

Xu update cmake build options for linux #833

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

xuhancn
Copy link
Contributor

@xuhancn xuhancn commented Nov 15, 2023

original build option from makefile:

gcc -DNDEBUG -DLIBXSMM_NOFORTRAN -DLIBXSMM_TARGET_ARCH=1006 -DLIBXSMM_OPENMP_SIMD -DLIBXSMM_BUILD=2 -Iinclude -I./src -msse4.2 -fPIC -Wall -O2 -fopenmp-simd -funroll-loops -ftree-vectorize -fdata-sections -ffunction-sections -fvisibility=hidden -pthread -Werror -c ./src/generator_mateltwise.c -o obj/intel64/generator_mateltwise.o

ported to cmake build:

/usr/bin/cc -DLIBXSMM_BUILD=2 -DLIBXSMM_DEFAULT_CONFIG -DLIBXSMM_NOFORTRAN -DLIBXSMM_OPENMP_SIMD -DLIBXSMM_TARGET_ARCH=1006 -DNDEBUG -I/home/xu/github/xu_libxsmm/libxsmm/include -I/home/xu/github/xu_libxsmm/libxsmm/src -fPIC -Wall -O2 -fopenmp-simd -funroll-loops -ftree-vectorize -fdata-sections -ffunction-sections -fvisibility=hidden -pthread -Werror -MD -MT CMakeFiles/xsmm.dir/src/generator_mateltwise.c.o -MF CMakeFiles/xsmm.dir/src/generator_mateltwise.c.o.d -o CMakeFiles/xsmm.dir/src/generator_mateltwise.c.o -c /home/xu/github/xu_libxsmm/libxsmm/src/generator_mateltwise.c

@xuhancn xuhancn marked this pull request as draft November 15, 2023 05:43
@xuhancn xuhancn marked this pull request as ready for review November 15, 2023 05:49
@xuhancn
Copy link
Contributor Author

xuhancn commented Nov 15, 2023

@alheinecke please review it.

Copy link
Collaborator

@alheinecke alheinecke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the changes are based on "make reaclean && make" on some system and then options are copied over. However, the actual logic in Makefile and Makefile.inc needs to be ported over.


add_definitions(-DLIBXSMM_DEFAULT_CONFIG -U_DEBUG)
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flags (incl. arch SSE4, AVX, etc.) should be read from parameters as in case of using make, default should be sse4.2. Same is for options like PEDANTIC, OMP, SIMD, etc.


add_definitions(-DLIBXSMM_DEFAULT_CONFIG)
add_definitions(-DNDEBUG)
add_definitions(-DLIBXSMM_NOFORTRAN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as compiler knobs, these defines need to be discovered by the build system and not just set.

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

Successfully merging this pull request may close these issues.

None yet

2 participants