hpipm icon indicating copy to clipboard operation
hpipm copied to clipboard

Issue on cmake inferface for MATLAB on windows

Open FabianPeitzmeier opened this issue 3 years ago • 6 comments

Hi guys, I was just trying to do step 4 from your instruction to get HPIPM for MATLAB on Windows. Step 3 worked just fine, but the next one gave me a multiple fatal errors (C1083), when I was calling "cmake --build ." It seems like "blasfeo_target.h" cannot be found, but I dont know why ... Do you have any idea to fix this?

FabianPeitzmeier avatar Apr 21 '21 14:04 FabianPeitzmeier

What does "cmake -LA .." say where it expects blasfeo to be? You can specify the location explicitely (I use msys2, the syntax for specifying the path probably is C:\ in PowerShell): cmake -DCMAKE_INSTALL_PREFIX=./install -DBLASFEO_PATH=/c/blasfeo -DBLASFEO_INCLUDE_DIR=/c/blasfeo/include -DHPIPM_TESTING=OFF .. cmake --build . --target install

githubNu avatar Apr 27 '21 20:04 githubNu

Hi @FabianPeitzmeier, did you do all parts of step 3, including “Copy blasfeo.lib from build/Debug/ to lib/”?

lenvm avatar Jun 09 '21 22:06 lenvm

I have the same problem and did the copy/paste part. The "cmake -LA .." command shows the text below. I think the last line could be the cause but how to fix it?

C:\Users\yanni\Work\DifferentQPSOlverMPC\HPIPM\hpipm-master\build>cmake -LA ..
CMake Deprecation Warning at CMakeLists.txt:36 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- Using BLASFEO path: /c/Users/yanni/blasfeo
-- Installation directory: /opt/hpipm
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/yanni/Work/DifferentQPSOlverMPC/HPIPM/hpipm-master
-- Cache values
BLASFEO_INCLUDE_DIR:STRING=/c/Users/yanni/blasfeo/include
BLASFEO_PATH:STRING=/c/Users/yanni/blasfeo
BUILD_SHARED_LIBS:STRING=OFF
CMAKE_AR:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/lib.exe
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3
CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_INSTALL_PREFIX:STRING=/opt/hpipm
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/link.exe
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_MT:FILEPATH=CMAKE_MT-NOTFOUND
CMAKE_RC_COMPILER:FILEPATH=rc
CMAKE_RC_FLAGS:STRING=-DWIN32
CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
CMAKE_RC_FLAGS_RELEASE:STRING=
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
HPIPM_BLASFEO_LIB:STRING=Static
HPIPM_HEADERS_INSTALLATION_DIRECTORY:STRING=include
HPIPM_TESTING:BOOL=OFF
REF_BLAS:STRING=0
TARGET:STRING=AVX
USE_C99_MATH:STRING=ON
blasfeo_DIR:PATH=blasfeo_DIR-NOTFOUND

yannik12 avatar Dec 22 '21 14:12 yannik12

Hi guys, I was just trying to do step 4 from your instruction to get HPIPM for MATLAB on Windows. Step 3 worked just fine, but the next one gave me a multiple fatal errors (C1083), when I was calling "cmake --build ." It seems like "blasfeo_target.h" cannot be found, but I dont know why ... Do you have any idea to fix this?

Hi @FabianPeitzmeier, when getting HPIPM for MATLAB, I also encountered the same problem in Step 4, and the prompt did not find "blasfeo_target.h", etc. I tried to put some" .h files" in BLASFEO added to the HPIPM project, but it still says "sys/time.h" cannot be found. Due to these problems, the "hpipm.lib" file was not generated at step 4. I'm curious what is the reason that "hpipm.lib" is not generated and looking forward to working with you to solve this problem. It would be a great honor if you can provide us with a solution @giaf

5Sunflower10 avatar Mar 08 '23 11:03 5Sunflower10

When I did the step 4, the powershell gave the message

-- Using BLASFEO path: /opt/blasfeo
-- Installation directory: /opt/hpipm

which is not the correct address in my computer, do you know how to solve it ? @giaf

rogueyan5 avatar Apr 11 '23 01:04 rogueyan5

@rogueyan5 as suggested in some posts above, try setting BLASFEO_PATH in HPIPM cmake to the actual value on your machine. The default installation location in /opt/ is the default location for linux machines. See the more detailed answer here https://github.com/giaf/hpipm/discussions/129

@5Sunflower10 same in your case, you should not copy header files between projects, but give to HPIPM cmake the correct installation directory for BLASFEO. With this, the library hpipm.lib will be correctly generated. About the sys/time.h not found, this only affects the test problems outside the library, and it will be fixed soon using some more portable timing mechanism.

giaf avatar May 23 '23 12:05 giaf