r-barnes / Barnes2019-DepressionHierarchy

Fast handling of depressions in flow graphs
MIT License
9 stars 7 forks source link

Install on Mac #5

Closed SiccarPoint closed 4 years ago

SiccarPoint commented 4 years ago

Hi Richard,

Moving this over here as I suspect it might be related to r-barnes/Barnes2020-FillSpillMerge#2.

Decided to try direct installs of richdem (on pip, fine) and dephier, and for dephier this happened. The build appears to get made OK, but then I cannot actually run the software, with the prompt complaining dyld: Library not loaded: @rpath/libomp.dylib... Reason: image not found. Note that the upgrade command also appears not to have taken here. Possibly this is also happening with r-barnes/Barnes2020-FillSpillMerge#2.

Again, same setup as at the other issue: iMac Catalina, forced downgrade of the Xcode SDK to 10.9 to get cmake firing.

(base) ➜  development git clone --recurse-submodules -j8 https://github.com/r-barnes/Barnes2019-DepressionHierarchy.git
Cloning into 'Barnes2019-DepressionHierarchy'...
remote: Enumerating objects: 45, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 376 (delta 16), reused 35 (delta 8), pack-reused 331
Receiving objects: 100% (376/376), 232.34 KiB | 975.00 KiB/s, done.
Resolving deltas: 100% (202/202), done.
Submodule 'submodules/richdem' (https://github.com/r-barnes/richdem.git) registered for path 'submodules/richdem'
Cloning into '/Users/danhobley/development/Barnes2019-DepressionHierarchy/submodules/richdem'...
remote: Enumerating objects: 27, done.        
remote: Counting objects: 100% (27/27), done.        
remote: Compressing objects: 100% (16/16), done.        
remote: Total 10977 (delta 16), reused 21 (delta 11), pack-reused 10950        
Receiving objects: 100% (10977/10977), 11.08 MiB | 2.01 MiB/s, done.
Resolving deltas: 100% (7277/7277), done.
Submodule path 'submodules/richdem': checked out '349fc363b622e68a652c44211d20fe50094ea43c'
Submodule 'docs/richdem-docs' (https://github.com/r-barnes/richdem-docs.git) registered for path 'submodules/richdem/docs/richdem-docs'
Cloning into '/Users/danhobley/development/Barnes2019-DepressionHierarchy/submodules/richdem/docs/richdem-docs'...
remote: Enumerating objects: 667, done.        
remote: Total 667 (delta 0), reused 0 (delta 0), pack-reused 667        
Receiving objects: 100% (667/667), 87.61 MiB | 2.41 MiB/s, done.
Resolving deltas: 100% (324/324), done.
Submodule path 'submodules/richdem/docs/richdem-docs': checked out '2ed8749b771924932cc62a7ca90ff06e7009f0f6'

(base) ➜  development cd Barnes2019-DepressionHierarchy 
(base) ➜  Barnes2019-DepressionHierarchy git:(master) git submodule --update --recursive
usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]

(base) ➜  Barnes2019-DepressionHierarchy git:(master) mkdir build
(base) ➜  Barnes2019-DepressionHierarchy git:(master) cd build
(base) ➜  build git:(master) cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /Users/danhobley/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /Users/danhobley/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Users/danhobley/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang++
-- Check for working CXX compiler: /Users/danhobley/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found NetCDF: /usr/local/lib/libnetcdf.dylib  
-- Found GDAL: /usr/local/Cellar/gdal/2.4.4_6/lib/libgdal.dylib (found version "2.4.4") 
-- Found OpenMP_C: -fopenmp=libomp (found version "3.1") 
-- Found OpenMP_CXX: -fopenmp=libomp (found version "3.1") 
-- Found OpenMP: TRUE (found version "3.1")  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/danhobley/development/Barnes2019-DepressionHierarchy/build

(base) ➜  build git:(master) make -j 4
Scanning dependencies of target richdem
[ 28%] Building CXX object submodules/richdem/CMakeFiles/richdem.dir/include/richdem/common/random.cpp.o
[ 28%] Building CXX object submodules/richdem/CMakeFiles/richdem.dir/include/richdem/richdem.cpp.o
[ 42%] Linking CXX static library librichdem.a
[ 42%] Built target richdem
Scanning dependencies of target dephier.exe
Scanning dependencies of target dephier_paper_tests.exe
[ 71%] Building CXX object CMakeFiles/dephier_paper_tests.exe.dir/src/dephier_paper_tests.cpp.o
[ 71%] Building CXX object CMakeFiles/dephier.exe.dir/src/main.cpp.o
[ 85%] Linking CXX executable dephier.exe
[ 85%] Built target dephier.exe
[100%] Linking CXX executable dephier_paper_tests.exe
[100%] Built target dephier_paper_tests.exe

(base) ➜  build git:(master) cd ..
(base) ➜  Barnes2019-DepressionHierarchy git:(master) cd ..
(base) ➜  development cd Barnes2019-DepressionHierarchy 
(base) ➜  Barnes2019-DepressionHierarchy git:(master) ./build/dephier.exe
dyld: Library not loaded: @rpath/libomp.dylib
  Referenced from: /Users/danhobley/development/Barnes2019-DepressionHierarchy/./build/dephier.exe
  Reason: image not found
[1]    24196 abort      ./build/dephier.exe
(base) ➜  Barnes2019-DepressionHierarchy git:(master) ./build/dephier    
zsh: no such file or directory: ./build/dephier
(base) ➜  Barnes2019-DepressionHierarchy git:(master) cd build
(base) ➜  build git:(master) ls
CMakeCache.txt          cmake_install.cmake     submodules
CMakeFiles              dephier.exe
Makefile                dephier_paper_tests.exe
(base) ➜  build git:(master) dephier
zsh: command not found: dephier
(base) ➜  build git:(master) dephier.exe
zsh: command not found: dephier.exe
(base) ➜  build git:(master) ./dephier.exe
dyld: Library not loaded: @rpath/libomp.dylib
  Referenced from: /Users/danhobley/development/Barnes2019-DepressionHierarchy/build/./dephier.exe
  Reason: image not found
[1]    24263 abort      ./dephier.exe
SiccarPoint commented 4 years ago

I resolved the submodule update; I needed git submodule update --recursive not git submodule --update --recursive as in the readme.

But even with this fixed, I still cannot run dephier.exe, with everything looking exactly as above.

SiccarPoint commented 4 years ago

I made #6 to separate these issues out, for convenience.

r-barnes commented 4 years ago

@SiccarPoint : The issue you're finding is something to do with your environment. This suggests that you try:

brew install libomp
SiccarPoint commented 4 years ago

This has fixed it! Thank you!