Skip to content

Commit

Permalink
version compatible with osx M1
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertolazzi committed Mar 21, 2023
1 parent e6db3c0 commit 85151db
Show file tree
Hide file tree
Showing 26 changed files with 123 additions and 81 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
*.mw
*.DS_Store
.vscode
*.dylib
*.mex*
IPOPT-toolbox.mltbx
/doc
/coinbrew

/toolbox/build
5 changes: 4 additions & 1 deletion IPOPT-toolbox.prj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param.summary>Toolbox for MATLAB interfacing with IPOPT</param.summary>
<param.description>Toolbox for MATLAB interfacing with IPOPT</param.description>
<param.screenshot>${PROJECT_ROOT}/toolbox/screenshot.png</param.screenshot>
<param.version>1.1.5</param.version>
<param.version>1.1.6</param.version>
<param.output>${PROJECT_ROOT}/IPOPT-toolbox.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -98,8 +98,11 @@
<file>${PROJECT_ROOT}/toolbox</file>
</fileset.rootdir>
<fileset.rootfiles>
<file>${PROJECT_ROOT}/toolbox/CMakeLists.txt</file>
<file>${PROJECT_ROOT}/toolbox/CompileIpoptMexLib.m</file>
<file>${PROJECT_ROOT}/toolbox/bin</file>
<file>${PROJECT_ROOT}/toolbox/build</file>
<file>${PROJECT_ROOT}/toolbox/cmake_utils</file>
<file>${PROJECT_ROOT}/toolbox/demos.xml</file>
<file>${PROJECT_ROOT}/toolbox/doc</file>
<file>${PROJECT_ROOT}/toolbox/examples</file>
Expand Down
68 changes: 33 additions & 35 deletions toolbox/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#-----------------------------------------------------------------------#
# file: CMakeLists.txt #
# #
# version: 1.0 date 9/3/2022 #
# version: 1.0 date March, 21, 2023 #
# #
# Copyright (C) 2022 #
# Copyright (C) 2023 #
# #
# Enrico Bertolazzi #
# Dipartimento di Ingegneria Industriale #
Expand Down Expand Up @@ -47,43 +47,41 @@ message( STATUS "Compiler used: ${CMAKE_CXX_COMPILER_ID}" )
message( STATUS "BASE SUFFIXES = ${ARTIFACTS_STATIC_SUFFIX} ${ARTIFACTS_DYNAMIC_SUFFIX}" )

# extra include directory for compilation
include_directories( src src_ipopt_osx/coin-or )
include_directories( src )

message( STATUS "SOURCES = ${SOURCES}" )

# _____ _
# |_ _|_ _ _ _ __ _ ___| |_ ___
# | |/ _` | '_/ _` / -_) _(_-<
# |_|\__,_|_| \__, \___|\__/__/
# |___/
#

utils_final_messages()

message( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
if ( CMAKE_BUILD_TYPE MATCHES Debug )
message( STATUS "DEBUG MODE\n\n")
add_compile_definitions(DEBUG)
if ( (UNIX OR LINUX) AND NOT APPLE )
include_directories( src_ipopt_linux/coin-or )
set( MEXNAME ipopt_linux )
elseif ( APPLE )
include_directories( src_ipopt_osx/coin-or )
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH ${CMAKE_CURRENT_SOURCE_DIR}/bin/osx )
set( MEXNAME ipopt_osx )
else()
include_directories( src_ipopt_win/coin-or )
set( MEXNAME ipopt_win )
endif()

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH ${CMAKE_CURRENT_SOURCE_DIR}/bin/osx )
utils_final_messages()

matlab_add_mex(
NAME ipopt_osx
NAME ${MEXNAME}
SRC src/ipopt.cc src/IpoptInterfaceCommon.cc
LINK_TO -L${CMAKE_CURRENT_SOURCE_DIR}/bin/osx -lblas -ldmumps
${CMAKE_CURRENT_SOURCE_DIR}/bin/osx/libgcc_s.1.dylib
-lgfortran.5
-lipopt.3
-lipoptamplinterface.3
-llapack
-lmpiseq
-lmumps_common
-lopenblas.0
-lpord
-lquadmath.0
-lsipopt.3
-lstdc++.6
OUTPUT_NAME ipopt_osx
LINK_TO -L${CMAKE_CURRENT_SOURCE_DIR}/bin/osx
-lblas
-ldmumps
-lgcc_s.1
-lgcc_s.1.1
-lgfortran.5
-lipopt.3
-lipoptamplinterface.3
-llapack
-lmpiseq
-lmumps_common
-lopenblas.0
-lpord
-lquadmath.0
-lsipopt.3
-lstdc++.6
OUTPUT_NAME ${MEXNAME}
)
1 change: 1 addition & 0 deletions toolbox/bin/osx/copy_dylib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'libgfortran.5.dylib',
'libquadmath.0.dylib',
'libstdc++.6.dylib',
'libgomp.1.dylib',
'libgcc_s.1.dylib',
'libgcc_s.1.1.dylib'
].each do |lib|
Expand Down
1 change: 1 addition & 0 deletions toolbox/bin/osx/filter_dylib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
LIST = %w(
libblas
libdmumps
libgomp.1
libgcc_s.1
libgcc_s.1.1
libgfortran.5
Expand Down
Binary file removed toolbox/bin/osx/ipopt_osx.mexmaci64
Binary file not shown.
Binary file removed toolbox/bin/osx/libblas.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libdmumps.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libgcc_s.1.1.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libgcc_s.1.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libgfortran.5.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libipopt.3.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libipoptamplinterface.3.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/liblapack.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libmpiseq.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libmumps_common.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libopenblas.0.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libpord.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libquadmath.0.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libsipopt.3.dylib
Binary file not shown.
Binary file removed toolbox/bin/osx/libstdc++.6.dylib
Binary file not shown.
Binary file removed toolbox/examples/libhsl.dylib
Binary file not shown.
2 changes: 1 addition & 1 deletion toolbox/examples/test_BartholomewBiggs.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
%options.ipopt.linear_solver = 'ma57';
%options.ipopt.linear_solver = 'ma77';
%options.ipopt.linear_solver = 'ma86';
%options.ipopt.linear_solver = 'ma97';
options.ipopt.linear_solver = 'ma97';

% PARDISO solver
% to use this solvers see README_HSL.md
Expand Down
Loading

0 comments on commit 85151db

Please sign in to comment.