Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

made changes required for acados to run on windows#1499

Open
NiharikaSabhlok wants to merge 1 commit intoacados:mainfrom
NiharikaSabhlok:acados_for_windows
Open

made changes required for acados to run on windows#1499
NiharikaSabhlok wants to merge 1 commit intoacados:mainfrom
NiharikaSabhlok:acados_for_windows

Conversation

@NiharikaSabhlok
Copy link

No description provided.

Copy link
Member

@FreyJo FreyJo left a comment

Choose a reason for hiding this comment

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

Thanks for opening the PR and great that you made it work on your system!
I went through the changes and left a few comments.

- use the `Developer Command Prompt for VS`, navigate to `<acados_root_folder>/build` and run
```
cmake -G "Visual Studio 15 2017 Win64" -DBLASFEO_TARGET=GENERIC -DACADOS_INSTALL_DIR=.. -DBUILD_SHARED_LIBS=OFF ..
cmake -G "Visual Studio 17 2022" -DBLASFEO_TARGET=GENERIC -DACADOS_INSTALL_DIR=.. -DBUILD_SHARED_LIBS=OFF ..
Copy link
Member

Choose a reason for hiding this comment

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

Could you rather add the new command as a comment, such that the other tested variant is still present?


import sys
sys.path.insert(0, '../common')
import os
Copy link
Member

Choose a reason for hiding this comment

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

This makes the example fail.
Maybe this should be done instead?

import os

common_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'common'))
if common_path not in sys.path:
    sys.path.insert(0, common_path)

main(build=True, generate=False, use_cmake=True)
# test cython wrapper
main(build=True, generate=True, use_cmake=False, use_cython=True)
# main(build=True, generate=True, use_cmake=True, use_cython=True)
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to not change this example to keep testing the cython wrapper.

# Automatically use CMakeBuilder on Windows if not provided
if cmake_builder is None:
cmake_builder = CMakeBuilder() # use default options
cmake_builder.exec(code_export_dir, verbose)
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually make it work?
I think there should also be a cmake_builder in generate.
The changes done in the integrator and the OCP solver should be analogous to each other.

# Generate the command string for handling the build.
def get_cmd2_build(self):
import multiprocessing
cmd = f'cmake --build "{self._build_dir}" --config Release -j{multiprocessing.cpu_count()}'
Copy link
Member

Choose a reason for hiding this comment

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

Did the cpu_count fail for you? The import multiprocessing is still there, so I guess that works.

"""Defines the generator, options can be found via `cmake --help` under 'Generator'. Type: string. Linux default 'Unix Makefiles', Windows 'Visual Studio 15 2017 Win64'; default value: `None`."""
# set something for Windows
if os.name == 'nt':
self.generator = 'Visual Studio 15 2017 Win64'
Copy link
Member

Choose a reason for hiding this comment

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

I guess we should make this an option. Like cmake_generator?

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.

2 participants