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

issues when installing DSP on mac m1 #272

Open
DanielNeira opened this issue Jun 17, 2023 · 5 comments
Open

issues when installing DSP on mac m1 #272

DanielNeira opened this issue Jun 17, 2023 · 5 comments

Comments

@DanielNeira
Copy link

DanielNeira commented Jun 17, 2023

I was trying to install this package to do some research but I'm finding hard to make it work.
I follow the instructions (although the latest version documentation is misleading). I changed the following from file 'UserConfig.cmake':

set(MA27LIB_DIR     "/usr/local/lib/")
set(GFORTRANLIB		"$ENV{GFORTRANLIB}")
set(GFORTRANLIB		"/usr/local/bin/gfortran")
set(GFORTRANLIB	"/usr/local/Cellar/gcc/13.1.0/lib/gcc/13/libgfortran.a")
set(SCIPOPT_INC_DIR "/Users/daniel/SCIPOptSuite-8.0.3-Darwin/include/")
set(SCIPOPT_LIB_DIR "/Users/daniel/SCIPOptSuite-8.0.3-Darwin/lib/")

follow the commands:

mkdir build
cd build
cmake ..
make

and I'm running into this error:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/libDsp.dylib] Error 1
make[1]: *** [src/CMakeFiles/Dsp.dir/all] Error 2
make: *** [all] Error 2

I'm new to the use of flags and the link of multiples shared libraries so I tried what I found on the internet unsuccessful.
I have a Macbook Pro with chip apple m1 running macOS Ventura 13.0.1 and maybe that's the source of error.
I attached the entire messsage.
issue.txt

@kibaekkim
Copy link
Collaborator

I could not test it on M1. But I suspect that you may have version conflict between clang and gnu compilers. Can you do the following?

  1. Use the latest release (v1.5.4), or you can pull release branch. I just made some changes in cmake and released the new version.
  2. Remove build directory and run the following:
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
make

Here I assumed that you can run gcc-13 for your GNU compiler. With the command lines above, you may not need to set the gfortran path. So you may remove this:

set(GFORTRANLIB		"$ENV{GFORTRANLIB}")
set(GFORTRANLIB		"/usr/local/bin/gfortran")
set(GFORTRANLIB	"/usr/local/Cellar/gcc/13.1.0/lib/gcc/13/libgfortran.a")

@DanielNeira
Copy link
Author

Thanks for the help!

Now I'm getting this error

(base) daniel@MacBook-Pro-de-Daniel build % cmake .. -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
CMake Warning (dev) at CMakeLists.txt:1 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc-13 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++-13 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 13.1.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/local/bin/gfortran - skipped
-- The system information: Darwin-22.1.0.x86_64
-- Build type: Release
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: /Users/daniel/opt/anaconda3/lib/libmkl_intel_lp64.dylib;/Users/daniel/opt/anaconda3/lib/libmkl_intel_thread.dylib;/Users/daniel/opt/anaconda3/lib/libmkl_core.dylib;/Users/daniel/opt/anaconda3/lib/libiomp5.dylib;-lm;-ldl  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- Found LAPACK: /Users/daniel/opt/anaconda3/lib/libmkl_intel_lp64.dylib;/Users/daniel/opt/anaconda3/lib/libmkl_intel_thread.dylib;/Users/daniel/opt/anaconda3/lib/libmkl_core.dylib;/Users/daniel/opt/anaconda3/lib/libiomp5.dylib;-lm;-ldl;-lm;-ldl  
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
-- Found BZip2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libbz2.tbd (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found MPI_C: /usr/local/Cellar/open-mpi/4.1.5/lib/libmpi.dylib (found version "3.1") 
-- Found MPI_CXX: /usr/local/Cellar/open-mpi/4.1.5/lib/libmpi.dylib (found version "3.1") 
-- Found MPI_Fortran: /usr/local/Cellar/open-mpi/4.1.5/lib/libmpi_usempif08.dylib (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found /Users/daniel/SCIPOptSuite-8.0.3-Darwin/lib/libscip.dylib
-- Found /usr/local/lib/libma27.a
-- Found libgfortran: /Users/daniel/opt/anaconda3/lib/libgfortran.dylib
CMake Error at /usr/local/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:3131 (message):
  No download info given for 'OOQP' and its source directory:

   /Users/daniel/DSP-1.5.4/extra/OOQP

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:4208 (_ep_add_download_command)
  extra/CMakeLists.txt:32 (ExternalProject_Add)


-- Configuring incomplete, errors occurred!

@kibaekkim
Copy link
Collaborator

Did you clone the repo with

git clone --recursive ...

?

@DanielNeira
Copy link
Author

DanielNeira commented Jun 19, 2023

sorry, I did twice.
First time doesn't work.
Now, I'm able to compile it but I still having some issues when running runDsp

(base) daniel@MacBook-Pro-de-Daniel bin % ./runDsp
dyld[20941]: Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: <328A4527-556E-36E3-8E08-EF28636C77EB> /Users/daniel/DSP-release/DSP-1/build/bin/runDsp
  Reason: tried: '/Users/daniel/SCIPOptSuite-8.0.3-Darwin/lib/libgfortran.3.dylib' (no such file), '/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libgfortran.3.dylib' (no such file), '/usr/local/lib/libgfortran.3.dylib' (no such file), '/usr/lib/libgfortran.3.dylib' (no such file, not in dyld cache)

I notice that

-- Found libgfortran: /Users/daniel/opt/anaconda3/lib/libgfortran.dylib

I tried by adding

export DYLD_LIBRARY_PATH=/Users/daniel/opt/anaconda3/lib:$DYLD_LIBRARY_PATH

to ~/.zshrc

and now I got

(base) daniel@MacBook-Pro-de-Daniel bin % ./runDsp
dyld[21257]: Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: <B361FD71-780A-35EE-B647-2F586B784498> /Users/daniel/DSP-release/DSP/build/bin/runDsp
  Expected in:     <821DF483-F25C-33CC-BA5F-759F05262E03> /Users/daniel/opt/anaconda3/lib/libc++.1.0.dylib
zsh: abort      ./runDsp

issue2.txt

@kibaekkim
Copy link
Collaborator

It looks like your fortran version may not be compatible to the one used in SCIP.

First of all, do you need SCIP? SCIP is required when 1. you plan to run Benders; or 2. you do not have license for CPLEX or Gurobi. (CPLEX and Gurobi offer free academic license).

If you need to compile DSP with SCIP, are you using one of the precompiled packages? It requires libgfortran4 or libgfortran5 when ipopt is precompiled together. And it looks like you are using libgfortran3.

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

No branches or pull requests

2 participants