Skip to content

Conversation

@gkisalapl
Copy link
Contributor

@gkisalapl gkisalapl commented Oct 20, 2025

Make possible to build nntrainer in static or shared version on
Windows platform

Use following commandt for static build:

meson setup --wipe --native-file windows-native.ini builddir -Ddefault_library=static -Denable-pluggable=false -Denable-opencl=true
meson compile -C builddir

Copy link
Contributor

@djeong20 djeong20 left a comment

Choose a reason for hiding this comment

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

Overall, LGTM!
Please check the comments

install_dir: application_install_dir,
link_args: [tokenizer_path],
cpp_args: '-DPLUGGABLE'
cpp_args: cpp_args
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay to have the same naming?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's ok, it's key - value relation

option('libiomp_root', type:'string', value: './libiomp_win')

# use layers as pluggable modules
option('enable-pluggable', type: 'boolean', value: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

how about adding default_library=static and enable-pluggable=false to windows-native.ini?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could the following condition be possible?
default_library is static, and enable-pluggable is true; default_library is not static, and enable-pluggable is false.
If this is not feasible, we might need to remove the new option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

configuration in which default_library is static, and enable-pluggable is true would not work

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, we could remove this option and revise it.

cpp_args = []

if get_option('default_library') != 'static'
    cpp_args += [ '-DPLUGGABLE' ]
endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good

@gkisalapl gkisalapl force-pushed the fix_static_windows_build branch 2 times, most recently from fba2842 to 2ab7b50 Compare October 23, 2025 09:27
Make possible to build nntrainer in static or shared version on
Windows platform

**Self-evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test:   [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Grzegorz Kisala <[email protected]>
@gkisalapl gkisalapl force-pushed the fix_static_windows_build branch from 2ab7b50 to deeafc9 Compare October 23, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants