dthierry / k_aug

KKT matrix sensitivity and Reduced Hessian computation
BSD 3-Clause "New" or "Revised" License
7 stars 8 forks source link

Installation tricks for macOS #43

Open adowling2 opened 4 years ago

adowling2 commented 4 years ago

I recently installed Ipopt using coinbrew, which is the new recommended "easy install" procedure. Unfortunately, metis is now longer packaged with Ipopt when installed via coinbrew:

https://github.com/coin-or/Ipopt/releases/tag/releases%2F3.13.2

adowling2 commented 4 years ago

Work around:

I installed both Metis and ASL from these git repos to ensure the correct libraries were in /usr/local/bin. This was an extra step because I installed Ipopt with coinbrew: https://github.com/coin-or-tools/ThirdParty-ASL https://github.com/coin-or-tools/ThirdParty-Metis

adowling2 commented 4 years ago

Another issue: I installed g++ and gcc via homebrew. I had to add flags when calling cmake to avoid a conflict with clang:

cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ CMakeLists.txt 
adowling2 commented 4 years ago

Current challenge. I am getting the error ld: library not found for -lgfortran. I tried installing gfortran with homebrew. Next idea: add a flag to cmake.

This might also be the problem: https://discourse.brew.sh/t/cmake-linking-not-working-since-mojave/3790

Solution: I had to add the line LINK_DIRECTORIES(/usr/local/gfortran/lib/) to CMakeList.txt.