-
Notifications
You must be signed in to change notification settings - Fork 156
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
Undefined references #82
Comments
it looks like gklib isn't being linked. Make sure there is a gklib shared object in your usr/local/lib after you build it |
I specified /usr/local on both installs, but it didn't work. I ended up installing using yay instead and it worked. |
The way to do this when building GKlib is:
In my specific case I need a bunch more flags. I found other people needing the same, so here they are:
Then METIS can be installed with:
|
The fix in #77 is much nicer (and complete) than some of the dark magic used on those flags. |
Just some notes: sudo apt-get update
sudo apt-get install build-essential git cmake vim git clone https://github.com/KarypisLab/GKlib.git
cd GKlib
make config prefix="~/local" CONFIG_FLAGS='-D CMAKE_INSTALL_PREFIX='$HOME'/local -D BUILD_SHARED_LIBS=ON'
make install # cd ..
git clone https://github.com/KarypisLab/METIS.git
cd METIS
make config shared=1 prefix=~/local
make install mkdir demo
cd demo
mkdir src
vim src/main.cpp
# ...
vim Makefile
# ... A demo cpp main file to test with: https://gist.github.com/erikzenker/c4dc42c8d5a8c1cd3e5a Makefile: run: build
LD_LIBRARY_PATH=~/local/lib ./build/main
build: clean
mkdir -p build
g++ src/*.cpp -std=c++11 -I ~/local/include -L ~/local/lib -lmetis -lGKlib -W -Wall -O3 -o ./build/main
clean:
rm ./build/main || true |
I have built GKLib version
make config prefix=/usr/local/
sudo make install
Then I build METIS
make config shared=1 cc=gcc prefix=/usr/local
sudo make install
when I try to build colmap I get:
[97%] Linking CXX executable colmap
/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_randint32' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_mcorePop'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_rmpath' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_free'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_mcoreCreate' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_CPUSeconds'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_jbufs' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_siguntrap'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_idxsmalloc' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_cur_jbufs'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_errexit' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_malloc_init'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_mcoreDestroy' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_randinit'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_realloc' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_log2'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_mcorePush' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_malloc_cleanup'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_mcoreMalloc' /usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to
gk_sigtrap'/usr/bin/ld: /usr/local/lib/libmetis.so: undefined reference to `gk_malloc'
collect2: error: ld returned 1 exit status
make[2]: *** [src/colmap/exe/CMakeFiles/colmap_main.dir/build.make:278: src/colmap/exe/colmap] Error 1
make[1]: *** [CMakeFiles/Makefile2:668: src/colmap/exe/CMakeFiles/colmap_main.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
nm -D /usr/local/lib/libmetis.so | grep gk_
U gk_CPUSeconds
U gk_cur_jbufs
U gk_errexit
U gk_free
U gk_idxsmalloc
U gk_jbufs
U gk_log2
U gk_malloc
U gk_malloc_cleanup
U gk_malloc_init
U gk_mcoreCreate
U gk_mcoreDestroy
U gk_mcoreMalloc
U gk_mcorePop
U gk_mcorePush
U gk_randinit
U gk_randint32
U gk_realloc
U gk_rmpath
U gk_sigtrap
U gk_siguntrap
The text was updated successfully, but these errors were encountered: